diff options
author | Pavel Šimerda <psimerda@redhat.com> | 2015-02-17 15:28:22 +0100 |
---|---|---|
committer | Pavel Šimerda <psimerda@redhat.com> | 2015-02-17 19:11:51 +0100 |
commit | bfef54b05d3e1a299366c971e2e804a744a3a7c5 (patch) | |
tree | bc121e5a5e1cbd899e5bee3e17d2d4194ff83914 | |
parent | 2674129a32b237e6752bb0baf4dc7f3319c350f4 (diff) | |
download | network-manager-applet-bfef54b05d3e1a299366c971e2e804a744a3a7c5.tar.gz |
applet: simplify nma_icons_init()
-rw-r--r-- | src/applet.c | 10 | ||||
-rw-r--r-- | src/applet.h | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/applet.c b/src/applet.c index ee027a5f..67539581 100644 --- a/src/applet.c +++ b/src/applet.c @@ -705,10 +705,11 @@ applet_new_menu_item_helper (NMConnection *connection, { NMSettingConnection *s_con = nm_connection_get_setting_connection (connection); GtkWidget *item = gtk_image_menu_item_new_with_label (""); - char *markup; - GtkWidget *label; if (add_active && (active == connection)) { + char *markup; + GtkWidget *label; + /* Pure evil */ label = gtk_bin_get_child (GTK_BIN (item)); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); @@ -3332,7 +3333,6 @@ error: static void nma_icons_init (NMApplet *applet) { - GdkScreen *screen; gboolean path_appended; if (applet->icon_theme) { @@ -3342,9 +3342,7 @@ static void nma_icons_init (NMApplet *applet) g_object_unref (G_OBJECT (applet->icon_theme)); } - screen = gtk_status_icon_get_screen (applet->status_icon); - g_assert (screen); - applet->icon_theme = gtk_icon_theme_get_for_screen (screen); + applet->icon_theme = gtk_icon_theme_get_for_screen (gtk_status_icon_get_screen (applet->status_icon)); /* If not done yet, append our search path */ path_appended = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (applet->icon_theme), diff --git a/src/applet.h b/src/applet.h index cf729afa..28629190 100644 --- a/src/applet.h +++ b/src/applet.h @@ -129,13 +129,13 @@ typedef struct GtkIconTheme * icon_theme; GHashTable * icon_cache; GdkPixbuf * fallback_icon; + int icon_size; /* Active status icon pixbufs */ GdkPixbuf * icon_layers[ICON_LAYER_MAX + 1]; /* Direct UI elements */ GtkStatusIcon * status_icon; - int icon_size; GtkWidget * menu; GtkWidget * context_menu; |