Alpha + channels tweak for inactive tabs. Final
This commit is contained in:
@@ -417,8 +417,8 @@ class PFTabRenderer:
|
|||||||
|
|
||||||
def InitColors(self):
|
def InitColors(self):
|
||||||
self.tabColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
|
self.tabColor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
|
||||||
self.leftColor = self.CalculateColor(self.tabColor, 0x30)
|
self.leftColor = self.CalculateColor(self.tabColor, 0x40)
|
||||||
self.rightColor = self.CalculateColor(self.tabColor, 0x20)
|
self.rightColor = self.CalculateColor(self.tabColor, 0x15)
|
||||||
|
|
||||||
def CalculateColor(self, color, delta):
|
def CalculateColor(self, color, delta):
|
||||||
bkR ,bkG , bkB = color
|
bkR ,bkG , bkB = color
|
||||||
@@ -1005,6 +1005,11 @@ class PFTabsContainer(wx.Panel):
|
|||||||
startColor = self.leftColor = self.CalculateColor(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW), 0x50)
|
startColor = self.leftColor = self.CalculateColor(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW), 0x50)
|
||||||
tabsWidth = 0
|
tabsWidth = 0
|
||||||
|
|
||||||
|
bkR ,bkG , bkB = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)
|
||||||
|
if bkR + bkG + bkB > 127*3:
|
||||||
|
delta = -0.05
|
||||||
|
else:
|
||||||
|
delta = 0.2
|
||||||
|
|
||||||
for tab in self.tabs:
|
for tab in self.tabs:
|
||||||
tabsWidth += tab.tabWidth - self.inclination*2
|
tabsWidth += tab.tabWidth - self.inclination*2
|
||||||
@@ -1019,17 +1024,15 @@ class PFTabsContainer(wx.Panel):
|
|||||||
width = tab.tabWidth - 6
|
width = tab.tabWidth - 6
|
||||||
posx, posy = tab.GetPosition()
|
posx, posy = tab.GetPosition()
|
||||||
if not tab.IsSelected():
|
if not tab.IsSelected():
|
||||||
# if not 'wxMac' in wx.PlatformInfo:
|
|
||||||
mdc.DrawBitmap(self.efxBmp, posx, posy, True )
|
mdc.DrawBitmap(self.efxBmp, posx, posy, True )
|
||||||
img = tab.Render().ConvertToImage()
|
img = tab.Render().ConvertToImage()
|
||||||
img = img.AdjustChannels(0.95, 0.95, 0.95, 0.75)
|
img = img.AdjustChannels(1 + delta, 1 + delta, 1 + delta, 0.85)
|
||||||
bmp = wx.BitmapFromImage(img)
|
bmp = wx.BitmapFromImage(img)
|
||||||
mdc.DrawBitmap(bmp, posx, posy, True)
|
mdc.DrawBitmap(bmp, posx, posy, True)
|
||||||
else:
|
else:
|
||||||
selected = tab
|
selected = tab
|
||||||
if selected:
|
if selected:
|
||||||
posx, posy = selected.GetPosition()
|
posx, posy = selected.GetPosition()
|
||||||
# if not 'wxMac' in wx.PlatformInfo:
|
|
||||||
mdc.DrawBitmap(self.efxBmp, posx, posy, True)
|
mdc.DrawBitmap(self.efxBmp, posx, posy, True)
|
||||||
bmp = selected.Render()
|
bmp = selected.Render()
|
||||||
if self.dragging:
|
if self.dragging:
|
||||||
@@ -1047,8 +1050,6 @@ class PFTabsContainer(wx.Panel):
|
|||||||
offset = 0
|
offset = 0
|
||||||
r1 = wx.Rect(0,self.containerHeight -1,selpos,1)
|
r1 = wx.Rect(0,self.containerHeight -1,selpos,1)
|
||||||
r2 = wx.Rect(0, self.containerHeight -1 , self.width,1)
|
r2 = wx.Rect(0, self.containerHeight -1 , self.width,1)
|
||||||
# mdc.GradientFillLinear(r1, startColor, selColor, wx.EAST)
|
|
||||||
# mdc.GradientFillLinear(r2, selColor, startColor, wx.EAST)
|
|
||||||
|
|
||||||
def OnErase(self, event):
|
def OnErase(self, event):
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user