toggle color of cfg button depending on state

This commit is contained in:
2021-05-31 18:12:50 +02:00
parent bb1f23cf0d
commit 449ba05819

View File

@@ -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