aboutsummaryrefslogtreecommitdiff
path: root/src/title-widget.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-09-07 21:00:08 +0100
committerConor Curran <conor.curran@canonical.com>2010-09-07 21:00:08 +0100
commit39680a792b250f478fcdd430c7c09a734ab35590 (patch)
treeb6883ce7c29eccedb81348e6e460c1201a6a5252 /src/title-widget.c
parent86423311e123d01b3528365b2010f25dc292625d (diff)
downloadayatana-indicator-sound-39680a792b250f478fcdd430c7c09a734ab35590.tar.gz
ayatana-indicator-sound-39680a792b250f478fcdd430c7c09a734ab35590.tar.bz2
ayatana-indicator-sound-39680a792b250f478fcdd430c7c09a734ab35590.zip
removed unnecessary hbox and label and set the text directly on the menuitem
Diffstat (limited to 'src/title-widget.c')
-rw-r--r--src/title-widget.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/src/title-widget.c b/src/title-widget.c
index fbcac0a..245c14c 100644
--- a/src/title-widget.c
+++ b/src/title-widget.c
@@ -32,8 +32,8 @@ typedef struct _TitleWidgetPrivate TitleWidgetPrivate;
struct _TitleWidgetPrivate
{
- GtkWidget* hbox;
- GtkWidget* name;
+ //GtkWidget* hbox;
+ //GtkWidget* name;
GtkWidget* image_item;
DbusmenuMenuitem* twin_item;
};
@@ -55,7 +55,7 @@ static void title_widget_property_update(DbusmenuMenuitem* item, gchar* property
GValue* value, gpointer userdata);
static void title_widget_set_twin_item( TitleWidget* self,
DbusmenuMenuitem* twin_item);
-static void title_widget_style_name_text(TitleWidget* self);
+//static void title_widget_style_name_text(TitleWidget* self);
static gboolean title_widget_triangle_draw_cb (GtkWidget *widget,
GdkEventExpose *event,
@@ -86,10 +86,10 @@ title_widget_init (TitleWidget *self)
TitleWidgetPrivate * priv = TITLE_WIDGET_GET_PRIVATE(self);
- GtkWidget *hbox;
+ //GtkWidget *hbox;
- hbox = gtk_hbox_new(FALSE, 0);
- priv->hbox = hbox;
+ //hbox = gtk_hbox_new(FALSE, 0);
+ //priv->hbox = hbox;
// Add image to the 'gutter'
gtk_image_menu_item_set_always_show_image(GTK_IMAGE_MENU_ITEM(self), TRUE);
@@ -123,7 +123,7 @@ title_widget_init (TitleWidget *self)
gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(self), GTK_WIDGET(icon));
- gtk_widget_show_all(icon);
+ //gtk_widget_show_all(icon);
// DEBUG
g_debug("title widget init - Is there a pixbuf from image loaded with helper : %i", GDK_IS_PIXBUF(buf));
@@ -202,8 +202,10 @@ title_widget_property_update(DbusmenuMenuitem* item, gchar* property,
TitleWidgetPrivate * priv = TITLE_WIDGET_GET_PRIVATE(mitem);
if(g_ascii_strcasecmp(DBUSMENU_TITLE_MENUITEM_NAME, property) == 0){
- gtk_label_set_text(GTK_LABEL(priv->name), g_value_get_string(value));
- title_widget_style_name_text(mitem);
+ gtk_menu_item_set_label (GTK_MENU_ITEM(mitem),
+ g_value_get_string(value));
+ //gtk_label_set_text(GTK_LABEL(priv->name), g_value_get_string(value));
+ //title_widget_style_name_text(mitem);
}
}
@@ -219,18 +221,21 @@ title_widget_set_twin_item(TitleWidget* self,
"expose_event", G_CALLBACK (title_widget_triangle_draw_cb), twin_item);
// Add the application name
- priv->name = gtk_label_new(dbusmenu_menuitem_property_get(priv->twin_item,
- DBUSMENU_TITLE_MENUITEM_NAME));
- gtk_misc_set_padding(GTK_MISC(priv->name), 0, 0);
- gtk_box_pack_start (GTK_BOX (priv->hbox), priv->name, FALSE, FALSE, 0);
-
- title_widget_style_name_text(self);
-
- gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET(priv->hbox));
- gtk_widget_show_all (priv->hbox);
+ //priv->name = gtk_label_new(dbusmenu_menuitem_property_get(priv->twin_item,
+ // DBUSMENU_TITLE_MENUITEM_NAME));
+ //gtk_misc_set_padding(GTK_MISC(priv->name), 0, 0);
+ //gtk_box_pack_start (GTK_BOX (priv->hbox), priv->name, FALSE, FALSE, 0);
+
+ //title_widget_style_name_text(self);
+ gtk_menu_item_set_label (GTK_MENU_ITEM(self),
+ dbusmenu_menuitem_property_get(priv->twin_item,
+ DBUSMENU_TITLE_MENUITEM_NAME));
+
+ //gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET(priv->hbox));
+ gtk_widget_show_all (GTK_WIDGET(self));
}
-static void
+/*static void
title_widget_style_name_text(TitleWidget* self)
{
TitleWidgetPrivate * priv = TITLE_WIDGET_GET_PRIVATE(self);
@@ -240,7 +245,7 @@ title_widget_style_name_text(TitleWidget* self)
gtk_label_get_text(GTK_LABEL(priv->name)));
gtk_label_set_markup (GTK_LABEL (priv->name), markup);
g_free(markup);
-}
+}*/
static gboolean
title_widget_triangle_draw_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data)