toggle color of cfg button depending on state
This commit is contained in:
5
frame.py
5
frame.py
@@ -49,11 +49,16 @@ class Frame:
|
||||
self.btn_close.on_click(*args, **kwargs)
|
||||
|
||||
def do_click_cfg(self):
|
||||
toggle_button_type(self.btn_cfg, "default", "warning")
|
||||
self.inner.visible = False
|
||||
switch_visibility(self.plt.fig, self.cfg_dialog)
|
||||
self.inner.visible = True
|
||||
|
||||
|
||||
|
||||
def toggle_button_type(btn, type1, type2):
|
||||
btn.button_type = type2 if btn.button_type == type1 else type1
|
||||
|
||||
def switch_visibility(a, b):
|
||||
a.visible, b.visible = b.visible, a.visible
|
||||
|
||||
|
||||
Reference in New Issue
Block a user