Bugzilla – Attachment 45419 Details for
Bug 32500
[META] GTK style doesn't draw some elements via GTK
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Implement menu separators
0001-gtk-implement-native-drawing-of-menu-separators.patch (text/plain), 5.66 KB, created by
Michael Natterer
on 2011-04-08 06:26:01 UTC
(
hide
)
Description:
Implement menu separators
Filename:
MIME Type:
Creator:
Michael Natterer
Created:
2011-04-08 06:26:01 UTC
Size:
5.66 KB
patch
obsolete
>From 8009231d8ab55901a45544003e9cbe8bfea3f3e5 Mon Sep 17 00:00:00 2001 >From: Michael Natterer <mitch@gimp.org> >Date: Fri, 8 Apr 2011 15:13:26 +0200 >Subject: [PATCH] gtk: implement native drawing of menu separators > >--- > vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 30 +++++++++++++++++++++++++----- > 1 files changed, 25 insertions(+), 5 deletions(-) > >diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx >index e1d12ce..7ac3eee 100644 >--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx >+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx >@@ -95,6 +95,7 @@ struct NWFWidgetData > GtkWidget * gMenuItemMenuWidget; > GtkWidget * gMenuItemCheckMenuWidget; > GtkWidget * gMenuItemRadioMenuWidget; >+ GtkWidget * gMenuItemSeparatorMenuWidget; > GtkWidget * gImageMenuItem; > GtkWidget * gTooltipPopup; > GtkWidget * gProgressBar; >@@ -134,6 +135,7 @@ struct NWFWidgetData > gMenuItemMenuWidget( NULL ), > gMenuItemCheckMenuWidget( NULL ), > gMenuItemRadioMenuWidget( NULL ), >+ gMenuItemSeparatorMenuWidget( NULL ), > gImageMenuItem( NULL ), > gTooltipPopup( NULL ), > gProgressBar( NULL ), >@@ -582,6 +584,7 @@ sal_Bool GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar > || (nPart==PART_MENU_ITEM) > || (nPart==PART_MENU_ITEM_CHECK_MARK) > || (nPart==PART_MENU_ITEM_RADIO_MARK) >+ || (nPart==PART_MENU_SEPARATOR) > ) > ) || > ((nType == CTRL_PROGRESS) && >@@ -848,6 +851,7 @@ sal_Bool GtkSalGraphics::drawNativeControl( ControlType nType, > || (nPart == PART_MENU_ITEM) > || (nPart == PART_MENU_ITEM_CHECK_MARK) > || (nPart == PART_MENU_ITEM_RADIO_MARK) >+ || (nPart == PART_MENU_SEPARATOR) > ) > ) > { >@@ -2804,6 +2808,16 @@ sal_Bool GtkSalGraphics::NWPaintGTKPopupMenu( > x, y, w, h ); > } > } >+ else if( nPart == PART_MENU_SEPARATOR ) >+ { >+ gtk_paint_hline( gWidgetData[m_nScreen].gMenuItemSeparatorMenuWidget->style, >+ gdkDrawable, >+ GTK_STATE_NORMAL, >+ &clipRect, >+ gWidgetData[m_nScreen].gMenuItemSeparatorMenuWidget, >+ "menuitem", >+ x, x + w, y + h / 2); >+ } > } > > return( sal_True ); >@@ -3942,15 +3956,17 @@ static void NWEnsureGTKMenu( int nScreen ) > { > if( !gWidgetData[nScreen].gMenuWidget ) > { >- gWidgetData[nScreen].gMenuWidget = gtk_menu_new(); >- gWidgetData[nScreen].gMenuItemMenuWidget = gtk_menu_item_new_with_label( "b" ); >- gWidgetData[nScreen].gMenuItemCheckMenuWidget = gtk_check_menu_item_new_with_label( "b" ); >- gWidgetData[nScreen].gMenuItemRadioMenuWidget = gtk_radio_menu_item_new_with_label( NULL, "b" ); >- gWidgetData[nScreen].gImageMenuItem = gtk_image_menu_item_new(); >+ gWidgetData[nScreen].gMenuWidget = gtk_menu_new(); >+ gWidgetData[nScreen].gMenuItemMenuWidget = gtk_menu_item_new_with_label( "b" ); >+ gWidgetData[nScreen].gMenuItemCheckMenuWidget = gtk_check_menu_item_new_with_label( "b" ); >+ gWidgetData[nScreen].gMenuItemRadioMenuWidget = gtk_radio_menu_item_new_with_label( NULL, "b" ); >+ gWidgetData[nScreen].gMenuItemSeparatorMenuWidget = gtk_menu_item_new(); >+ gWidgetData[nScreen].gImageMenuItem = gtk_image_menu_item_new(); > > gtk_menu_shell_append( GTK_MENU_SHELL( gWidgetData[nScreen].gMenuWidget ), gWidgetData[nScreen].gMenuItemMenuWidget ); > gtk_menu_shell_append( GTK_MENU_SHELL( gWidgetData[nScreen].gMenuWidget ), gWidgetData[nScreen].gMenuItemCheckMenuWidget ); > gtk_menu_shell_append( GTK_MENU_SHELL( gWidgetData[nScreen].gMenuWidget ), gWidgetData[nScreen].gMenuItemRadioMenuWidget ); >+ gtk_menu_shell_append( GTK_MENU_SHELL( gWidgetData[nScreen].gMenuWidget ), gWidgetData[nScreen].gMenuItemSeparatorMenuWidget ); > gtk_menu_shell_append( GTK_MENU_SHELL( gWidgetData[nScreen].gMenuWidget ), gWidgetData[nScreen].gImageMenuItem ); > > // do what NWAddWidgetToCacheWindow does except adding to def container >@@ -3966,6 +3982,9 @@ static void NWEnsureGTKMenu( int nScreen ) > gtk_widget_realize( gWidgetData[nScreen].gMenuItemRadioMenuWidget ); > gtk_widget_ensure_style( gWidgetData[nScreen].gMenuItemRadioMenuWidget ); > >+ gtk_widget_realize( gWidgetData[nScreen].gMenuItemSeparatorMenuWidget ); >+ gtk_widget_ensure_style( gWidgetData[nScreen].gMenuItemSeparatorMenuWidget ); >+ > gtk_widget_realize( gWidgetData[nScreen].gImageMenuItem ); > gtk_widget_ensure_style( gWidgetData[nScreen].gImageMenuItem ); > >@@ -3973,6 +3992,7 @@ static void NWEnsureGTKMenu( int nScreen ) > gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuItemMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemMenuWidget ); > gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuItemCheckMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemCheckMenuWidget ); > gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuItemRadioMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemRadioMenuWidget ); >+ gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gMenuItemSeparatorMenuWidget ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gMenuItemSeparatorMenuWidget ); > gWidgetDefaultFlags[ (long)gWidgetData[nScreen].gImageMenuItem ] = GTK_WIDGET_FLAGS( gWidgetData[nScreen].gImageMenuItem ); > } > } >-- >1.7.4.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 32500
: 45419