aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2010-03-11 23:48:08 +0100
committerSebastien Bacher <seb128@ubuntu.com>2010-03-11 23:48:08 +0100
commit04fecf21cb26bc72be233e24684b065f9572f036 (patch)
tree917a005d553cc16c50cd2e728d75fbc7f51e2c18 /src
parent8dcf6e3c998de10b8989d5a66308c3dd424668e9 (diff)
parent0be5c8bcef961b60a8748ebdc63adc9a98cb8aef (diff)
downloadlibayatana-appindicator-04fecf21cb26bc72be233e24684b065f9572f036.tar.gz
libayatana-appindicator-04fecf21cb26bc72be233e24684b065f9572f036.tar.bz2
libayatana-appindicator-04fecf21cb26bc72be233e24684b065f9572f036.zip
releasing version 0.0.16-0ubuntu10.0.16-0ubuntu1
Diffstat (limited to 'src')
-rw-r--r--src/indicator-application.c20
-rw-r--r--src/libappindicator/app-indicator.c33
2 files changed, 36 insertions, 17 deletions
diff --git a/src/indicator-application.c b/src/indicator-application.c
index d89874e..b681a24 100644
--- a/src/indicator-application.c
+++ b/src/indicator-application.c
@@ -35,6 +35,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <libindicator/indicator.h>
#include <libindicator/indicator-object.h>
#include <libindicator/indicator-service-manager.h>
+#include <libindicator/indicator-image-helper.h>
/* Local Stuff */
#include "dbus-shared.h"
@@ -89,9 +90,6 @@ struct _ApplicationEntry {
gchar * dbusaddress;
};
-#define DESIGN_TEAM_SIZE design_team_size
-static GtkIconSize design_team_size;
-
#define INDICATOR_APPLICATION_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATOR_APPLICATION_TYPE, IndicatorApplicationPrivate))
@@ -146,8 +144,6 @@ indicator_application_class_init (IndicatorApplicationClass *klass)
G_TYPE_STRING,
G_TYPE_INVALID);
- design_team_size = gtk_icon_size_register("design-team-size", 22, 22);
-
return;
}
@@ -452,11 +448,7 @@ application_added (DBusGProxy * proxy, const gchar * iconname, gint position, co
icon is available we want to use it. Otherwise we'll
just use the name we were given. */
gchar * longname = g_strdup_printf("%s-%s", iconname, PANEL_ICON_SUFFIX);
- if (gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), longname)) {
- app->entry.image = GTK_IMAGE(gtk_image_new_from_icon_name(longname, DESIGN_TEAM_SIZE));
- } else {
- app->entry.image = GTK_IMAGE(gtk_image_new_from_icon_name(iconname, DESIGN_TEAM_SIZE));
- }
+ app->entry.image = indicator_image_helper(longname);
g_free(longname);
app->entry.label = NULL;
@@ -534,13 +526,7 @@ application_icon_changed (DBusGProxy * proxy, gint position, const gchar * iconn
icon is available we want to use it. Otherwise we'll
just use the name we were given. */
gchar * longname = g_strdup_printf("%s-%s", iconname, PANEL_ICON_SUFFIX);
- if (gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), longname)) {
- g_debug("Setting icon on %d to %s", position, longname);
- gtk_image_set_from_icon_name(app->entry.image, longname, DESIGN_TEAM_SIZE);
- } else {
- g_debug("Setting icon on %d to %s", position, iconname);
- gtk_image_set_from_icon_name(app->entry.image, iconname, DESIGN_TEAM_SIZE);
- }
+ indicator_image_helper_update(app->entry.image, longname);
g_free(longname);
return;
diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c
index ef9f5c0..5edc9fe 100644
--- a/src/libappindicator/app-indicator.c
+++ b/src/libappindicator/app-indicator.c
@@ -1160,6 +1160,21 @@ widget_notify_cb (GtkWidget *widget,
}
static void
+action_notify_cb (GtkAction *action,
+ GParamSpec *pspec,
+ gpointer data)
+{
+ DbusmenuMenuitem *child = (DbusmenuMenuitem *)data;
+
+ if (pspec->name == g_intern_static_string ("label"))
+ {
+ dbusmenu_menuitem_property_set (child,
+ DBUSMENU_MENUITEM_PROP_LABEL,
+ gtk_action_get_label (action));
+ }
+}
+
+static void
container_iterate (GtkWidget *widget,
gpointer data)
{
@@ -1281,6 +1296,24 @@ container_iterate (GtkWidget *widget,
g_signal_connect (widget, "notify",
G_CALLBACK (widget_notify_cb), child);
+ if (GTK_IS_ACTIVATABLE (widget))
+ {
+ GtkActivatable *activatable = GTK_ACTIVATABLE (widget);
+
+ if (gtk_activatable_get_use_action_appearance (activatable))
+ {
+ GtkAction *action = gtk_activatable_get_related_action (activatable);
+
+ if (action)
+ {
+ g_signal_connect_object (action, "notify",
+ G_CALLBACK (action_notify_cb),
+ child,
+ G_CONNECT_AFTER);
+ }
+ }
+ }
+
g_signal_connect (G_OBJECT (child),
DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
G_CALLBACK (activate_menuitem), widget);