summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ProgressBar.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java6
2 files changed, 6 insertions, 6 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 b40ee9116a..c7b2258d22 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
@@ -154,8 +154,7 @@ void releaseWidget () {
*/
public void setMaximum (int maximum) {
checkWidget ();
- if (maximum < 0) return;
- if (maximum < min) maximum = min;
+ if (maximum < 0 || maximum <= min) return;
max = maximum;
if (value > maximum) value = maximum;
updateBar (value, min, max);
@@ -175,8 +174,7 @@ public void setMaximum (int maximum) {
*/
public void setMinimum (int minimum) {
checkWidget ();
- if (minimum < 0) return;
- if (minimum > max) minimum = max;
+ if (minimum < 0 || minimum >= max) return;
if (value < minimum) value = minimum;
min = minimum;
updateBar (value, min, max);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java
index 13c111406d..1be7c12136 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scale.java
@@ -312,7 +312,7 @@ public void setIncrement (int value) {
*/
public void setMaximum (int value) {
checkWidget ();
- if (value < 0) return;
+ if (value < 0 || value <= getMinimum()) return;
int hAdjustment = OS.gtk_range_get_adjustment (handle);
GtkAdjustment adjustment = new GtkAdjustment ();
OS.memmove (adjustment, hAdjustment);
@@ -321,6 +321,7 @@ public void setMaximum (int value) {
OS.g_signal_handlers_block_matched (hAdjustment, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED);
OS.gtk_adjustment_changed (hAdjustment);
OS.g_signal_handlers_unblock_matched (hAdjustment, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED);
+ if (value < getSelection()) setSelection(value);
}
/**
@@ -337,7 +338,7 @@ public void setMaximum (int value) {
*/
public void setMinimum (int value) {
checkWidget ();
- if (value < 0) return;
+ if (value < 0 || value >= getMaximum()) return;
int hAdjustment = OS.gtk_range_get_adjustment (handle);
GtkAdjustment adjustment = new GtkAdjustment ();
OS.memmove (adjustment, hAdjustment);
@@ -346,6 +347,7 @@ public void setMinimum (int value) {
OS.g_signal_handlers_block_matched (hAdjustment, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED);
OS.gtk_adjustment_changed (hAdjustment);
OS.g_signal_handlers_unblock_matched (hAdjustment, OS.G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, VALUE_CHANGED);
+ if (value > getSelection()) setSelection(value);
}
/**