mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-06 10:50:08 +00:00
GtkPaned: Use G_PARAM_EXPLICIT_NOTIFY
This commit is contained in:
parent
c93355616f
commit
22cc9749c9
141
gtk/gtkpaned.c
141
gtk/gtkpaned.c
@ -331,22 +331,54 @@ gtk_paned_class_init (GtkPanedClass *class)
|
|||||||
"orientation");
|
"orientation");
|
||||||
|
|
||||||
g_object_class_install_property (object_class,
|
g_object_class_install_property (object_class,
|
||||||
PROP_POSITION,
|
PROP_POSITION,
|
||||||
g_param_spec_int ("position",
|
g_param_spec_int ("position",
|
||||||
P_("Position"),
|
P_("Position"),
|
||||||
P_("Position of paned separator in pixels (0 means all the way to the left/top)"),
|
P_("Position of paned separator in pixels (0 means all the way to the left/top)"),
|
||||||
0,
|
0, G_MAXINT, 0,
|
||||||
G_MAXINT,
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
||||||
0,
|
|
||||||
GTK_PARAM_READWRITE));
|
|
||||||
|
|
||||||
g_object_class_install_property (object_class,
|
g_object_class_install_property (object_class,
|
||||||
PROP_POSITION_SET,
|
PROP_POSITION_SET,
|
||||||
g_param_spec_boolean ("position-set",
|
g_param_spec_boolean ("position-set",
|
||||||
P_("Position Set"),
|
P_("Position Set"),
|
||||||
P_("TRUE if the Position property should be used"),
|
P_("TRUE if the Position property should be used"),
|
||||||
FALSE,
|
FALSE,
|
||||||
GTK_PARAM_READWRITE));
|
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GtkPaned:min-position:
|
||||||
|
*
|
||||||
|
* The smallest possible value for the position property.
|
||||||
|
* This property is derived from the size and shrinkability
|
||||||
|
* of the widget's children.
|
||||||
|
*
|
||||||
|
* Since: 2.4
|
||||||
|
*/
|
||||||
|
g_object_class_install_property (object_class,
|
||||||
|
PROP_MIN_POSITION,
|
||||||
|
g_param_spec_int ("min-position",
|
||||||
|
P_("Minimal Position"),
|
||||||
|
P_("Smallest possible value for the \"position\" property"),
|
||||||
|
0, G_MAXINT, 0,
|
||||||
|
GTK_PARAM_READABLE|G_PARAM_EXPLICIT_NOTIFY));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GtkPaned:max-position:
|
||||||
|
*
|
||||||
|
* The largest possible value for the position property.
|
||||||
|
* This property is derived from the size and shrinkability
|
||||||
|
* of the widget's children.
|
||||||
|
*
|
||||||
|
* Since: 2.4
|
||||||
|
*/
|
||||||
|
g_object_class_install_property (object_class,
|
||||||
|
PROP_MAX_POSITION,
|
||||||
|
g_param_spec_int ("max-position",
|
||||||
|
P_("Maximal Position"),
|
||||||
|
P_("Largest possible value for the \"position\" property"),
|
||||||
|
0, G_MAXINT, G_MAXINT,
|
||||||
|
GTK_PARAM_READABLE|G_PARAM_EXPLICIT_NOTIFY));
|
||||||
|
|
||||||
gtk_widget_class_install_style_property (widget_class,
|
gtk_widget_class_install_style_property (widget_class,
|
||||||
g_param_spec_int ("handle-size",
|
g_param_spec_int ("handle-size",
|
||||||
@ -356,41 +388,6 @@ gtk_paned_class_init (GtkPanedClass *class)
|
|||||||
G_MAXINT,
|
G_MAXINT,
|
||||||
5,
|
5,
|
||||||
GTK_PARAM_READABLE));
|
GTK_PARAM_READABLE));
|
||||||
/**
|
|
||||||
* GtkPaned:min-position:
|
|
||||||
*
|
|
||||||
* The smallest possible value for the position property. This property is derived from the
|
|
||||||
* size and shrinkability of the widget's children.
|
|
||||||
*
|
|
||||||
* Since: 2.4
|
|
||||||
*/
|
|
||||||
g_object_class_install_property (object_class,
|
|
||||||
PROP_MIN_POSITION,
|
|
||||||
g_param_spec_int ("min-position",
|
|
||||||
P_("Minimal Position"),
|
|
||||||
P_("Smallest possible value for the \"position\" property"),
|
|
||||||
0,
|
|
||||||
G_MAXINT,
|
|
||||||
0,
|
|
||||||
GTK_PARAM_READABLE));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GtkPaned:max-position:
|
|
||||||
*
|
|
||||||
* The largest possible value for the position property. This property is derived from the
|
|
||||||
* size and shrinkability of the widget's children.
|
|
||||||
*
|
|
||||||
* Since: 2.4
|
|
||||||
*/
|
|
||||||
g_object_class_install_property (object_class,
|
|
||||||
PROP_MAX_POSITION,
|
|
||||||
g_param_spec_int ("max-position",
|
|
||||||
P_("Maximal Position"),
|
|
||||||
P_("Largest possible value for the \"position\" property"),
|
|
||||||
0,
|
|
||||||
G_MAXINT,
|
|
||||||
G_MAXINT,
|
|
||||||
GTK_PARAM_READABLE));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GtkPaned:resize:
|
* GtkPaned:resize:
|
||||||
@ -818,32 +815,40 @@ gtk_paned_set_property (GObject *object,
|
|||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
case PROP_ORIENTATION:
|
case PROP_ORIENTATION:
|
||||||
priv->orientation = g_value_get_enum (value);
|
if (priv->orientation != g_value_get_enum (value))
|
||||||
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (paned));
|
|
||||||
|
|
||||||
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
|
||||||
{
|
{
|
||||||
priv->cursor_type = GDK_SB_H_DOUBLE_ARROW;
|
priv->orientation = g_value_get_enum (value);
|
||||||
gtk_gesture_pan_set_orientation (GTK_GESTURE_PAN (priv->pan_gesture),
|
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (paned));
|
||||||
GTK_ORIENTATION_HORIZONTAL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
priv->cursor_type = GDK_SB_V_DOUBLE_ARROW;
|
|
||||||
gtk_gesture_pan_set_orientation (GTK_GESTURE_PAN (priv->pan_gesture),
|
|
||||||
GTK_ORIENTATION_VERTICAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* state_flags_changed updates the cursor */
|
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||||
gtk_paned_state_flags_changed (GTK_WIDGET (paned), 0);
|
{
|
||||||
gtk_widget_queue_resize (GTK_WIDGET (paned));
|
priv->cursor_type = GDK_SB_H_DOUBLE_ARROW;
|
||||||
|
gtk_gesture_pan_set_orientation (GTK_GESTURE_PAN (priv->pan_gesture),
|
||||||
|
GTK_ORIENTATION_HORIZONTAL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
priv->cursor_type = GDK_SB_V_DOUBLE_ARROW;
|
||||||
|
gtk_gesture_pan_set_orientation (GTK_GESTURE_PAN (priv->pan_gesture),
|
||||||
|
GTK_ORIENTATION_VERTICAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* state_flags_changed updates the cursor */
|
||||||
|
gtk_paned_state_flags_changed (GTK_WIDGET (paned), 0);
|
||||||
|
gtk_widget_queue_resize (GTK_WIDGET (paned));
|
||||||
|
g_object_notify_by_pspec (object, pspec);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case PROP_POSITION:
|
case PROP_POSITION:
|
||||||
gtk_paned_set_position (paned, g_value_get_int (value));
|
gtk_paned_set_position (paned, g_value_get_int (value));
|
||||||
break;
|
break;
|
||||||
case PROP_POSITION_SET:
|
case PROP_POSITION_SET:
|
||||||
priv->position_set = g_value_get_boolean (value);
|
if (priv->position_set != g_value_get_boolean (value))
|
||||||
gtk_widget_queue_resize_no_redraw (GTK_WIDGET (paned));
|
{
|
||||||
|
priv->position_set = g_value_get_boolean (value);
|
||||||
|
gtk_widget_queue_resize_no_redraw (GTK_WIDGET (paned));
|
||||||
|
g_object_notify_by_pspec (object, pspec);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
Loading…
Reference in New Issue
Block a user