Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnatoly Spektor2012-10-03 18:03:05 +0000
committerAlexander Kurtakov2012-10-03 18:43:46 +0000
commita025bf9445abd24cfb0807a29038b2face3f0f8a (patch)
treeec66fae1d5dadbc860b4edcc055b7b518c676827 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse
parentbb4e83381b7dcfcdda6368f29494e85d7a1bdec8 (diff)
downloadeclipse.platform.swt-a025bf9445abd24cfb0807a29038b2face3f0f8a.tar.gz
eclipse.platform.swt-a025bf9445abd24cfb0807a29038b2face3f0f8a.tar.xz
eclipse.platform.swt-a025bf9445abd24cfb0807a29038b2face3f0f8a.zip
Use gtk_orientable_set_orientation and progressbar_inverted for GTK+ 3
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java19
1 files changed, 18 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
index 69559df1f7..3ac8cd869b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java
@@ -88,7 +88,7 @@ void createHandle (int index) {
if (handle == 0) error (SWT.ERROR_NO_HANDLES);
OS.gtk_container_add (fixedHandle, handle);
int orientation = (style & SWT.VERTICAL) != 0 ? OS.GTK_PROGRESS_BOTTOM_TO_TOP : OS.GTK_PROGRESS_LEFT_TO_RIGHT;
- OS.gtk_progress_bar_set_orientation (handle, orientation);
+ gtk_orientable_set_orientation (handle, orientation);
if ((style & SWT.INDETERMINATE) != 0) {
timerId = OS.g_timeout_add (DELAY, display.windowTimerProc, handle);
}
@@ -302,4 +302,21 @@ void updateBar (int selection, int minimum, int maximum) {
OS.gdk_window_process_updates (window, false);
OS.gdk_flush ();
}
+
+void gtk_orientable_set_orientation (long /*int*/ pbar, int orientation) {
+ if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ switch (orientation) {
+ case OS.GTK_PROGRESS_BOTTOM_TO_TOP:
+ OS.gtk_orientable_set_orientation(pbar, OS.GTK_ORIENTATION_VERTICAL);
+ OS.gtk_progress_bar_set_inverted(pbar, true);
+ break;
+ case OS.GTK_PROGRESS_LEFT_TO_RIGHT:
+ OS.gtk_orientable_set_orientation(pbar, OS.GTK_ORIENTATION_HORIZONTAL);
+ OS.gtk_progress_bar_set_inverted(pbar, false);
+ break;
+ }
+ } else {
+ OS.gtk_progress_bar_set_orientation(pbar, orientation);
+ }
+}
}

Back to the top