[gnumeric] Manage Sheet: fix icon handling.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Manage Sheet: fix icon handling.
- Date: Fri, 2 Jan 2015 00:05:27 +0000 (UTC)
commit 088e3296cceec94b199081650eb59118f24ff389
Author: Morten Welinder <terra gnome org>
Date: Thu Jan 1 19:04:49 2015 -0500
Manage Sheet: fix icon handling.
And avoid a pile of deprecated gtk functions in the process.
src/dialogs/ChangeLog | 2 ++
src/dialogs/dialog-sheet-order.c | 31 ++++++++++++++++---------------
2 files changed, 18 insertions(+), 15 deletions(-)
---
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 6422e19..e86c436 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,5 +1,7 @@
2015-01-01 Morten Welinder <terra gnome org>
+ * dialog-sheet-order.c (dialog_sheet_order): Fix icon handling.
+
* dialog-about.c (dialog_about): Update copyright.
2014-12-29 Morten Welinder <terra gnome org>
diff --git a/src/dialogs/dialog-sheet-order.c b/src/dialogs/dialog-sheet-order.c
index 2f92b4f..3ce787e 100644
--- a/src/dialogs/dialog-sheet-order.c
+++ b/src/dialogs/dialog-sheet-order.c
@@ -1426,6 +1426,14 @@ destroy_cb (GObject *obj)
g_object_set_data (obj, "state", NULL);
}
+static GdkPixbuf *
+get_icon (GtkWidget *widget, const char *icon_name)
+{
+ GdkScreen *screen = gtk_widget_get_screen (widget);
+ GtkIconTheme *theme = gtk_icon_theme_get_for_screen (screen);
+ return gtk_icon_theme_load_icon (theme, icon_name, 16, 0, NULL);
+}
+
void
dialog_sheet_order (WBCGtk *wbcg)
{
@@ -1434,9 +1442,12 @@ dialog_sheet_order (WBCGtk *wbcg)
GtkGrid *grid;
GOColorGroup *cg;
Workbook *wb;
+ GtkWidget *widget;
g_return_if_fail (wbcg != NULL);
+ widget = GTK_WIDGET (wbcg_toplevel (wbcg));
+
gui = gnm_gtk_builder_load ("sheet-order.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (gui == NULL)
return;
@@ -1472,21 +1483,11 @@ dialog_sheet_order (WBCGtk *wbcg)
state->cancel_btn = go_gtk_builder_get_widget (gui, "cancel_button");
state->advanced_check = go_gtk_builder_get_widget (gui, "advanced-check");
state->initial_colors_set = FALSE;
- state->image_padlock = gtk_widget_render_icon_pixbuf (state->dialog,
- "gnumeric-protection-yes",
- GTK_ICON_SIZE_LARGE_TOOLBAR);
- state->image_padlock_no = gtk_widget_render_icon_pixbuf (state->dialog,
- "gnumeric-protection-no",
- GTK_ICON_SIZE_LARGE_TOOLBAR);
- state->image_visible = gtk_widget_render_icon_pixbuf (state->dialog,
- "gnumeric-visible",
- GTK_ICON_SIZE_LARGE_TOOLBAR);
- state->image_ltr = gtk_widget_render_icon_pixbuf (state->dialog,
- "gtk-go-forward",
- GTK_ICON_SIZE_LARGE_TOOLBAR);
- state->image_rtl = gtk_widget_render_icon_pixbuf (state->dialog,
- "gtk-go-back",
- GTK_ICON_SIZE_LARGE_TOOLBAR);
+ state->image_padlock = get_icon (widget, "gnumeric-protection-yes");
+ state->image_padlock_no = get_icon (widget, "gnumeric-protection-no");
+ state->image_visible = get_icon (widget, "gnumeric-visible");
+ state->image_ltr = get_icon (widget, "format-text-direction-ltr");
+ state->image_rtl = get_icon (widget, "format-text-direction-rtl");
/* Listen for changes in the sheet order. */
state->sheet_order_changed_listener = g_signal_connect (G_OBJECT (wb),
"sheet_order_changed", G_CALLBACK (cb_sheet_order_changed),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]