comparison libgui/graphics/BaseControl.cc @ 28248:aee0f20c8029

Implement "gray" when uicontrol radiobutton/checkbox are disabled (bug #57128) * BaseControl.cc (updatePalette): Call setColor() with additional argument of "QPalette::Active" and again with "QPalette::Inactive" so that colors are set only for specific roles. * CheckBoxControl.h (CheckBoxControl): Declare new private member function update(). * CheckBoxControl.cc (CheckBoxControl): Check for "Enable" property value of "inactive" and call setCheckable (false) if found. * CheckBoxControl.cc (update): New function to intercept and handle change to "Enable" property before forwarding to BaseControl. * RadioButtonControl.cc (RadioButtonControl): Check for "Enable" property value of "inactive" and call setCheckable (false) if found. * RadioButtonControl.cc (update): New function to intercept and handle change to "Enable" property before forwarding to BaseControl.
author Rik <rik@octave.org>
date Sun, 26 Apr 2020 18:15:30 -0700
parents 20794455ea11
children be4a6f33d142
comparison
equal deleted inserted replaced
28247:20794455ea11 28248:aee0f20c8029
72 return; 72 return;
73 } 73 }
74 else if (props.style_is ("radiobutton") 74 else if (props.style_is ("radiobutton")
75 || props.style_is ("checkbox")) 75 || props.style_is ("checkbox"))
76 { 76 {
77 p.setColor (QPalette::Button, 77 p.setColor (QPalette::Active, QPalette::Button,
78 Utils::fromRgb (props.get_backgroundcolor_rgb ())); 78 Utils::fromRgb (props.get_backgroundcolor_rgb ()));
79 p.setColor (QPalette::WindowText, 79 p.setColor (QPalette::Inactive, QPalette::Button,
80 Utils::fromRgb (props.get_backgroundcolor_rgb ()));
81 p.setColor (QPalette::Active, QPalette::WindowText,
82 Utils::fromRgb (props.get_foregroundcolor_rgb ()));
83 p.setColor (QPalette::Inactive, QPalette::WindowText,
80 Utils::fromRgb (props.get_foregroundcolor_rgb ())); 84 Utils::fromRgb (props.get_foregroundcolor_rgb ()));
81 } 85 }
82 else if (props.style_is ("pushbutton") 86 else if (props.style_is ("pushbutton")
83 || props.style_is ("togglebutton")) 87 || props.style_is ("togglebutton"))
84 { 88 {