diff options
author | Simon Long <simon@raspberrypi.org> | 2015-07-08 15:26:15 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-08-06 12:56:04 +0200 |
commit | 7c5480034cac87ac28c9c88dd6724d0b146bd2f8 (patch) | |
tree | 4d0074504c4ad471c01fb89712dd078d7b2b1ce4 /vcl | |
parent | 852005570f7981076837c82fc3e42063e46887f2 (diff) |
tdf#92244 Gaps at end of menu separator lines read from GTK theme.
Reviewed-on: https://gerrit.libreoffice.org/16886
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit f1faa887c0c934484fb32a8ec5fbbc9e89f38037)
Change-Id: I3c42d918680ac989c5cd7cd1022e4a6e7b53aa11
Reviewed-on: https://gerrit.libreoffice.org/16930
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/svdata.hxx | 1 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 11 |
3 files changed, 14 insertions, 5 deletions
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index a54f6ccab113..e4ad5ad188c7 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -255,6 +255,7 @@ struct ImplSVNWFData int mnStatusBarLowerRightOffset; // amount in pixel to avoid in the lower righthand corner int mnMenuFormatBorderX; // horizontal inner popup menu border int mnMenuFormatBorderY; // vertical inner popup menu border + int mnMenuSeparatorBorderX; // gap at each side of separator ::Color maMenuBarHighlightTextColor; // override higlight text color // in menubar if not transparent bool mbMenuBarDockingAreaCommonBG:1; // e.g. WinXP default theme diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 4e2345a87460..afe44c603a63 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1896,9 +1896,12 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, nState |= ControlState::ENABLED; if (bHighlighted) nState |= ControlState::SELECTED; + int nSepPad = ImplGetSVData()->maNWFData.mnMenuSeparatorBorderX; + Point aMpos (aPos); + aMpos.X() += nSepPad; Size aSz(pData->aSz); - aSz.Width() = aOutSz.Width() - 2 * nOuterSpaceX; - Rectangle aItemRect(aPos, aSz); + aSz.Width() = aOutSz.Width() - 2*nOuterSpaceX - 2 * nSepPad; + Rectangle aItemRect(aMpos, aSz); MenupopupValue aVal(nTextPos - GUTTERBORDER, aItemRect); bNativeOk = rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_MENU_SEPARATOR, aItemRect, nState, aVal, OUString()); diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 61a471eaa652..802e49934f5b 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -527,16 +527,21 @@ void GtkData::initNWF() NWEnsureGTKMenu( SalX11Screen( 0 ) ); gint horizontal_padding = 1; gint vertical_padding = 1; + gint separator_padding = 1; gtk_widget_style_get( gWidgetData[0].gMenuWidget, "horizontal-padding", &horizontal_padding, - (char *)NULL); + nullptr); gtk_widget_style_get( gWidgetData[0].gMenuWidget, "vertical-padding", &vertical_padding, - (char *)NULL); + nullptr); + gtk_widget_style_get( gWidgetData[0].gMenuItemSeparatorMenuWidget, + "horizontal-padding", &separator_padding, + nullptr); gint xthickness = gWidgetData[0].gMenuWidget->style->xthickness; gint ythickness = gWidgetData[0].gMenuWidget->style->ythickness; pSVData->maNWFData.mnMenuFormatBorderX = xthickness + horizontal_padding; pSVData->maNWFData.mnMenuFormatBorderY = ythickness + vertical_padding; + pSVData->maNWFData.mnMenuSeparatorBorderX = separator_padding; pSVData->maNWFData.mbCheckBoxNeedsErase = true; @@ -4559,7 +4564,7 @@ static void NWEnsureGTKMenu( SalX11Screen nScreen ) 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].gMenuItemSeparatorMenuWidget = gtk_separator_menu_item_new(); gWidgetData[nScreen].gImageMenuItem = gtk_image_menu_item_new(); g_object_ref_sink (gWidgetData[nScreen].gMenuWidget); |