summaryrefslogtreecommitdiff
path: root/gtk/gtkaction.c
diff options
context:
space:
mode:
authorJody Goldberg <jody@gnome.org>2004-01-02 23:14:28 +0000
committerJody Goldberg <jody@src.gnome.org>2004-01-02 23:14:28 +0000
commit9acc941959dfb420645e8ba033a2b15ce0821c16 (patch)
tree7ef30ec4135c6be6dbc3a8f734af0c25ecdda9db /gtk/gtkaction.c
parentdf6a099ea9c099e304af7e75fc22d00a1c538b54 (diff)
downloadgdk-pixbuf-9acc941959dfb420645e8ba033a2b15ce0821c16.tar.gz
add visible_horizontal, visible_vertical. (gtk_action_class_init) : here.
2004-01-01 Jody Goldberg <jody@gnome.org> * gtk/gtkaction.c (_GtkActionPrivate) : add visible_horizontal, visible_vertical. (gtk_action_class_init) : here. (gtk_action_init) : here. (gtk_action_set_property) : here. (gtk_action_get_property) : here. (connect_proxy) : and here. 2003-12-30 Jody Goldberg <jody@gnome.org> * gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel) : new utility routine for use in derived GtkActions with the replicated code from. (gtk_action_group_add_actions_full) : here. (gtk_action_group_add_toggle_actions_full) : here. (gtk_action_group_add_radio_actions_full) : and here. 2003-12-24 Jody Goldberg <jody@gnome.org> * gtk/gtkactiongroup.h : Add some const to the char * in GtkActionEntry*. We're reccomending people pass static strings to them, and not freeing them. This stems to flood of warnings that result. * gtk/gtkactiongroup.c (gtk_action_group_add_actions_full) : change temp vars to const to match above. (gtk_action_group_add_toggle_actions_full) : ditto. (gtk_action_group_add_radio_actions_full) : ditto.
Diffstat (limited to 'gtk/gtkaction.c')
-rw-r--r--gtk/gtkaction.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/gtk/gtkaction.c b/gtk/gtkaction.c
index 19730370f..b0db28361 100644
--- a/gtk/gtkaction.c
+++ b/gtk/gtkaction.c
@@ -59,6 +59,8 @@ struct _GtkActionPrivate
guint visible : 1;
guint label_set : 1; /* these two used so we can set label */
guint short_label_set : 1; /* based on stock id */
+ guint visible_horizontal : 1;
+ guint visible_vertical : 1;
guint is_important : 1;
guint hide_if_empty : 1;
@@ -88,6 +90,8 @@ enum
PROP_SHORT_LABEL,
PROP_TOOLTIP,
PROP_STOCK_ID,
+ PROP_VISIBLE_HORIZONTAL,
+ PROP_VISIBLE_VERTICAL,
PROP_IS_IMPORTANT,
PROP_HIDE_IF_EMPTY,
PROP_SENSITIVE,
@@ -216,6 +220,20 @@ gtk_action_class_init (GtkActionClass *klass)
NULL,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
+ PROP_VISIBLE_HORIZONTAL,
+ g_param_spec_boolean ("visible_horizontal",
+ _("Visible when horizontal"),
+ _("Whether the toolbar item is visible when the toolbar is in a horizontal orientation."),
+ TRUE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
+ PROP_VISIBLE_VERTICAL,
+ g_param_spec_boolean ("visible_vertical",
+ _("Visible when vertical"),
+ _("Whether the toolbar item is visible when the toolbar is in a vertical orientation."),
+ TRUE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class,
PROP_IS_IMPORTANT,
g_param_spec_boolean ("is_important",
_("Is important"),
@@ -315,6 +333,8 @@ gtk_action_init (GtkAction *action)
action->private_data->short_label = NULL;
action->private_data->tooltip = NULL;
action->private_data->stock_id = NULL;
+ action->private_data->visible_horizontal = TRUE;
+ action->private_data->visible_vertical = TRUE;
action->private_data->is_important = FALSE;
action->private_data->hide_if_empty = TRUE;
@@ -436,6 +456,12 @@ gtk_action_set_property (GObject *object,
g_object_notify (object, "short_label");
}
break;
+ case PROP_VISIBLE_HORIZONTAL:
+ action->private_data->visible_horizontal = g_value_get_boolean (value);
+ break;
+ case PROP_VISIBLE_VERTICAL:
+ action->private_data->visible_vertical = g_value_get_boolean (value);
+ break;
case PROP_IS_IMPORTANT:
action->private_data->is_important = g_value_get_boolean (value);
break;
@@ -481,6 +507,12 @@ gtk_action_get_property (GObject *object,
case PROP_STOCK_ID:
g_value_set_string (value, action->private_data->stock_id);
break;
+ case PROP_VISIBLE_HORIZONTAL:
+ g_value_set_boolean (value, action->private_data->visible_horizontal);
+ break;
+ case PROP_VISIBLE_VERTICAL:
+ g_value_set_boolean (value, action->private_data->visible_vertical);
+ break;
case PROP_IS_IMPORTANT:
g_value_set_boolean (value, action->private_data->is_important);
break;
@@ -782,6 +814,8 @@ connect_proxy (GtkAction *action,
"label", action->private_data->short_label,
"use_underline", TRUE,
"stock_id", action->private_data->stock_id,
+ "visible_horizontal", action->private_data->visible_horizontal,
+ "visible_vertical", action->private_data->visible_vertical,
"is_important", action->private_data->is_important,
NULL);
/* FIXME: we should set the tooltip here, but the current api
@@ -793,6 +827,12 @@ connect_proxy (GtkAction *action,
g_signal_connect_object (action, "notify::stock_id",
G_CALLBACK (gtk_action_sync_property),
proxy, 0);
+ g_signal_connect_object (action, "notify::visible_horizontal",
+ G_CALLBACK (gtk_action_sync_property),
+ proxy, 0);
+ g_signal_connect_object (action, "notify::visible_vertical",
+ G_CALLBACK (gtk_action_sync_property),
+ proxy, 0);
g_signal_connect_object (action, "notify::is_important",
G_CALLBACK (gtk_action_sync_property),
proxy, 0);