aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/idoscalemenuitem.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/idoscalemenuitem.c b/src/idoscalemenuitem.c
index f29c2dc..39cecbb 100644
--- a/src/idoscalemenuitem.c
+++ b/src/idoscalemenuitem.c
@@ -70,6 +70,7 @@ struct _IdoScaleMenuItemPrivate {
gboolean grabbed;
IdoScaleMenuItemStyle style;
IdoRangeStyle range_style;
+ gint toggle_size;
};
enum {
@@ -188,7 +189,7 @@ ido_scale_menu_item_size_allocate (GtkWidget *widget,
priv->child_allocation.y = GTK_CONTAINER (widget)->border_width + widget->style->ythickness;
priv->child_allocation.x += horizontal_padding;
- priv->child_allocation.x += GTK_MENU_ITEM (widget)->toggle_size;
+ priv->child_allocation.x += priv->toggle_size;
priv->child_allocation.width = MAX (1, (gint)allocation->width - priv->child_allocation.x * 2);
priv->child_allocation.width -= (primary_padding + secondary_padding);
@@ -198,6 +199,16 @@ ido_scale_menu_item_size_allocate (GtkWidget *widget,
}
static void
+ido_scale_menu_item_toggle_size_allocate (IdoScaleMenuItem *item,
+ gint toggle_size,
+ gpointer user_data)
+{
+ IdoScaleMenuItemPrivate *priv = GET_PRIVATE (item);
+
+ priv->toggle_size = toggle_size;
+}
+
+static void
ido_scale_menu_item_constructed (GObject *object)
{
IdoScaleMenuItem *self = IDO_SCALE_MENU_ITEM (object);
@@ -235,6 +246,10 @@ ido_scale_menu_item_constructed (GObject *object)
update_packing (self, priv->style, priv->style);
+ g_signal_connect (self, "toggle-size-allocate",
+ G_CALLBACK (ido_scale_menu_item_toggle_size_allocate),
+ NULL);
+
g_signal_connect (self, "notify",
G_CALLBACK (ido_scale_menu_item_notify),
NULL);