summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
diff options
context:
space:
mode:
authorSilenio Quarti <silenio_quarti@ca.ibm.com>2012-10-31 15:54:39 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-10-31 15:54:39 -0400
commit6d854d655fc229723d96ef2666b9624a34be09bf (patch)
treec7e355bdf988640dffe74bc28f23faa9f31771d1 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
parent78fbb6844fc73f459133f9bf8c4ddac92e6ea668 (diff)
downloadeclipse.platform.swt-6d854d655fc229723d96ef2666b9624a34be09bf.tar.gz
eclipse.platform.swt-6d854d655fc229723d96ef2666b9624a34be09bf.tar.xz
eclipse.platform.swt-6d854d655fc229723d96ef2666b9624a34be09bf.zip
button content alignment not working in controlexample
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
index 14f3affcf6..19489b2c1d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java
@@ -686,6 +686,11 @@ void _setAlignment (int alignment) {
if (bothVisible) {
OS.gtk_box_set_child_packing (boxHandle, labelHandle, false, false, 0, OS.GTK_PACK_START);
OS.gtk_box_set_child_packing (boxHandle, imageHandle, false, false, 0, OS.GTK_PACK_START);
+ } else {
+ if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ OS.gtk_box_set_child_packing (boxHandle, labelHandle, true, true, 0, OS.GTK_PACK_END);
+ OS.gtk_box_set_child_packing (boxHandle, imageHandle, true, true, 0, OS.GTK_PACK_START);
+ }
}
OS.gtk_misc_set_alignment (labelHandle, 0.0f, 0.5f);
OS.gtk_label_set_justify (labelHandle, OS.GTK_JUSTIFY_LEFT);
@@ -699,6 +704,10 @@ void _setAlignment (int alignment) {
OS.gtk_misc_set_alignment (labelHandle, 0f, 0.5f);
OS.gtk_misc_set_alignment (imageHandle, 1f, 0.5f);
} else {
+ if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ OS.gtk_box_set_child_packing (boxHandle, labelHandle, true, true, 0, OS.GTK_PACK_END);
+ OS.gtk_box_set_child_packing (boxHandle, imageHandle, true, true, 0, OS.GTK_PACK_START);
+ }
OS.gtk_misc_set_alignment (labelHandle, 0.5f, 0.5f);
OS.gtk_label_set_justify (labelHandle, OS.GTK_JUSTIFY_CENTER);
OS.gtk_misc_set_alignment (imageHandle, 0.5f, 0.5f);
@@ -709,6 +718,11 @@ void _setAlignment (int alignment) {
if (bothVisible) {
OS.gtk_box_set_child_packing (boxHandle, labelHandle, false, false, 0, OS.GTK_PACK_END);
OS.gtk_box_set_child_packing (boxHandle, imageHandle, false, false, 0, OS.GTK_PACK_END);
+ } else {
+ if (OS.GTK_VERSION >= OS.VERSION (3, 0, 0)) {
+ OS.gtk_box_set_child_packing (boxHandle, labelHandle, true, true, 0, OS.GTK_PACK_END);
+ OS.gtk_box_set_child_packing (boxHandle, imageHandle, true, true, 0, OS.GTK_PACK_START);
+ }
}
OS.gtk_misc_set_alignment (labelHandle, 1.0f, 0.5f);
OS.gtk_label_set_justify (labelHandle, OS.GTK_JUSTIFY_RIGHT);