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

Simon Long simon at raspberrypi.org
Fri Jul 10 12:48:45 PDT 2015


 vcl/inc/svdata.hxx                       |    1 +
 vcl/source/window/menu.cxx               |    7 +++++--
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |   11 ++++++++---
 3 files changed, 14 insertions(+), 5 deletions(-)

New commits:
commit 607af001ccdbfe40b089942b879e5ce3980bde49
Author: Simon Long <simon at raspberrypi.org>
Date:   Wed Jul 8 15:26:15 2015 +0100

    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 at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit f1faa887c0c934484fb32a8ec5fbbc9e89f38037)
    
    Change-Id: I3c42d918680ac989c5cd7cd1022e4a6e7b53aa11
    Reviewed-on: https://gerrit.libreoffice.org/16930
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index a54f6cc..e4ad5ad 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 4e2345a..afe44c6 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 61a471e..802e499 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);


More information about the Libreoffice-commits mailing list