[Libreoffice-commits] .: vcl/unx
Michael Meeks
michael at kemper.freedesktop.org
Wed Nov 30 05:06:55 PST 2011
vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
New commits:
commit 0608cb332ad5b4e4e331b990c28f6354823fd2ae
Author: Khaled Hosny <khaledhosny at eglug.org>
Date: Wed Nov 30 08:57:46 2011 +0200
gtk: fix RTL combobox rendering
GTK themes expect the button and the editing area to be swapped in RTL.
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index 2cdd032..6afba20 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -2185,6 +2185,8 @@ sal_Bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable,
Rectangle aEditBoxRect( pixmapRect );
aEditBoxRect.SetSize( Size( pixmapRect.GetWidth() - buttonRect.GetWidth(), aEditBoxRect.GetHeight() ) );
+ if( Application::GetSettings().GetLayoutRTL() )
+ aEditBoxRect.SetPos( Point( x + buttonRect.GetWidth() , y ) );
#define ARROW_EXTENT 0.7
arrowRect.SetSize( Size( (gint)(MIN_ARROW_SIZE * ARROW_EXTENT),
@@ -2254,8 +2256,11 @@ static Rectangle NWGetComboBoxButtonRect( int nScreen,
if( nPart == PART_BUTTON_DOWN )
{
aButtonRect.SetSize( Size( nButtonWidth, aAreaRect.GetHeight() ) );
- aButtonRect.SetPos( Point( aAreaRect.Left() + aAreaRect.GetWidth() - nButtonWidth,
- aAreaRect.Top() ) );
+ if( Application::GetSettings().GetLayoutRTL() )
+ aButtonRect.SetPos( Point( aAreaRect.Left(), aAreaRect.Top() ) );
+ else
+ aButtonRect.SetPos( Point( aAreaRect.Left() + aAreaRect.GetWidth() - nButtonWidth,
+ aAreaRect.Top() ) );
}
else if( nPart == PART_SUB_EDIT )
{
@@ -2271,6 +2276,8 @@ static Rectangle NWGetComboBoxButtonRect( int nScreen,
Point aEditPos = aAreaRect.TopLeft();
aEditPos.X() += adjust_x;
aEditPos.Y() += adjust_y;
+ if( Application::GetSettings().GetLayoutRTL() )
+ aEditPos.X() += nButtonWidth;
aButtonRect.SetPos( aEditPos );
}
More information about the Libreoffice-commits
mailing list