[gedit] tab: use symbolic icons
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] tab: use symbolic icons
- Date: Sun, 13 Oct 2013 11:17:46 +0000 (UTC)
commit 7eef46ab68f210c7f87b9bb25a24a3536072aef9
Author: Ignacio Casal Quinteiro <ignacio casal nice-software com>
Date: Sun Oct 13 13:17:02 2013 +0200
tab: use symbolic icons
gedit/gedit-tab.c | 52 ++++++++++++++++++----------------------------------
1 files changed, 18 insertions(+), 34 deletions(-)
---
diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c
index 12d2864..f7729a0 100644
--- a/gedit/gedit-tab.c
+++ b/gedit/gedit-tab.c
@@ -2004,15 +2004,17 @@ resize_icon (GdkPixbuf *pixbuf,
}
static GdkPixbuf *
-get_stock_icon (GtkIconTheme *theme,
- const gchar *stock,
- gint size)
+get_icon (GtkIconTheme *theme,
+ const gchar *icon_name,
+ gint size)
{
GdkPixbuf *pixbuf;
- pixbuf = gtk_icon_theme_load_icon (theme, stock, size, 0, NULL);
+ pixbuf = gtk_icon_theme_load_icon (theme, icon_name, size, 0, NULL);
if (pixbuf == NULL)
+ {
return NULL;
+ }
return resize_icon (pixbuf, size);
}
@@ -2038,50 +2040,32 @@ _gedit_tab_get_icon (GeditTab *tab)
switch (tab->priv->state)
{
- case GEDIT_TAB_STATE_LOADING:
- pixbuf = get_stock_icon (theme,
- GTK_STOCK_OPEN,
- icon_size);
- break;
-
- case GEDIT_TAB_STATE_REVERTING:
- pixbuf = get_stock_icon (theme,
- GTK_STOCK_REVERT_TO_SAVED,
- icon_size);
- break;
-
- case GEDIT_TAB_STATE_SAVING:
- pixbuf = get_stock_icon (theme,
- GTK_STOCK_SAVE,
- icon_size);
- break;
-
case GEDIT_TAB_STATE_PRINTING:
- pixbuf = get_stock_icon (theme,
- GTK_STOCK_PRINT,
- icon_size);
+ pixbuf = get_icon (theme,
+ "printer-printing-symbolic",
+ icon_size);
break;
case GEDIT_TAB_STATE_PRINT_PREVIEWING:
case GEDIT_TAB_STATE_SHOWING_PRINT_PREVIEW:
- pixbuf = get_stock_icon (theme,
- GTK_STOCK_PRINT_PREVIEW,
- icon_size);
+ pixbuf = get_icon (theme,
+ "printer-symbolic",
+ icon_size);
break;
case GEDIT_TAB_STATE_LOADING_ERROR:
case GEDIT_TAB_STATE_REVERTING_ERROR:
case GEDIT_TAB_STATE_SAVING_ERROR:
case GEDIT_TAB_STATE_GENERIC_ERROR:
- pixbuf = get_stock_icon (theme,
- GTK_STOCK_DIALOG_ERROR,
- icon_size);
+ pixbuf = get_icon (theme,
+ "dialog-error-symbolic",
+ icon_size);
break;
case GEDIT_TAB_STATE_EXTERNALLY_MODIFIED_NOTIFICATION:
- pixbuf = get_stock_icon (theme,
- GTK_STOCK_DIALOG_WARNING,
- icon_size);
+ pixbuf = get_icon (theme,
+ "dialog-warning-symbolic",
+ icon_size);
break;
default:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]