diff options
author | Bogdan Gheorghe <gheorghe> | 2008-02-04 20:54:13 +0000 |
---|---|---|
committer | Bogdan Gheorghe <gheorghe> | 2008-02-04 20:54:13 +0000 |
commit | 15cd4b3b02a9366a3c91dffa7606a25c162b7d95 (patch) | |
tree | bf9d66cacff8132a277742639ee09d6c0f155cbe | |
parent | ab9b696e1b90a2bbe964a0dd5e715a4180619302 (diff) | |
download | eclipse.platform.swt-15cd4b3b02a9366a3c91dffa7606a25c162b7d95.tar.gz eclipse.platform.swt-15cd4b3b02a9366a3c91dffa7606a25c162b7d95.tar.xz eclipse.platform.swt-15cd4b3b02a9366a3c91dffa7606a25c162b7d95.zip |
217336 Linux mirroring problems
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java | 17 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java | 5 |
2 files changed, 8 insertions, 14 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java index d4b40fe999..94f8664413 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java @@ -73,7 +73,7 @@ public class ExpandItem extends Item { * @see Widget#getStyle */ public ExpandItem (ExpandBar parent, int style) { - super (parent, checkStyle (parent, style)); + super (parent, style); this.parent = parent; createWidget (parent.getItemCount ()); } @@ -109,22 +109,11 @@ public ExpandItem (ExpandBar parent, int style) { * @see Widget#getStyle */ public ExpandItem (ExpandBar parent, int style, int index) { - super (parent, checkStyle (parent, style)); + super (parent, style); this.parent = parent; createWidget (index); } -static int checkStyle (ExpandBar parent, int style) { - style &= ~SWT.MIRRORED; - if ((style & (SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT)) == 0) { - if (parent != null) { - if ((parent.style & SWT.LEFT_TO_RIGHT) != 0) style |= SWT.LEFT_TO_RIGHT; - if ((parent.style & SWT.RIGHT_TO_LEFT) != 0) style |= SWT.RIGHT_TO_LEFT; - } - } - return Widget.checkBits (style, SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, 0, 0, 0, 0); -} - protected void checkSubclass () { if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS); } @@ -585,7 +574,7 @@ public void setImage (Image image) { void setOrientation() { super.setOrientation (); - if ((style & SWT.RIGHT_TO_LEFT) != 0) { + if ((parent.style & SWT.RIGHT_TO_LEFT) != 0) { OS.gtk_widget_set_direction (handle, OS.GTK_TEXT_DIR_RTL); OS.gtk_container_forall (handle, display.setDirectionProc, OS.GTK_TEXT_DIR_RTL); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java index 454a799548..88be16e587 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java @@ -295,6 +295,11 @@ void checkOrientation (Widget parent) { } } style = checkBits (style, SWT.LEFT_TO_RIGHT, SWT.RIGHT_TO_LEFT, 0, 0, 0, 0); + /* Versions of GTK prior to 2.8 do not render RTL text properly */ + if (OS.GTK_VERSION < OS.VERSION (2, 8, 0)) { + style &= ~SWT.RIGHT_TO_LEFT; + style |= SWT.LEFT_TO_RIGHT; + } } /** |