[Libreoffice-commits] core.git: vcl/inc vcl/source vcl/unx

Caolán McNamara caolanm at redhat.com
Wed Jul 22 04:38:06 PDT 2015


 vcl/inc/svdata.hxx                            |    3 ++-
 vcl/source/control/button.cxx                 |    7 +++++--
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |    1 +
 3 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit f485b2881794244409d71ead39715373e734ed04
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jul 22 12:31:55 2015 +0100

    gtk3: native focus rects are fine for flat buttons
    
    Change-Id: I6a70696cd119e681b4850c624c9e4ff28312c152

diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 4be003e..a035ae3 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -266,7 +266,8 @@ struct ImplSVNWFData
                                                             // toolbox dropdown buttons
     bool                    mbFlatMenu:1;                   // no popup 3D border
     bool                    mbOpenMenuOnF10:1;              // on gnome the first menu opens on F10
-    bool                    mbNoFocusRects:1;               // on Aqua focus rects are not used
+    bool                    mbNoFocusRects:1;               // on Aqua/Gtk3 use native focus rendering, except for flat butttons
+    bool                    mbNoFocusRectsForFlatButtons:1; // on Gtk3 native focusing is also preferred for flat buttons
     bool                    mbCenteredTabs:1;               // on Aqua, tabs are centered
     bool                    mbNoActiveTabTextRaise:1;       // on Aqua the text for the selected tab
                                                             // should not "jump up" a pixel
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index ca27059..a106461 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -700,8 +700,11 @@ void PushButton::ImplInitSettings( bool bFont,
             EnableChildTransparentMode( true );
             SetParentClipMode( ParentClipMode::NoClip );
             SetPaintTransparent( true );
-            mpWindowImpl->mbUseNativeFocus = (GetStyle() & WB_FLATBUTTON) == 0
-                && ImplGetSVData()->maNWFData.mbNoFocusRects;
+
+            if ((GetStyle() & WB_FLATBUTTON) == 0)
+                mpWindowImpl->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRects;
+            else
+                mpWindowImpl->mbUseNativeFocus = ImplGetSVData()->maNWFData.mbNoFocusRectsForFlatButtons;
         }
         else
         {
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index c593559..787d405 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -1935,6 +1935,7 @@ void GtkData::initNWF()
     pSVData->maNWFData.mbCanDrawWidgetAnySize = true;
     pSVData->maNWFData.mbDDListBoxNoTextArea = true;
     pSVData->maNWFData.mbNoFocusRects = true;
+    pSVData->maNWFData.mbNoFocusRectsForFlatButtons = true;
     pSVData->maNWFData.mbAutoAccel = true;
     pSVData->maNWFData.mbEnableAccel = true;
 }


More information about the Libreoffice-commits mailing list