Commit 1e50d79b authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

add an "ellipsize" property that is applied to all proxy menu items'

2008-05-11  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpaction.[ch]: add an "ellipsize" property that is
	applied to all proxy menu items' labels.

	* app/actions/windows-actions.c: set the dock actions to
	PANGO_ELLIPSIZE_END because their labels can be insanely long.


svn path=/trunk/; revision=25635
parent a0e6800c
2008-05-11 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpaction.[ch]: add an "ellipsize" property that is
applied to all proxy menu items' labels.
* app/actions/windows-actions.c: set the dock actions to
PANGO_ELLIPSIZE_END because their labels can be insanely long.
2008-05-11 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpaction.c (gimp_action_set_proxy): small cleanup.
......
......@@ -261,6 +261,10 @@ windows_actions_dock_added (GimpDialogFactory *factory,
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
action_name);
g_object_set (action,
"ellipsize", PANGO_ELLIPSIZE_END,
NULL);
g_object_set_data (G_OBJECT (action), "dock", dock);
g_free (action_name);
......
......@@ -46,7 +46,8 @@ enum
PROP_0,
PROP_CONTEXT,
PROP_COLOR,
PROP_VIEWABLE
PROP_VIEWABLE,
PROP_ELLIPSIZE
};
......@@ -102,6 +103,13 @@ gimp_action_class_init (GimpActionClass *klass)
NULL, NULL,
GIMP_TYPE_VIEWABLE,
GIMP_PARAM_READWRITE));
g_object_class_install_property (object_class, PROP_ELLIPSIZE,
g_param_spec_enum ("ellipsize",
NULL, NULL,
PANGO_TYPE_ELLIPSIZE_MODE,
PANGO_ELLIPSIZE_NONE,
GIMP_PARAM_READWRITE));
}
static void
......@@ -109,6 +117,7 @@ gimp_action_init (GimpAction *action)
{
action->color = NULL;
action->viewable = NULL;
action->ellipsize = PANGO_ELLIPSIZE_NONE;
}
static void
......@@ -156,6 +165,10 @@ gimp_action_get_property (GObject *object,
case PROP_VIEWABLE:
g_value_set_object (value, action->viewable);
break;
case PROP_ELLIPSIZE:
g_value_set_enum (value, action->ellipsize);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -190,6 +203,11 @@ gimp_action_set_property (GObject *object,
action->viewable = GIMP_VIEWABLE (g_value_dup_object (value));
set_proxy = TRUE;
break;
case PROP_ELLIPSIZE:
action->ellipsize = g_value_get_enum (value);
set_proxy = TRUE;
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -372,4 +390,13 @@ gimp_action_set_proxy (GimpAction *action,
g_object_notify (G_OBJECT (action), "stock-id");
}
}
{
GtkWidget *label = gtk_bin_get_child (GTK_BIN (proxy));
if (GTK_IS_LABEL (label))
{
gtk_label_set_ellipsize (GTK_LABEL (label), action->ellipsize);
}
}
}
......@@ -44,6 +44,7 @@ struct _GimpAction
GimpRGB *color;
GimpViewable *viewable;
PangoEllipsizeMode ellipsize;
};
struct _GimpActionClass
......
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