From 7b73c0868ab1ff77abe88572be59886f51ed9c83 Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Sat, 30 Oct 2010 17:20:14 +0200 Subject: [PATCH] Change background color to red when there's a slot overflow (only happens on T3 atm) --- gui/fittingView.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gui/fittingView.py b/gui/fittingView.py index e93c78da8..a30efe447 100644 --- a/gui/fittingView.py +++ b/gui/fittingView.py @@ -249,4 +249,15 @@ class FittingView(d.Display): else: event.Skip() - \ No newline at end of file + def refresh(self, stuff): + d.Display.refresh(self, stuff) + sFit = service.Fit.getInstance() + fit = sFit.getFit(self.activeFitID) + slotMap = {} + for slotType in Slot.getTypes(): + slot = Slot.getValue(slotType) + slotMap[slot] = fit.getSlotsFree(slot) < 0 + + for i, mod in enumerate(self.mods): + if slotMap[mod.slot]: + self.SetItemBackgroundColour(i, wx.Colour(255, 51, 51))