[gnumeric] Dead kittens: more icon-name, less stock-id.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Dead kittens: more icon-name, less stock-id.
- Date: Fri, 2 Jan 2015 05:03:33 +0000 (UTC)
commit da785538f2072238e20da043ee78938fa66142c6
Author: Morten Welinder <terra gnome org>
Date: Fri Jan 2 00:03:10 2015 -0500
Dead kittens: more icon-name, less stock-id.
src/dialogs/define-name.ui | 13 ++++---
src/dialogs/dialog-define-names.c | 59 ++++++++++------------------------
src/dialogs/dialog-function-select.c | 14 --------
src/dialogs/dialog-workbook-attr.c | 22 +++++++------
src/dialogs/function-select.ui | 23 +++++++------
5 files changed, 50 insertions(+), 81 deletions(-)
---
diff --git a/src/dialogs/define-name.ui b/src/dialogs/define-name.ui
index 456e1f4..008b85d 100644
--- a/src/dialogs/define-name.ui
+++ b/src/dialogs/define-name.ui
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
<interface>
- <!-- interface-requires gtk+ 3.0 -->
+ <requires lib="gtk+" version="3.0"/>
<object class="GtkDialog" id="NameGuru">
<property name="can_focus">False</property>
<property name="border_width">5</property>
@@ -22,11 +23,11 @@
<child>
<object class="GtkButton" id="help_button">
<property name="label">gtk-help</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -38,11 +39,11 @@
<child>
<object class="GtkButton" id="close_button">
<property name="label">gtk-close</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -54,11 +55,11 @@
<child>
<object class="GtkButton" id="paste_button">
<property name="label">gtk-paste</property>
+ <property name="use_action_appearance">False</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -110,7 +111,7 @@
<property name="xpad">2</property>
<property name="ypad">2</property>
<property name="stock">gtk-find</property>
- <property name="icon-size">2</property>
+ <property name="icon_size">2</property>
</object>
<packing>
<property name="expand">False</property>
@@ -123,6 +124,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
+ <property name="secondary_icon_name">edit-clear</property>
+ <property name="secondary_icon_tooltip_text" translatable="yes">Erase the search
entry.</property>
</object>
<packing>
<property name="expand">True</property>
diff --git a/src/dialogs/dialog-define-names.c b/src/dialogs/dialog-define-names.c
index 2042f0f..5d24a24 100644
--- a/src/dialogs/dialog-define-names.c
+++ b/src/dialogs/dialog-define-names.c
@@ -1048,14 +1048,22 @@ cb_name_guru_selection_function (G_GNUC_UNUSED GtkTreeSelection *selection,
return FALSE;
}
+static GdkPixbuf *
+get_icon (GtkIconTheme *theme, const char *icon_name)
+{
+ return gtk_icon_theme_load_icon (theme, icon_name, 16, 0, NULL);
+}
+
+
static gboolean
name_guru_init (NameGuruState *state, WBCGtk *wbcg, gboolean is_paste_dialog)
{
- Workbook *wb = wb_control_get_workbook
- (WORKBOOK_CONTROL (wbcg));
+ Workbook *wb = wb_control_get_workbook (WORKBOOK_CONTROL (wbcg));
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
GtkTreeSelection *selection;
+ GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (wbcg_toplevel (wbcg)));
+ GtkIconTheme *theme = gtk_icon_theme_get_for_screen (screen);
state->is_paste_dialog = is_paste_dialog;
state->has_pasted = FALSE;
@@ -1181,10 +1189,7 @@ name_guru_init (NameGuruState *state, WBCGtk *wbcg, gboolean is_paste_dialog)
"changed",
G_CALLBACK (name_guru_update_sensitivity),
state);
- state->image_paste = gtk_widget_render_icon_pixbuf
- (state->dialog,
- GTK_STOCK_PASTE,
- GTK_ICON_SIZE_SMALL_TOOLBAR);
+ state->image_paste = get_icon (theme, "edit-paste");
state->image_add = NULL;
state->image_delete = NULL;
state->image_lock = NULL;
@@ -1192,44 +1197,14 @@ name_guru_init (NameGuruState *state, WBCGtk *wbcg, gboolean is_paste_dialog)
state->image_down = NULL;
} else {
state->image_paste = NULL;
- state->image_add = gtk_widget_render_icon_pixbuf
- (state->dialog,
- GTK_STOCK_ADD,
- GTK_ICON_SIZE_SMALL_TOOLBAR);
- state->image_delete = gtk_widget_render_icon_pixbuf
- (state->dialog,
- GTK_STOCK_REMOVE,
- GTK_ICON_SIZE_SMALL_TOOLBAR);
- state->image_lock = gtk_widget_render_icon_pixbuf
- (state->dialog,
- "gnumeric-protection-yes",
- GTK_ICON_SIZE_SMALL_TOOLBAR);
- state->image_up = gtk_widget_render_icon_pixbuf
- (state->dialog,
- GTK_STOCK_GO_UP,
- GTK_ICON_SIZE_SMALL_TOOLBAR);
- state->image_down = gtk_widget_render_icon_pixbuf
- (state->dialog,
- GTK_STOCK_GO_DOWN,
- GTK_ICON_SIZE_SMALL_TOOLBAR);
+ state->image_add = get_icon (theme, "list-add");
+ state->image_delete = get_icon (theme, "list-remove");
+ state->image_lock = get_icon (theme, "gnumeric-protection-yes");
+ state->image_up = get_icon (theme, "go-up");
+ state->image_down = get_icon (theme, "do-down");
}
- state->search_entry = go_gtk_builder_get_widget (state->gui,
- "search_entry");
-
- gtk_entry_set_icon_from_stock
- (GTK_ENTRY (state->search_entry),
- GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_CLEAR);
- gtk_entry_set_icon_tooltip_text
- (GTK_ENTRY (state->search_entry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Erase the search entry."));
- gtk_entry_set_icon_sensitive
- (GTK_ENTRY (state->search_entry),
- GTK_ENTRY_ICON_SECONDARY, TRUE);
- gtk_entry_set_icon_activatable
- (GTK_ENTRY (state->search_entry),
- GTK_ENTRY_ICON_SECONDARY, TRUE);
+ state->search_entry = go_gtk_builder_get_widget (state->gui, "search_entry");
g_signal_connect (G_OBJECT (state->search_entry),
"icon-press",
diff --git a/src/dialogs/dialog-function-select.c b/src/dialogs/dialog-function-select.c
index 3ce3945..b863665 100644
--- a/src/dialogs/dialog-function-select.c
+++ b/src/dialogs/dialog-function-select.c
@@ -1273,20 +1273,6 @@ dialog_function_select_init (FunctionSelectState *state)
gtk_entry_set_text (GTK_ENTRY (state->search_entry),
state->paste.prefix);
- gtk_entry_set_icon_from_stock
- (GTK_ENTRY (state->search_entry),
- GTK_ENTRY_ICON_SECONDARY, GTK_STOCK_CLEAR);
- gtk_entry_set_icon_tooltip_text
- (GTK_ENTRY (state->search_entry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Erase the search entry."));
- gtk_entry_set_icon_sensitive
- (GTK_ENTRY (state->search_entry),
- GTK_ENTRY_ICON_SECONDARY, TRUE);
- gtk_entry_set_icon_activatable
- (GTK_ENTRY (state->search_entry),
- GTK_ENTRY_ICON_SECONDARY, TRUE);
-
g_signal_connect (G_OBJECT (state->search_entry),
"icon-press",
G_CALLBACK
diff --git a/src/dialogs/dialog-workbook-attr.c b/src/dialogs/dialog-workbook-attr.c
index 3fa6bb5..4466c22 100644
--- a/src/dialogs/dialog-workbook-attr.c
+++ b/src/dialogs/dialog-workbook-attr.c
@@ -162,17 +162,19 @@ attr_dialog_init_protection_page (AttrState *state)
static void
attr_dialog_add_item (AttrState *state, char const *page_name,
- char const *icon_name,
- int page, char const* parent_path)
+ char const *icon_name,
+ int page, char const* parent_path)
{
GtkTreeIter iter, parent;
- GdkPixbuf * icon = NULL;
+ GdkPixbuf *icon = NULL;
- if (icon_name != NULL)
- icon = gtk_widget_render_icon_pixbuf (state->dialog, icon_name,
- GTK_ICON_SIZE_MENU);
- if ((parent_path != NULL) && gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (state->store),
- &parent, parent_path))
+ if (icon_name != NULL) {
+ GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (wbcg_toplevel (state->wbcg)));
+ GtkIconTheme *theme = gtk_icon_theme_get_for_screen (screen);
+ icon = gtk_icon_theme_load_icon (theme, icon_name, 16, 0, NULL);
+ }
+ if (parent_path && gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (state->store),
+ &parent, parent_path))
gtk_tree_store_append (state->store, &iter, &parent);
else
gtk_tree_store_append (state->store, &iter, NULL);
@@ -195,10 +197,10 @@ typedef struct {
} page_info_t;
static page_info_t const page_info[] = {
- {N_("Widgets"), "gnumeric-object-scrollbar", NULL, 0, &attr_dialog_init_widget_page
},
+ {N_("Widgets"), "gnumeric-object-scrollbar", NULL, 0, &attr_dialog_init_widget_page
},
{N_("Protection"), GTK_STOCK_DIALOG_AUTHENTICATION, NULL, 1 ,&attr_dialog_init_protection_page
},
{N_("Auto Completion"), NULL, NULL, 2
,&attr_dialog_init_autocompletion_page },
- {N_("Cell Markers"), NULL, NULL, 3 ,&attr_dialog_init_cell_marker_page
},
+ {N_("Cell Markers"), NULL, NULL, 3 ,&attr_dialog_init_cell_marker_page
},
{NULL, NULL, NULL, -1, NULL},
};
diff --git a/src/dialogs/function-select.ui b/src/dialogs/function-select.ui
index 87a6dc0..41b1ca1 100644
--- a/src/dialogs/function-select.ui
+++ b/src/dialogs/function-select.ui
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
<interface>
- <!-- interface-requires gtk+ 3.0 -->
+ <requires lib="gtk+" version="3.0"/>
<object class="GtkDialog" id="selection_dialog">
<property name="width_request">620</property>
<property name="height_request">550</property>
@@ -22,11 +23,11 @@
<child>
<object class="GtkButton" id="help_button">
<property name="label">gtk-help</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -38,10 +39,10 @@
<child>
<object class="GtkButton" id="close_button">
<property name="label">gtk-close</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -53,11 +54,11 @@
<child>
<object class="GtkButton" id="paste_button">
<property name="label">gtk-paste</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -69,11 +70,11 @@
<child>
<object class="GtkButton" id="cancel_button">
<property name="label">gtk-cancel</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -85,10 +86,10 @@
<child>
<object class="GtkButton" id="ok_button">
<property name="label">gtk-ok</property>
+ <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
<property name="use_stock">True</property>
</object>
<packing>
@@ -122,14 +123,14 @@
<child>
<object class="GtkPaned" id="vpaned1">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
<property name="can_focus">True</property>
<property name="border_width">4</property>
+ <property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="vbox1">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
<property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
<child>
<object class="GtkBox" id="hbox1">
<property name="visible">True</property>
@@ -162,8 +163,8 @@
</child>
<child>
<object class="GtkSeparator" id="vseparator1">
- <property name="orientation">vertical</property>
<property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
</object>
<packing>
<property name="expand">False</property>
@@ -177,6 +178,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
+ <property name="secondary_icon_name">edit-clear</property>
+ <property name="secondary_icon_tooltip_text" translatable="yes">Erase the search
entry.</property>
</object>
<packing>
<property name="expand">True</property>
@@ -190,7 +193,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-find</property>
- <property name="icon-size">2</property>
+ <property name="icon_size">2</property>
</object>
<packing>
<property name="expand">False</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]