From 449ba058191cf97db57070ab39e16fb49efe95fc Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Mon, 31 May 2021 18:12:50 +0200 Subject: [PATCH] toggle color of cfg button depending on state --- frame.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frame.py b/frame.py index d7dbd26..be2578a 100644 --- a/frame.py +++ b/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