[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/inc vcl/unx

Caolán McNamara caolanm at redhat.com
Fri Jun 19 03:08:16 PDT 2015


 vcl/inc/unx/gtk/gtkgdi.hxx                    |    3 ++-
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |   13 ++++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 09ed3cabdef82900507e747f1459d4bc14d962ad
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jun 19 11:07:07 2015 +0100

    gtk3: use correct check menu item style
    
    Change-Id: Iee0c33cba80243b39b6de96cf58b8b274346e522
    (cherry picked from commit ff123fa1086ae0c72c29c9ed4823ef53e6ff7de5)

diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index 60b1513..e11a479 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -77,8 +77,9 @@ private:
     static GtkStyleContext *mpMenuBarStyle;
     static GtkStyleContext *mpMenuBarItemStyle;
     static GtkStyleContext *mpMenuStyle;
-    static GtkStyleContext *mpMenuItemStyle;
     static GtkStyleContext *mpSpinStyle;
+    static GtkStyleContext *mpMenuItemStyle;
+    static GtkStyleContext *mpCheckMenuItemStyle;
     static GtkStyleContext *mpComboboxStyle;
     static GtkStyleContext *mpComboboxButtonStyle;
     static GtkStyleContext *mpListboxStyle;
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 129fd4b..9e25965 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -33,6 +33,7 @@ GtkStyleContext* GtkSalGraphics::mpMenuBarStyle = NULL;
 GtkStyleContext* GtkSalGraphics::mpMenuBarItemStyle = NULL;
 GtkStyleContext* GtkSalGraphics::mpMenuStyle = NULL;
 GtkStyleContext* GtkSalGraphics::mpMenuItemStyle = NULL;
+GtkStyleContext* GtkSalGraphics::mpCheckMenuItemStyle = NULL;
 GtkStyleContext* GtkSalGraphics::mpSpinStyle = NULL;
 GtkStyleContext* GtkSalGraphics::mpComboboxStyle = NULL;
 GtkStyleContext* GtkSalGraphics::mpComboboxButtonStyle = NULL;
@@ -824,6 +825,7 @@ static GtkWidget* gFrameIn;
 static GtkWidget* gFrameOut;
 static GtkWidget* gMenuBarWidget;
 static GtkWidget* gMenuItemMenuBarWidget;
+static GtkWidget* gCheckMenuItemWidget;
 static GtkWidget* gTreeViewWidget;
 
 bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
@@ -879,7 +881,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
             break;
         case PART_MENU_ITEM_CHECK_MARK:
             styleClass = GTK_STYLE_CLASS_CHECK;
-            context = mpMenuItemStyle;
+            context = mpCheckMenuItemStyle;
             renderType = RENDER_CHECK;
             nType = CTRL_CHECKBOX;
             if (nState & ControlState::PRESSED)
@@ -887,7 +889,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
             break;
         case PART_MENU_ITEM_RADIO_MARK:
             styleClass = GTK_STYLE_CLASS_RADIO;
-            context = mpMenuItemStyle;
+            context = mpCheckMenuItemStyle;
             renderType = RENDER_RADIO;
             nType = CTRL_RADIOBUTTON;
             if (nState & ControlState::PRESSED)
@@ -1259,7 +1261,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
         {
             indicator_size = 0;
 
-            gtk_style_context_get_style( mpMenuItemStyle,
+            gtk_style_context_get_style( mpCheckMenuItemStyle,
                                          "indicator-size", &indicator_size,
                                          (char *)NULL );
 
@@ -2023,6 +2025,11 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow )
     gtk_style_context_set_path(mpMenuItemStyle, path);
     gtk_widget_path_free(path);
 
+    gCheckMenuItemWidget = gtk_check_menu_item_new_with_label("M");
+    gtk_menu_shell_append(GTK_MENU_SHELL(menu),
+                          gCheckMenuItemWidget);
+    mpCheckMenuItemStyle = gtk_widget_get_style_context(gCheckMenuItemWidget);
+
     /* Menu bar */
     gMenuBarWidget = gtk_menu_bar_new();
     gMenuItemMenuBarWidget = gtk_menu_item_new_with_label( "b" );


More information about the Libreoffice-commits mailing list