[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/inc vcl/unx
Caolán McNamara
caolanm at redhat.com
Fri Jun 19 03:13:11 PDT 2015
vcl/inc/unx/gtk/gtkgdi.hxx | 1 -
vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 23 ++++++-----------------
2 files changed, 6 insertions(+), 18 deletions(-)
New commits:
commit d30d6d9313912d45a38ea8fef689717ae3f8ec9c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jun 19 11:11:33 2015 +0100
gtk3: drop manually constructed mpMenuItemStyle
Change-Id: Ibc9e93c702e885b14d7c0beac453479e9171f329
(cherry picked from commit 30df42a5a2e98f8eb971341a0cc00018865dbb54)
diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index e11a479..9b130ab 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -78,7 +78,6 @@ private:
static GtkStyleContext *mpMenuBarItemStyle;
static GtkStyleContext *mpMenuStyle;
static GtkStyleContext *mpSpinStyle;
- static GtkStyleContext *mpMenuItemStyle;
static GtkStyleContext *mpCheckMenuItemStyle;
static GtkStyleContext *mpComboboxStyle;
static GtkStyleContext *mpComboboxButtonStyle;
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 9e25965..7afcb56 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -32,7 +32,6 @@ GtkStyleContext* GtkSalGraphics::mpCheckButtonStyle = NULL;
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;
@@ -876,7 +875,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
{
case PART_MENU_ITEM:
styleClass = GTK_STYLE_CLASS_MENUITEM;
- context = mpMenuItemStyle;
+ context = mpCheckMenuItemStyle;
renderType = RENDER_BACKGROUND_AND_FRAME;
break;
case PART_MENU_ITEM_CHECK_MARK:
@@ -897,7 +896,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
break;
case PART_MENU_SEPARATOR:
styleClass = GTK_STYLE_CLASS_SEPARATOR;
- context = mpMenuItemStyle;
+ context = mpCheckMenuItemStyle;
renderType = RENDER_MENU_SEPERATOR;
break;
case PART_MENU_SUBMENU_ARROW:
@@ -1273,7 +1272,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
{
gint separator_height, separator_width, wide_separators;
- gtk_style_context_get_style (mpMenuItemStyle,
+ gtk_style_context_get_style (mpCheckMenuItemStyle,
"wide-separators", &wide_separators,
"separator-width", &separator_width,
"separator-height", &separator_height,
@@ -1548,11 +1547,11 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
aStyleSet.SetShadowColor( temp );
}
- gtk_style_context_get_background_color( mpMenuItemStyle, GTK_STATE_FLAG_PRELIGHT, &background_color );
+ gtk_style_context_get_background_color( mpCheckMenuItemStyle, GTK_STATE_FLAG_PRELIGHT, &background_color );
::Color aHighlightColor = getColor( background_color );
aStyleSet.SetMenuHighlightColor( aHighlightColor );
- gtk_style_context_get_color( mpMenuItemStyle, GTK_STATE_FLAG_PRELIGHT, &color );
+ gtk_style_context_get_color( mpCheckMenuItemStyle, GTK_STATE_FLAG_PRELIGHT, &color );
::Color aHighlightTextColor = getColor( color );
aStyleSet.SetMenuHighlightTextColor( aHighlightTextColor );
@@ -2016,18 +2015,8 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow )
g_object_ref_sink(menu);
/* Menu Items */
- path = gtk_widget_path_new();
- gtk_widget_path_append_type(path, GTK_TYPE_MENU);
- gtk_widget_path_append_type(path, GTK_TYPE_CHECK_MENU_ITEM);
- gtk_widget_path_iter_add_class(path, 0, GTK_STYLE_CLASS_MENU);
- gtk_widget_path_iter_add_class(path, 1, GTK_STYLE_CLASS_MENUITEM);
- mpMenuItemStyle = gtk_style_context_new();
- 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);
+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), gCheckMenuItemWidget);
mpCheckMenuItemStyle = gtk_widget_get_style_context(gCheckMenuItemWidget);
/* Menu bar */
More information about the Libreoffice-commits
mailing list