[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/unx
Khaled Hosny
khaledhosny at eglug.org
Tue Aug 25 01:11:03 PDT 2015
vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx | 29 +++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
New commits:
commit 3a0ca27411f37b86a56737d89349ac629863af00
Author: Khaled Hosny <khaledhosny at eglug.org>
Date: Mon Aug 17 04:00:49 2015 +0200
Fix GTK3 right-to-left rendering of spin buttons
The buttons were not drawn at all
Change-Id: I51dfa30a6daa1034b5e978b09bcdfcc83e859f3d
Reviewed-on: https://gerrit.libreoffice.org/17790
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-on: https://gerrit.libreoffice.org/17943
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
index 1f04b2e..90d8734 100644
--- a/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx
@@ -137,25 +137,40 @@ Rectangle GtkSalGraphics::NWGetSpinButtonRect( ControlPart nPart, Rectangle aAre
buttonRect.SetSize(Size(buttonWidth, buttonHeight));
buttonRect.setY(aAreaRect.Top());
buttonRect.Bottom() = buttonRect.Top() + aAreaRect.GetHeight();
+ Rectangle partRect(buttonRect);
if ( nPart == PART_BUTTON_UP )
{
- buttonRect.setX(aAreaRect.Left() + (aAreaRect.GetWidth() - buttonRect.GetWidth()));
+ if (AllSettings::GetLayoutRTL())
+ partRect.setX(aAreaRect.Left());
+ else
+ partRect.setX(aAreaRect.Left() + (aAreaRect.GetWidth() - buttonRect.GetWidth()));
}
else if( nPart == PART_BUTTON_DOWN )
{
- buttonRect.setX(aAreaRect.Left() + (aAreaRect.GetWidth() - 2*buttonRect.GetWidth()));
+ if (AllSettings::GetLayoutRTL())
+ partRect.setX(aAreaRect.Left() + buttonRect.GetWidth());
+ else
+ partRect.setX(aAreaRect.Left() + (aAreaRect.GetWidth() - 2 * buttonRect.GetWidth()));
}
else
{
- buttonRect.Right() = (aAreaRect.Left() + (aAreaRect.GetWidth() - 2*buttonRect.GetWidth()))-1;
- buttonRect.Left() = aAreaRect.Left();
- buttonRect.Top() = aAreaRect.Top();
- buttonRect.Bottom() = aAreaRect.Bottom();
+ if (AllSettings::GetLayoutRTL())
+ {
+ partRect.Right() = aAreaRect.Left() + aAreaRect.GetWidth();
+ partRect.Left() = aAreaRect.Left() + (2 * buttonRect.GetWidth()) - 1;
+ }
+ else
+ {
+ partRect.Right() = (aAreaRect.Left() + (aAreaRect.GetWidth() - 2 * buttonRect.GetWidth())) - 1;
+ partRect.Left() = aAreaRect.Left();
+ }
+ partRect.Top() = aAreaRect.Top();
+ partRect.Bottom() = aAreaRect.Bottom();
}
gtk_style_context_restore(mpSpinStyle);
- return buttonRect;
+ return partRect;
}
Rectangle GtkSalGraphics::NWGetScrollButtonRect( ControlPart nPart, Rectangle aAreaRect )
More information about the Libreoffice-commits
mailing list