Commit a460a44320428af174784a3ee2370a819ae64306
1 parent
d8293fcf
Exists in
master
and in
68 other branches
ENH: The coloured button in volume viewer follows the volume viewer background
Showing
2 changed files
with
10 additions
and
0 deletions
Show diff stats
invesalius/data/volume.py
... | ... | @@ -148,6 +148,7 @@ class Volume(): |
148 | 148 | self.SetShading() |
149 | 149 | colour = self.GetBackgroundColour() |
150 | 150 | ps.Publisher.sendMessage('Change volume viewer background colour', colour) |
151 | + ps.Publisher.sendMessage('Change volume viewer gui colour', colour) | |
151 | 152 | |
152 | 153 | |
153 | 154 | def OnSetRelativeWindowLevel(self, pubsub_evt): | ... | ... |
invesalius/gui/default_viewers.py
... | ... | @@ -267,6 +267,7 @@ class VolumeToolPanel(wx.Panel): |
267 | 267 | button_colour.Bind(csel.EVT_COLOURSELECT, self.OnSelectColour) |
268 | 268 | self.button_colour = button_colour |
269 | 269 | |
270 | + self.__bind_events() | |
270 | 271 | # SIZER TO ORGANIZE ALL |
271 | 272 | sizer = wx.BoxSizer(wx.VERTICAL) |
272 | 273 | sizer.Add(button_colour, 0, wx.ALL, 1) |
... | ... | @@ -275,6 +276,14 @@ class VolumeToolPanel(wx.Panel): |
275 | 276 | self.SetSizer(sizer) |
276 | 277 | sizer.Fit(self) |
277 | 278 | |
279 | + def __bind_events(self): | |
280 | + ps.Publisher().subscribe(self.ChangeButtonColour, | |
281 | + 'Change volume viewer gui colour') | |
282 | + | |
283 | + def ChangeButtonColour(self, pubsub_evt): | |
284 | + colour = [i*255 for i in pubsub_evt.data] | |
285 | + self.button_colour.SetColour(colour) | |
286 | + | |
278 | 287 | def OnMenuRaycasting(self, evt): |
279 | 288 | """Events from raycasting menu.""" |
280 | 289 | id = evt.GetId() | ... | ... |