aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-12-08 12:29:26 -0600
committerTed Gould <ted@gould.cx>2010-12-08 12:29:26 -0600
commit0fee0e4b7f0fd2137ddf307edefa48c654457a9a (patch)
tree47f573400df09cf683d96fbe1cc9734fa46a0294
parentb35ed0dc2053fed40f0c6d7e97a97975951a076c (diff)
parent6d73d549745eddea81b38c7effa0f48509fcbb8d (diff)
downloadlibayatana-appindicator-0fee0e4b7f0fd2137ddf307edefa48c654457a9a.tar.gz
libayatana-appindicator-0fee0e4b7f0fd2137ddf307edefa48c654457a9a.tar.bz2
libayatana-appindicator-0fee0e4b7f0fd2137ddf307edefa48c654457a9a.zip
Syncing back with trunk
-rw-r--r--configure.ac1
-rw-r--r--example/Makefile.am4
-rw-r--r--example/simple-client-test-icon.pngbin0 -> 3310 bytes
-rw-r--r--example/simple-client.c20
4 files changed, 24 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 30b2279..3d906fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -222,6 +222,5 @@ AC_MSG_NOTICE([
Libappindicator Configuration:
Prefix: $prefix
- Indicator Dir: $INDICATORDIR
GTK+ Version: $with_gtk
])
diff --git a/example/Makefile.am b/example/Makefile.am
index ae468f7..e23e08d 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -11,9 +11,13 @@ simple_client_SOURCES = \
simple_client_CFLAGS = \
$(LIBRARY_CFLAGS) \
+ -DLOCAL_ICON="\"$(abs_srcdir)/simple-client-test-icon.png\"" \
-Wall -Werror \
-I$(top_srcdir)/src
simple_client_LDADD = \
$(LIBRARY_LIBS) \
$(top_builddir)/src/libappindicator.la
+
+EXTRA_DIST = \
+ simple-client-test-icon.png
diff --git a/example/simple-client-test-icon.png b/example/simple-client-test-icon.png
new file mode 100644
index 0000000..30dbb9d
--- /dev/null
+++ b/example/simple-client-test-icon.png
Binary files differ
diff --git a/example/simple-client.c b/example/simple-client.c
index f2fac6f..734aff6 100644
--- a/example/simple-client.c
+++ b/example/simple-client.c
@@ -60,6 +60,20 @@ activate_clicked_cb (GtkWidget *widget, gpointer data)
}
static void
+local_icon_toggle_cb (GtkWidget *widget, gpointer data)
+{
+ AppIndicator * ci = APP_INDICATOR(data);
+
+ if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) {
+ app_indicator_set_icon(ci, LOCAL_ICON);
+ } else {
+ app_indicator_set_icon(ci, "indicator-messages");
+ }
+
+ return;
+}
+
+static void
item_clicked_cb (GtkWidget *widget, gpointer data)
{
const gchar *text = (const gchar *)data;
@@ -192,6 +206,12 @@ main (int argc, char ** argv)
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
gtk_widget_show(item);
+ item = gtk_check_menu_item_new_with_label ("Set Local Icon");
+ g_signal_connect (item, "activate",
+ G_CALLBACK (local_icon_toggle_cb), ci);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ gtk_widget_show(item);
+
app_indicator_set_menu (ci, GTK_MENU (menu));
mainloop = g_main_loop_new(NULL, FALSE);