Refresh market filter when fit changed

This commit is contained in:
2025-12-06 01:29:39 +01:00
parent ca2a80cc85
commit 4ddf1733e4
2 changed files with 18 additions and 8 deletions

View File

@@ -154,19 +154,22 @@ class ItemView(Display):
# skip the event so the other handlers also get called
event.Skip()
if self.marketBrowser.mode != 'charges':
return
activeFitID = self.mainFrame.getActiveFit()
# if it was not the active fitting that was changed, do not do anything
if activeFitID is not None and activeFitID not in event.fitIDs:
return
items = self.getChargesForActiveFit()
# update the UI
self.updateItemStore(items)
self.filterItemStore()
# Handle charges mode
if self.marketBrowser.mode == 'charges':
items = self.getChargesForActiveFit()
# update the UI
self.updateItemStore(items)
self.filterItemStore()
return
# If "Fits" filter is active, re-filter the current view
if self.marketBrowser.getFitsFilter():
self.filterItemStore()
def updateItemStore(self, items):
self.unfilteredStore = items

View File

@@ -153,6 +153,13 @@ class MarketBrowser(wx.Panel):
self.itemView.filterItemStore()
def getFitsFilter(self):
"""Check if Fits button is active"""
for btn in self.slotButtons:
if btn.filterType == "fits" and btn.userSelected:
return True
return False
def jump(self, item):
self.mode = 'normal'
self.marketView.jump(item)