Added highlight feature to the compare item window. Double click and item to highlight and bold it.
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -90,6 +90,7 @@ target/
|
||||
|
||||
# pyenv
|
||||
.python-version
|
||||
PyfaEnv/
|
||||
|
||||
# celery beat schedule file
|
||||
celerybeat-schedule
|
||||
@@ -123,3 +124,6 @@ gitversion
|
||||
|
||||
*.fsdbinary
|
||||
/locale/progress.json
|
||||
|
||||
launch.json
|
||||
eve.db
|
||||
@@ -36,6 +36,10 @@ class ItemCompare(wx.Panel):
|
||||
self.item = item
|
||||
self.items = sorted(items, key=defaultSort)
|
||||
self.attrs = {}
|
||||
self.defaultRowBackgroundColour = None
|
||||
self.HighlightOn = wx.Colour(255, 255, 0, wx.ALPHA_OPAQUE)
|
||||
self.HighlightOff = wx.Colour(-1, -1, -1, -127)
|
||||
self.highlightedRows = []
|
||||
|
||||
# get a dict of attrName: attrInfo of all unique attributes across all items
|
||||
for item in self.items:
|
||||
@@ -88,6 +92,24 @@ class ItemCompare(wx.Panel):
|
||||
self.toggleViewBtn.Bind(wx.EVT_TOGGLEBUTTON, self.ToggleViewMode)
|
||||
self.Bind(wx.EVT_LIST_COL_CLICK, self.SortCompareCols)
|
||||
|
||||
self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.HighlightRow)
|
||||
|
||||
def HighlightRow(self, event):
|
||||
itemIdx = event.GetIndex()
|
||||
item = self.paramList.GetItem(itemIdx)
|
||||
if itemIdx in self.highlightedRows:
|
||||
item.SetBackgroundColour(self.HighlightOff)
|
||||
f = item.GetFont()
|
||||
f.SetWeight(wx.FONTWEIGHT_NORMAL)
|
||||
item.SetFont(f)
|
||||
self.highlightedRows.remove(itemIdx)
|
||||
else:
|
||||
item.SetBackgroundColour(self.HighlightOn)
|
||||
item.SetFont(item.GetFont().MakeBold())
|
||||
self.highlightedRows.append(itemIdx)
|
||||
self.paramList.SetItem(item)
|
||||
|
||||
|
||||
def SortCompareCols(self, event):
|
||||
self.Freeze()
|
||||
self.paramList.ClearAll()
|
||||
@@ -214,4 +236,4 @@ class ItemCompare(wx.Panel):
|
||||
fvalue = v
|
||||
return "%s %s" % (fvalue, override[1])
|
||||
else:
|
||||
return "%s %s" % (formatAmount(value, 3, 0), unitName)
|
||||
return "%s %s" % (formatAmount(value, 3, 0), unitName)
|
||||
Reference in New Issue
Block a user