[Libreoffice-commits] core.git: vcl/unx

Szymon Kłos eszkadev at gmail.com
Thu Feb 19 03:28:41 PST 2015


 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit b4b844f4d391ba0491dc748f3d5853bef47d9405
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Thu Feb 19 12:05:50 2015 +0100

    gtk3: improved checkbox and radiobutton rendering
    
    Change-Id: I6da03869dea172fb8d50396010152479afec9cde
    Reviewed-on: https://gerrit.libreoffice.org/14554
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 79e17d8..1f906c5 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -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;


More information about the Libreoffice-commits mailing list