gtk+ r21021 - in trunk: . gtk
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r21021 - in trunk: . gtk
- Date: Wed, 6 Aug 2008 11:32:34 +0000 (UTC)
Author: mitch
Date: Wed Aug 6 11:32:33 2008
New Revision: 21021
URL: http://svn.gnome.org/viewvc/gtk+?rev=21021&view=rev
Log:
2008-08-06 Michael Natterer <mitch imendio com>
* gtk/gtkcombobox.c
* gtk/gtkiconview.c
* gtk/gtkrange.c
* gtk/gtkscrolledwindow.c
* gtk/gtktreeview.c: remove CLAMPing from values passed to
gtk_adjustment_set_value() since it does it right now.
Modified:
trunk/ChangeLog
trunk/gtk/gtkcombobox.c
trunk/gtk/gtkiconview.c
trunk/gtk/gtkrange.c
trunk/gtk/gtkscrolledwindow.c
trunk/gtk/gtktreeview.c
Modified: trunk/gtk/gtkcombobox.c
==============================================================================
--- trunk/gtk/gtkcombobox.c (original)
+++ trunk/gtk/gtkcombobox.c Wed Aug 6 11:32:33 2008
@@ -3989,13 +3989,13 @@
adj->lower < adj->value)
{
value = adj->value - (tree_view->allocation.x - x + 1);
- gtk_adjustment_set_value (adj, CLAMP (value, adj->lower, adj->upper - adj->page_size));
+ gtk_adjustment_set_value (adj, value);
}
else if (x >= tree_view->allocation.x + tree_view->allocation.width &&
adj->upper - adj->page_size > adj->value)
{
value = adj->value + (x - tree_view->allocation.x - tree_view->allocation.width + 1);
- gtk_adjustment_set_value (adj, CLAMP (value, 0.0, adj->upper - adj->page_size));
+ gtk_adjustment_set_value (adj, MAX (value, 0.0));
}
}
@@ -4006,13 +4006,13 @@
adj->lower < adj->value)
{
value = adj->value - (tree_view->allocation.y - y + 1);
- gtk_adjustment_set_value (adj, CLAMP (value, adj->lower, adj->upper - adj->page_size));
+ gtk_adjustment_set_value (adj, value);
}
else if (y >= tree_view->allocation.height &&
adj->upper - adj->page_size > adj->value)
{
value = adj->value + (y - tree_view->allocation.height + 1);
- gtk_adjustment_set_value (adj, CLAMP (value, 0.0, adj->upper - adj->page_size));
+ gtk_adjustment_set_value (adj, MAX (value, 0.0));
}
}
}
Modified: trunk/gtk/gtkiconview.c
==============================================================================
--- trunk/gtk/gtkiconview.c (original)
+++ trunk/gtk/gtkiconview.c Wed Aug 6 11:32:33 2008
@@ -1356,7 +1356,7 @@
hadjustment->upper = MAX (allocation->width, icon_view->priv->width);
if (hadjustment->value > hadjustment->upper - hadjustment->page_size)
- gtk_adjustment_set_value (hadjustment, MAX (0, hadjustment->upper - hadjustment->page_size));
+ gtk_adjustment_set_value (hadjustment, hadjustment->upper - hadjustment->page_size);
vadjustment->page_size = allocation->height;
vadjustment->page_increment = allocation->height * 0.9;
@@ -1365,7 +1365,7 @@
vadjustment->upper = MAX (allocation->height, icon_view->priv->height);
if (vadjustment->value > vadjustment->upper - vadjustment->page_size)
- gtk_adjustment_set_value (vadjustment, MAX (0, vadjustment->upper - vadjustment->page_size));
+ gtk_adjustment_set_value (vadjustment, vadjustment->upper - vadjustment->page_size);
if (GTK_WIDGET_REALIZED (widget) &&
icon_view->priv->scroll_to_path)
@@ -1522,17 +1522,11 @@
static gboolean
rubberband_scroll_timeout (gpointer data)
{
- GtkIconView *icon_view;
- gdouble value;
-
- icon_view = data;
-
- value = MIN (icon_view->priv->vadjustment->value +
- icon_view->priv->scroll_value_diff,
- icon_view->priv->vadjustment->upper -
- icon_view->priv->vadjustment->page_size);
+ GtkIconView *icon_view = data;
- gtk_adjustment_set_value (icon_view->priv->vadjustment, value);
+ gtk_adjustment_set_value (icon_view->priv->vadjustment,
+ icon_view->priv->vadjustment->value +
+ icon_view->priv->scroll_value_diff);
gtk_icon_view_update_rubberband (icon_view);
@@ -4210,7 +4204,7 @@
{
gint x, y;
gint focus_width;
- gfloat offset, value;
+ gfloat offset;
gtk_widget_style_get (GTK_WIDGET (icon_view),
"focus-line-width", &focus_width,
@@ -4220,17 +4214,15 @@
offset = y + item->y - focus_width -
row_align * (GTK_WIDGET (icon_view)->allocation.height - item->height);
- value = CLAMP (icon_view->priv->vadjustment->value + offset,
- icon_view->priv->vadjustment->lower,
- icon_view->priv->vadjustment->upper - icon_view->priv->vadjustment->page_size);
- gtk_adjustment_set_value (icon_view->priv->vadjustment, value);
+
+ gtk_adjustment_set_value (icon_view->priv->vadjustment,
+ icon_view->priv->vadjustment->value + offset);
offset = x + item->x - focus_width -
col_align * (GTK_WIDGET (icon_view)->allocation.width - item->width);
- value = CLAMP (icon_view->priv->hadjustment->value + offset,
- icon_view->priv->hadjustment->lower,
- icon_view->priv->hadjustment->upper - icon_view->priv->hadjustment->page_size);
- gtk_adjustment_set_value (icon_view->priv->hadjustment, value);
+
+ gtk_adjustment_set_value (icon_view->priv->hadjustment,
+ icon_view->priv->hadjustment->value + offset);
gtk_adjustment_changed (icon_view->priv->hadjustment);
gtk_adjustment_changed (icon_view->priv->vadjustment);
@@ -6289,7 +6281,6 @@
{
gint px, py, x, y, width, height;
gint hoffset, voffset;
- gfloat value;
gdk_window_get_pointer (GTK_WIDGET (icon_view)->window, &px, &py, NULL);
gdk_window_get_geometry (GTK_WIDGET (icon_view)->window, &x, &y, &width, &height, NULL);
@@ -6304,19 +6295,12 @@
hoffset = MAX (px - (x + width - 2 * SCROLL_EDGE_SIZE), 0);
if (voffset != 0)
- {
- value = CLAMP (icon_view->priv->vadjustment->value + voffset,
- icon_view->priv->vadjustment->lower,
- icon_view->priv->vadjustment->upper - icon_view->priv->vadjustment->page_size);
- gtk_adjustment_set_value (icon_view->priv->vadjustment, value);
- }
+ gtk_adjustment_set_value (icon_view->priv->vadjustment,
+ icon_view->priv->vadjustment->value + voffset);
+
if (hoffset != 0)
- {
- value = CLAMP (icon_view->priv->hadjustment->value + hoffset,
- icon_view->priv->hadjustment->lower,
- icon_view->priv->hadjustment->upper - icon_view->priv->hadjustment->page_size);
- gtk_adjustment_set_value (icon_view->priv->hadjustment, value);
- }
+ gtk_adjustment_set_value (icon_view->priv->hadjustment,
+ icon_view->priv->hadjustment->value + hoffset);
}
Modified: trunk/gtk/gtkrange.c
==============================================================================
--- trunk/gtk/gtkrange.c (original)
+++ trunk/gtk/gtkrange.c Wed Aug 6 11:32:33 2008
@@ -961,9 +961,6 @@
value = MIN (value, MAX (range->adjustment->lower,
range->layout->fill_level));
- value = CLAMP (value, range->adjustment->lower,
- (range->adjustment->upper - range->adjustment->page_size));
-
gtk_adjustment_set_value (range->adjustment, value);
gtk_adjustment_changed (range->adjustment);
}
@@ -988,9 +985,6 @@
value = MIN (value, MAX (range->adjustment->lower,
range->layout->fill_level));
- value = CLAMP (value, range->adjustment->lower,
- (range->adjustment->upper - range->adjustment->page_size));
-
gtk_adjustment_set_value (range->adjustment, value);
}
Modified: trunk/gtk/gtkscrolledwindow.c
==============================================================================
--- trunk/gtk/gtkscrolledwindow.c (original)
+++ trunk/gtk/gtkscrolledwindow.c Wed Aug 6 11:32:33 2008
@@ -1127,8 +1127,6 @@
break;
}
- value = CLAMP (value, adjustment->lower, adjustment->upper - adjustment->page_size);
-
gtk_adjustment_set_value (adjustment, value);
return TRUE;
@@ -1512,13 +1510,11 @@
if (range && GTK_WIDGET_VISIBLE (range))
{
GtkAdjustment *adj = GTK_RANGE (range)->adjustment;
- gdouble delta, new_value;
+ gdouble delta;
delta = _gtk_range_get_wheel_delta (GTK_RANGE (range), event->direction);
- new_value = CLAMP (adj->value + delta, adj->lower, adj->upper - adj->page_size);
-
- gtk_adjustment_set_value (adj, new_value);
+ gtk_adjustment_set_value (adj, adj->value + delta);
return TRUE;
}
Modified: trunk/gtk/gtktreeview.c
==============================================================================
--- trunk/gtk/gtktreeview.c (original)
+++ trunk/gtk/gtktreeview.c Wed Aug 6 11:32:33 2008
@@ -3614,7 +3614,6 @@
GdkRectangle visible_rect;
gint y;
gint offset;
- gfloat value;
gdk_window_get_pointer (tree_view->priv->bin_window, NULL, &y, NULL);
y += tree_view->priv->dy;
@@ -3630,9 +3629,8 @@
return;
}
- value = CLAMP (tree_view->priv->vadjustment->value + offset, 0.0,
- tree_view->priv->vadjustment->upper - tree_view->priv->vadjustment->page_size);
- gtk_adjustment_set_value (tree_view->priv->vadjustment, value);
+ gtk_adjustment_set_value (tree_view->priv->vadjustment,
+ MAX (tree_view->priv->vadjustment->value + offset, 0.0));
}
static gboolean
@@ -3641,7 +3639,6 @@
GdkRectangle visible_rect;
gint x;
gint offset;
- gfloat value;
gdk_window_get_pointer (tree_view->priv->bin_window, &x, NULL, NULL);
@@ -3657,9 +3654,8 @@
}
offset = offset/3;
- value = CLAMP (tree_view->priv->hadjustment->value + offset,
- 0.0, tree_view->priv->hadjustment->upper - tree_view->priv->hadjustment->page_size);
- gtk_adjustment_set_value (tree_view->priv->hadjustment, value);
+ gtk_adjustment_set_value (tree_view->priv->hadjustment,
+ MAX (tree_view->priv->hadjustment->value + offset, 0.0));
return TRUE;
@@ -8952,11 +8948,7 @@
}
}
- gtk_adjustment_set_value (tree_view->priv->hadjustment,
- CLAMP (x,
- tree_view->priv->hadjustment->lower,
- tree_view->priv->hadjustment->upper
- - tree_view->priv->hadjustment->page_size));
+ gtk_adjustment_set_value (tree_view->priv->hadjustment, x);
}
else
{
@@ -11601,9 +11593,9 @@
vadj = tree_view->priv->vadjustment;
if (tree_x != -1)
- gtk_adjustment_set_value (hadj, CLAMP (tree_x, hadj->lower, hadj->upper - hadj->page_size));
+ gtk_adjustment_set_value (hadj, tree_x);
if (tree_y != -1)
- gtk_adjustment_set_value (vadj, CLAMP (tree_y, vadj->lower, vadj->upper - vadj->page_size));
+ gtk_adjustment_set_value (vadj, tree_y);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]