From 396cb14c9a66cd3055941d5b64e1f7dd03f6d8c4 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Wed, 22 Dec 2010 19:04:31 +0200 Subject: [PATCH] Updated pygauges to use gui.utils.drawUtils.DrawGradientBar --- gui/pygauge.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gui/pygauge.py b/gui/pygauge.py index 15adb591c..660e10665 100644 --- a/gui/pygauge.py +++ b/gui/pygauge.py @@ -16,6 +16,7 @@ import copy import math from gui.utils import colorUtils +import gui.utils.drawUtils as drawUtils class PyGauge(wx.PyWindow): """ @@ -297,7 +298,7 @@ class PyGauge(wx.PyWindow): w = rect.width * (float(value) / 100) r = copy.copy(rect) r.width = w - r.height = r.height/2+1 + pv = value xv=1 @@ -337,9 +338,8 @@ class PyGauge(wx.PyWindow): gcolor = colorUtils.DarkenColor(color, float(-self.gradientEffect) / 100) gMid = colorUtils.DarkenColor(color, float(-self.gradientEffect/2) / 100) - dc.GradientFillLinear(r, gMid, color, wx.SOUTH) - r.top = r.height - dc.GradientFillLinear(r, gcolor, color, wx.NORTH) + gBmp = drawUtils.DrawGradientBar(r.width, r.height, gMid, color, gcolor) + dc.DrawBitmap(gBmp,r.left, r.top) else: colour=self.GetBarColour() dc.SetBrush(wx.Brush(colour))