diff options
author | Felipe Heidrich <fheidric> | 2010-12-17 21:48:04 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2010-12-17 21:48:04 +0000 |
commit | 1c8d6d064e4a8a70316f776a21806c7dda140423 (patch) | |
tree | a013b3317233078ea393b78e85ad02a9fd262ac2 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java | |
parent | d8c7ac1c238569192a4106f29243a448a4e0192d (diff) | |
download | eclipse.platform.swt-1c8d6d064e4a8a70316f776a21806c7dda140423.tar.gz eclipse.platform.swt-1c8d6d064e4a8a70316f776a21806c7dda140423.tar.xz eclipse.platform.swt-1c8d6d064e4a8a70316f776a21806c7dda140423.zip |
Bug 29779 - BIDI: lack of ability to change orientation of widget in runtime [no public methods yet]
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java index a19d175727..2268c1eb9d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java @@ -119,7 +119,7 @@ protected void checkSubclass () { void createWidget (int index) { parent.createItem (this, index); - setOrientation (); + setOrientation (true); hookEvents (); register (); text = ""; @@ -313,12 +313,13 @@ public void setImage (Image image) { } } -void setOrientation () { - if ((parent.style & SWT.RIGHT_TO_LEFT) != 0) { - if (handle != 0) OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL); - if (labelHandle != 0) OS.gtk_widget_set_direction (labelHandle, OS.GTK_TEXT_DIR_RTL); - if (imageHandle != 0) OS.gtk_widget_set_direction (imageHandle, OS.GTK_TEXT_DIR_RTL); - if (pageHandle != 0) OS.gtk_widget_set_direction (pageHandle, OS.GTK_TEXT_DIR_RTL); +void setOrientation (boolean create) { + if ((parent.style & SWT.RIGHT_TO_LEFT) != 0 || !create) { + int dir = (parent.style & SWT.RIGHT_TO_LEFT) != 0 ? OS.GTK_TEXT_DIR_RTL : OS.GTK_TEXT_DIR_LTR; + if (handle != 0) OS.gtk_widget_set_direction (handle, dir); + if (labelHandle != 0) OS.gtk_widget_set_direction (labelHandle, dir); + if (imageHandle != 0) OS.gtk_widget_set_direction (imageHandle, dir); + if (pageHandle != 0) OS.gtk_widget_set_direction (pageHandle, dir); } } |