Kaydet (Commit) b4b844f4 authored tarafından Szymon Kłos's avatar Szymon Kłos Kaydeden (comit) Caolán McNamara

gtk3: improved checkbox and radiobutton rendering

Change-Id: I6da03869dea172fb8d50396010152479afec9cde
Reviewed-on: https://gerrit.libreoffice.org/14554Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 336dd506
......@@ -785,6 +785,12 @@ void GtkSalGraphics::PaintCheckOrRadio(GtkStyleContext *context,
gtk_render_option(context, cr, x, y, indicator_size, indicator_size);
}
#if GTK_CHECK_VERSION(3,14,0)
# define CHECKED_AND_ACTIVE (GTK_STATE_FLAG_CHECKED | GTK_STATE_FLAG_ACTIVE)
#else
# define CHECKED_AND_ACTIVE GTK_STATE_FLAG_ACTIVE
#endif
bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const OUString& )
......@@ -869,7 +875,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
break;
case CTRL_CHECKBOX:
flags = (GtkStateFlags)(flags |
( (aValue.getTristateVal() == BUTTONVALUE_ON) ? GTK_STATE_FLAG_ACTIVE :
( (aValue.getTristateVal() == BUTTONVALUE_ON) ? CHECKED_AND_ACTIVE :
(aValue.getTristateVal() == BUTTONVALUE_MIXED) ? GTK_STATE_FLAG_INCONSISTENT :
GTK_STATE_FLAG_NORMAL));
context = mpCheckButtonStyle;
......@@ -878,7 +884,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
break;
case CTRL_RADIOBUTTON:
flags = (GtkStateFlags)(flags |
( (aValue.getTristateVal() == BUTTONVALUE_ON) ? GTK_STATE_FLAG_ACTIVE : GTK_STATE_FLAG_NORMAL));
( (aValue.getTristateVal() == BUTTONVALUE_ON) ? CHECKED_AND_ACTIVE : GTK_STATE_FLAG_NORMAL));
context = mpCheckButtonStyle;
styleClass = GTK_STYLE_CLASS_RADIO;
renderType = RENDER_RADIO;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment