diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2011-11-30 08:57:46 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2011-11-30 13:07:15 +0000 |
commit | 0608cb332ad5b4e4e331b990c28f6354823fd2ae (patch) | |
tree | 389fccfc1351ecbd6ca21ac86b77a47bba9e69f2 | |
parent | 66a2598e164e2003bed045f03e9ed6c0921f7f2b (diff) |
gtk: fix RTL combobox rendering
GTK themes expect the button and the editing area to be swapped in RTL.
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index 2cdd032ec400..6afba2066b48 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 ); } |