From 576bfb0512b3e733722b3be279b8e15a3353dd15 Mon Sep 17 00:00:00 2001 From: Ebad Kamil Date: Wed, 17 Mar 2021 08:20:06 +0100 Subject: [PATCH] Change toolbar btn background color if enabled --- nexus_constructor/treeview_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nexus_constructor/treeview_utils.py b/nexus_constructor/treeview_utils.py index 4b500e0c6..9f37f263e 100644 --- a/nexus_constructor/treeview_utils.py +++ b/nexus_constructor/treeview_utils.py @@ -150,6 +150,9 @@ def set_enabled_and_raise(action: QAction, value: bool): for widget in action.associatedWidgets(): if isinstance(widget, QToolButton): widget.setAutoRaise(not value) + # Change background color to pale gray if button is enabled + color = "#d7d6d5" if value else "white" + widget.setStyleSheet(f"background-color: {color}") def handle_number_of_items_selected_is_not_one(