summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-22 12:31:55 +0100
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2015-07-23 10:38:57 +0000
commitb602cf586adad53b123a776838722a8abd2fe18d (patch)
tree5a2f270ba69ba0b8d5ad01bda9c78984c53ffb49 /vcl
parent96f36158e386a3b252157058bde87c644ff7398a (diff)
gtk3: native focus rects are fine for flat buttons
(cherry picked from commit f485b2881794244409d71ead39715373e734ed04) Change-Id: I6a70696cd119e681b4850c624c9e4ff28312c152 Reviewed-on: https://gerrit.libreoffice.org/17291 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/svdata.hxx3
-rw-r--r--vcl/source/control/button.cxx7
-rw-r--r--vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx1
3 files changed, 8 insertions, 3 deletions
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index e4ad5ad188c7..5e3282a246ec 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 2b3759ea28a4..f8820aaf30e6 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -699,8 +699,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 be50e5af0757..5c710409bb87 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -1933,6 +1933,7 @@ void GtkData::initNWF()
pSVData->maNWFData.mbCanDrawWidgetAnySize = true;
pSVData->maNWFData.mbDDListBoxNoTextArea = true;
pSVData->maNWFData.mbNoFocusRects = true;
+ pSVData->maNWFData.mbNoFocusRectsForFlatButtons = true;
}
void GtkData::deInitNWF()