summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2011-12-02 22:27:05 +0200
committerTor Lillqvist <tlillqvist@suse.com>2011-12-05 13:08:21 +0200
commitf8e53d7320aa3f1e7a543ee9f378a1ecd1a54490 (patch)
treeeacf039ee0a2a1a3e002b4d0b96c9a59d2764327 /vcl
parentd2028f970bd527880c73f237678291d1bdc7cc89 (diff)
gtk: fix RTL list box rendering
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index cdd388d64c50..f9e590603e84 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -3240,7 +3240,10 @@ static Rectangle NWGetListBoxButtonRect( int nScreen,
case PART_SUB_EDIT:
aPartSize.Width() = aAreaRect.GetWidth() - nButtonAreaWidth - xthickness;
- aPartPos.X() = aAreaRect.Left() + xthickness;
+ if( Application::GetSettings().GetLayoutRTL() )
+ aPartPos.X() = aAreaRect.Left() + nButtonAreaWidth;
+ else
+ aPartPos.X() = aAreaRect.Left() + xthickness;
break;
default:
@@ -3274,6 +3277,7 @@ static Rectangle NWGetListBoxIndicatorRect( int nScreen,
gint width = 13; // GTK+ default
gint height = 13; // GTK+ default
gint right = 5; // GTK+ default
+ gint x;
NWEnsureGTKOptionMenu( nScreen );
@@ -3291,8 +3295,11 @@ static Rectangle NWGetListBoxIndicatorRect( int nScreen,
right = pIndicatorSpacing->right;
aIndicatorRect.SetSize( Size( width, height ) );
- aIndicatorRect.SetPos( Point( aAreaRect.Left() + aAreaRect.GetWidth() - width - right - gWidgetData[nScreen].gOptionMenuWidget->style->xthickness,
- aAreaRect.Top() + ((aAreaRect.GetHeight() - height) / 2) ) );
+ if( Application::GetSettings().GetLayoutRTL() )
+ x = aAreaRect.Left() + right;
+ else
+ x = aAreaRect.Left() + aAreaRect.GetWidth() - width - right - gWidgetData[nScreen].gOptionMenuWidget->style->xthickness;
+ aIndicatorRect.SetPos( Point( x, aAreaRect.Top() + ((aAreaRect.GetHeight() - height) / 2) ) );
// If height is odd, move the indicator down 1 pixel
if ( aIndicatorRect.GetHeight() % 2 )