From 2c5565bda98886841aecb2fd83b1176e8c63eb7e Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Mon, 16 May 2011 16:41:57 +0300 Subject: [PATCH] Minor visual improvement in race selection --- gui/shipBrowser.py | 7 ++++--- gui/utils/drawUtils.py | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py index 7dba7c20b..2269ce63e 100644 --- a/gui/shipBrowser.py +++ b/gui/shipBrowser.py @@ -201,9 +201,10 @@ class RaceSelector(wx.Window): sepColor = colorUtils.GetSuitableColor(windowColor, 0.6) mdc = wx.BufferedPaintDC(self) - mdc.SetBackground(wx.Brush(bkColor)) - mdc.Clear() - +# mdc.SetBackground(wx.Brush(bkColor)) +# mdc.Clear() + bkBitmap = drawUtils.RenderGradientBar(windowColor, rect.width, rect.height, 0.0, 0.1, 0.2, 2) + mdc.DrawBitmap(bkBitmap,0,0,True) # mdc.SetPen(wx.Pen(sepColor,1,wx.SOLID)) # if self.layout == wx.VERTICAL: # mdc.DrawLine(rect.width-1, 0 , rect.width-1, rect.height) diff --git a/gui/utils/drawUtils.py b/gui/utils/drawUtils.py index 07bb3317f..086e702a7 100644 --- a/gui/utils/drawUtils.py +++ b/gui/utils/drawUtils.py @@ -2,7 +2,7 @@ import wx import gui.utils.colorUtils as colorUtils -def RenderGradientBar(windowColor, width, height, sFactor, eFactor, mFactor = None): +def RenderGradientBar(windowColor, width, height, sFactor, eFactor, mFactor = None , fillRatio = 4): if sFactor == 0 and eFactor == 0 and mFactor == None: return DrawFilledBitmap(width,height, windowColor) @@ -16,7 +16,7 @@ def RenderGradientBar(windowColor, width, height, sFactor, eFactor, mFactor = No gEnd = colorUtils.GetSuitableColor(windowColor, eFactor) - return DrawGradientBar(width, height, gStart, gEnd, gMid) + return DrawGradientBar(width, height, gStart, gEnd, gMid, fillRatio) def DrawFilledBitmap(width, height, color): @@ -32,10 +32,10 @@ def DrawFilledBitmap(width, height, color): return canvas -def DrawGradientBar(width, height, gStart, gEnd, gMid = None): +def DrawGradientBar(width, height, gStart, gEnd, gMid = None, fillRatio = 4): canvas = wx.EmptyBitmap(width,height) - fillRatio = 4 + mdc = wx.MemoryDC() mdc.SelectObject(canvas)