Merge branch 'master' into dep_facelift

This commit is contained in:
DarkPhoenix
2022-09-30 20:50:36 +04:00
2 changed files with 22 additions and 15 deletions

View File

@@ -11,7 +11,7 @@ for:
environment:
APPVEYOR_SSH_KEY: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJDW/+oYNGOiPvwuwAL9tc/LQgg58aosIVpMYfepQZ20V+VZnHpZh8IRDA8Jo5xht19p2PksA+hFgqA0kpKtrSkuiWdE8rATQItfk4gf7yB0yGasJGGQZYazy9k/9XtmYkq2HHOOeEqdxvrICddJQ88MLCLT9lJENSUP/YS/yGcjZFXVxE11pTeIcqlCRU+3eYa1v7BeNvXIKNhZoK5orXWrtuH3cy8jrSns/u70aYfJ6B2jA8CnWnDbuvpeQtEY61SQqlKUsSArNa8NAsXj41wr3Ar9gAG9330w7EMTqlutk8HZO35uHI0q5qinUhaQYufPPrVkb2L/N+ZCfu0fnh appveyor"
APPIMAGE_TOOL: appimagetool-x86_64.AppImage
PYTHON_APPIMAGE: python3.7.13-cp37-cp37m-manylinux2014_x86_64.AppImage
PYTHON_APPIMAGE: python3.7.14-cp37-cp37m-manylinux2014_x86_64.AppImage
DEPLOY_DIR: AppDir/opt/pyfa
# APPVEYOR_SSH_BLOCK: true
cache:

View File

@@ -37,8 +37,7 @@ class ItemCompare(wx.Panel):
self.items = sorted(items, key=defaultSort)
self.attrs = {}
self.HighlightOn = wx.Colour(255, 255, 0, wx.ALPHA_OPAQUE)
self.HighlightOff = wx.Colour(-1, -1, -1, -127)
self.highlightedRows = []
self.highlightedNames = []
# get a dict of attrName: attrInfo of all unique attributes across all items
for item in self.items:
@@ -95,19 +94,16 @@ class ItemCompare(wx.Panel):
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)
name = self.paramList.GetItem(itemIdx).Text
if name in self.highlightedNames:
self.highlightedNames.remove(name)
else:
item.SetBackgroundColour(self.HighlightOn)
item.SetFont(item.GetFont().MakeBold())
self.highlightedRows.append(itemIdx)
self.paramList.SetItem(item)
self.highlightedNames.append(name)
self.Freeze()
self.paramList.ClearAll()
self.PopulateList()
self.Thaw()
event.Skip()
def SortCompareCols(self, event):
self.Freeze()
@@ -176,6 +172,8 @@ class ItemCompare(wx.Panel):
self.paramList.InsertColumn(len(self.attrs) + 1, _t("Price"))
self.paramList.SetColumnWidth(len(self.attrs) + 1, 60)
toHighlight = []
for item in self.items:
i = self.paramList.InsertItem(self.paramList.GetItemCount(), item.name)
for x, attr in enumerate(self.attrs.keys()):
@@ -193,10 +191,19 @@ class ItemCompare(wx.Panel):
# Add prices
self.paramList.SetItem(i, len(self.attrs) + 1, formatAmount(item.price.price, 3, 3, 9, currency=True) if item.price.price else "")
if item.name in self.highlightedNames:
toHighlight.append(i)
self.paramList.RefreshRows()
self.Layout()
# Highlight after layout, otherwise colors are getting overwritten
for itemIdx in toHighlight:
listItem = self.paramList.GetItem(itemIdx)
listItem.SetBackgroundColour(self.HighlightOn)
listItem.SetFont(listItem.GetFont().MakeBold())
self.paramList.SetItem(listItem)
@staticmethod
def TranslateValueUnit(value, unitName, unitDisplayName):
def itemIDCallback():