Commit cf3d1e1f authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

add "inverted" property

2001-06-06  Havoc Pennington  <hp@redhat.com>

	* gtk/gtkrange.c (gtk_range_class_init): add "inverted" property

	* gtk/gtkscale.c (gtk_scale_class_init): Change Page Up and Page
	Down to move visually rather than logically, since it confuses
	people. Add -/+ and Ctrl--/+ bindings for logical movement.
parent 2122f8d4
2001-06-06 Havoc Pennington <hp@redhat.com>
* gtk/gtkrange.c (gtk_range_class_init): add "inverted" property
* gtk/gtkscale.c (gtk_scale_class_init): Change Page Up and Page
Down to move visually rather than logically, since it confuses
people. Add -/+ and Ctrl--/+ bindings for logical movement.
Wed Jun 6 10:34:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.h: Include gtkwidget.h
......
2001-06-06 Havoc Pennington <hp@redhat.com>
* gtk/gtkrange.c (gtk_range_class_init): add "inverted" property
* gtk/gtkscale.c (gtk_scale_class_init): Change Page Up and Page
Down to move visually rather than logically, since it confuses
people. Add -/+ and Ctrl--/+ bindings for logical movement.
Wed Jun 6 10:34:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.h: Include gtkwidget.h
......
2001-06-06 Havoc Pennington <hp@redhat.com>
* gtk/gtkrange.c (gtk_range_class_init): add "inverted" property
* gtk/gtkscale.c (gtk_scale_class_init): Change Page Up and Page
Down to move visually rather than logically, since it confuses
people. Add -/+ and Ctrl--/+ bindings for logical movement.
Wed Jun 6 10:34:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.h: Include gtkwidget.h
......
2001-06-06 Havoc Pennington <hp@redhat.com>
* gtk/gtkrange.c (gtk_range_class_init): add "inverted" property
* gtk/gtkscale.c (gtk_scale_class_init): Change Page Up and Page
Down to move visually rather than logically, since it confuses
people. Add -/+ and Ctrl--/+ bindings for logical movement.
Wed Jun 6 10:34:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.h: Include gtkwidget.h
......
2001-06-06 Havoc Pennington <hp@redhat.com>
* gtk/gtkrange.c (gtk_range_class_init): add "inverted" property
* gtk/gtkscale.c (gtk_scale_class_init): Change Page Up and Page
Down to move visually rather than logically, since it confuses
people. Add -/+ and Ctrl--/+ bindings for logical movement.
Wed Jun 6 10:34:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.h: Include gtkwidget.h
......
2001-06-06 Havoc Pennington <hp@redhat.com>
* gtk/gtkrange.c (gtk_range_class_init): add "inverted" property
* gtk/gtkscale.c (gtk_scale_class_init): Change Page Up and Page
Down to move visually rather than logically, since it confuses
people. Add -/+ and Ctrl--/+ bindings for logical movement.
Wed Jun 6 10:34:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.h: Include gtkwidget.h
......
2001-06-06 Havoc Pennington <hp@redhat.com>
* gtk/gtkrange.c (gtk_range_class_init): add "inverted" property
* gtk/gtkscale.c (gtk_scale_class_init): Change Page Up and Page
Down to move visually rather than logically, since it confuses
people. Add -/+ and Ctrl--/+ bindings for logical movement.
Wed Jun 6 10:34:42 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.h: Include gtkwidget.h
......
......@@ -93,3 +93,8 @@ Emitted when the range value changes.
</para>
<!-- ##### ARG GtkRange:inverted ##### -->
<para>
</para>
......@@ -39,7 +39,8 @@
enum {
PROP_0,
PROP_UPDATE_POLICY,
PROP_ADJUSTMENT
PROP_ADJUSTMENT,
PROP_INVERTED
};
enum {
......@@ -261,6 +262,14 @@ gtk_range_class_init (GtkRangeClass *class)
GTK_TYPE_ADJUSTMENT,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_INVERTED,
g_param_spec_boolean ("inverted",
_("Inverted"),
_("Invert direction slider moves to increase range value"),
FALSE,
G_PARAM_READWRITE));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("slider_width",
_("Slider Width"),
......@@ -313,6 +322,9 @@ gtk_range_set_property (GObject *object,
case PROP_ADJUSTMENT:
gtk_range_set_adjustment (range, g_value_get_object (value));
break;
case PROP_INVERTED:
gtk_range_set_inverted (range, g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -337,6 +349,9 @@ gtk_range_get_property (GObject *object,
case PROP_ADJUSTMENT:
g_value_set_object (value, G_OBJECT (range->adjustment));
break;
case PROP_INVERTED:
g_value_set_boolean (value, range->inverted);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -492,6 +507,7 @@ gtk_range_set_inverted (GtkRange *range,
if (setting != range->inverted)
{
range->inverted = setting;
g_object_notify (G_OBJECT (range), "inverted");
gtk_widget_queue_resize (GTK_WIDGET (range));
}
}
......
......@@ -205,7 +205,6 @@ gtk_scale_class_init (GtkScaleClass *class)
add_slider_binding (binding_set, GDK_KP_Left, GDK_CONTROL_MASK,
GTK_SCROLL_PAGE_LEFT);
add_slider_binding (binding_set, GDK_Right, 0,
GTK_SCROLL_STEP_RIGHT);
......@@ -230,7 +229,6 @@ gtk_scale_class_init (GtkScaleClass *class)
add_slider_binding (binding_set, GDK_KP_Up, GDK_CONTROL_MASK,
GTK_SCROLL_PAGE_UP);
add_slider_binding (binding_set, GDK_Down, 0,
GTK_SCROLL_STEP_DOWN);
......@@ -242,23 +240,59 @@ gtk_scale_class_init (GtkScaleClass *class)
add_slider_binding (binding_set, GDK_KP_Down, GDK_CONTROL_MASK,
GTK_SCROLL_PAGE_DOWN);
/* I think most users will find it strange that these move
* logically instead of visually...
*/
add_slider_binding (binding_set, GDK_Page_Up, 0,
GTK_SCROLL_PAGE_BACKWARD);
GTK_SCROLL_PAGE_LEFT);
add_slider_binding (binding_set, GDK_KP_Page_Up, 0,
GTK_SCROLL_PAGE_BACKWARD);
GTK_SCROLL_PAGE_LEFT);
add_slider_binding (binding_set, GDK_Page_Up, 0,
GTK_SCROLL_PAGE_UP);
add_slider_binding (binding_set, GDK_KP_Page_Up, 0,
GTK_SCROLL_PAGE_UP);
add_slider_binding (binding_set, GDK_Page_Down, 0,
GTK_SCROLL_PAGE_FORWARD);
GTK_SCROLL_PAGE_RIGHT);
add_slider_binding (binding_set, GDK_KP_Page_Down, 0,
GTK_SCROLL_PAGE_FORWARD);
GTK_SCROLL_PAGE_RIGHT);
add_slider_binding (binding_set, GDK_Page_Down, 0,
GTK_SCROLL_PAGE_DOWN);
add_slider_binding (binding_set, GDK_KP_Page_Down, 0,
GTK_SCROLL_PAGE_DOWN);
/* Logical bindings (vs. visual bindings above) */
add_slider_binding (binding_set, GDK_plus, 0,
GTK_SCROLL_STEP_FORWARD);
add_slider_binding (binding_set, GDK_minus, 0,
GTK_SCROLL_STEP_BACKWARD);
add_slider_binding (binding_set, GDK_plus, GDK_CONTROL_MASK,
GTK_SCROLL_PAGE_FORWARD);
add_slider_binding (binding_set, GDK_minus, GDK_CONTROL_MASK,
GTK_SCROLL_PAGE_BACKWARD);
add_slider_binding (binding_set, GDK_KP_Add, 0,
GTK_SCROLL_STEP_FORWARD);
add_slider_binding (binding_set, GDK_KP_Subtract, 0,
GTK_SCROLL_STEP_BACKWARD);
add_slider_binding (binding_set, GDK_KP_Add, GDK_CONTROL_MASK,
GTK_SCROLL_PAGE_FORWARD);
add_slider_binding (binding_set, GDK_KP_Subtract, GDK_CONTROL_MASK,
GTK_SCROLL_PAGE_BACKWARD);
add_slider_binding (binding_set, GDK_Home, 0,
GTK_SCROLL_START);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment