Code color column to properly show wrapper color

This commit is contained in:
DarkPhoenix
2019-08-06 12:50:11 +03:00
parent 70d1a3534b
commit 0257e70c29
2 changed files with 17 additions and 10 deletions

View File

@@ -20,6 +20,7 @@
# noinspection PyPackageRequirements
import wx
from graphs.colors import BASE_COLORS
from graphs.wrapper import SourceWrapper
from gui.viewColumn import ViewColumn
@@ -36,8 +37,14 @@ class LineColor(ViewColumn):
self.mask = wx.LIST_MASK_TEXT
def getImageId(self, stuff):
red = self.fittingView.imageList.GetImageIndex('color_red', 'gui')
return red
if isinstance(stuff, SourceWrapper):
try:
color_data = BASE_COLORS[stuff.color]
except KeyError:
return -1
img = self.fittingView.imageList.GetImageIndex(color_data[1], 'gui')
return img
return -1
def getToolTip(self, stuff):
if isinstance(stuff, SourceWrapper):