changeset 28247:20794455ea11

Implement "gray" when uicontrol popupmenus are disabled (bug #57128). * BaseControl.cc (updatePalette): For popupmenu type, add ":enabled" to beginning of StyleSheet specification so that custom colors are only applied when widget is active.
author Rik <rik@octave.org>
date Sun, 26 Apr 2020 15:11:51 -0700
parents c387a55aed05
children aee0f20c8029
files libgui/graphics/BaseControl.cc
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/graphics/BaseControl.cc	Sun Apr 26 15:01:41 2020 -0700
+++ b/libgui/graphics/BaseControl.cc	Sun Apr 26 15:11:51 2020 -0700
@@ -65,8 +65,8 @@
         // This requires setting colors for both.
         QColor bcol = Utils::fromRgb (props.get_backgroundcolor_rgb ());
         QColor fcol = Utils::fromRgb (props.get_foregroundcolor_rgb ());
-        QString qss = QString ("background: %1 none;\n"
-                               "color: %2;")
+        QString qss = QString (":enabled { background: %1 none;\n"
+                                          "color: %2; }")
                       .arg(bcol.name ()).arg (fcol.name ());
         w->setStyleSheet(qss);
         return;