The "window" and "style" arguments for replace_button_icon() are now unused. Remove them and refactor the function accordingly.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -1100,21 +1100,17 @@ static void fixup_rootmenu(struct menu *menu) · 1099 unmodified lines | ||
| 1100 | 1100 | } |
| 1101 | 1101 | |
| 1102 | 1102 | /* Main Window Initialization */ |
| 1103 | −static void replace_button_icon(GladeXML *xml, GdkDrawable *window, | |
| 1104 | − GtkStyle *style, gchar *btn_name, gchar **xpm) | |
| 1103 | +static void replace_button_icon(GtkWidget *widget, const char * const xpm[]) | |
| 1105 | 1104 | { |
| 1106 | 1105 | GdkPixbuf *pixbuf; |
| 1107 | 1106 | GtkWidget *image; |
| 1108 | − GtkToolButton *button; | |
| 1109 | 1107 | |
| 1110 | 1108 | pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)xpm); |
| 1111 | 1109 | image = gtk_image_new_from_pixbuf(pixbuf); |
| 1112 | 1110 | g_object_unref(pixbuf); |
| 1113 | 1111 | |
| 1114 | − button = GTK_TOOL_BUTTON(glade_xml_get_widget(xml, btn_name)); | |
| 1115 | − | |
| 1116 | 1112 | gtk_widget_show(image); |
| 1117 | − gtk_tool_button_set_icon_widget(button, image); | |
| 1113 | + gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(widget), image); | |
| 1118 | 1114 | } |
| 1119 | 1115 | |
| 1120 | 1116 | static void init_main_window(const gchar *glade_file) |
| @@ -1122,7 +1118,6 @@ static void init_main_window(const gchar *glade_file) · 1 unmodified line | ||
| 1122 | 1118 | GladeXML *xml; |
| 1123 | 1119 | GtkWidget *widget; |
| 1124 | 1120 | GtkTextBuffer *txtbuf; |
| 1125 | − GtkStyle *style; | |
| 1126 | 1121 | |
| 1127 | 1122 | xml = glade_xml_new(glade_file, "window1", NULL); |
| 1128 | 1123 | if (!xml) |
| @@ -1229,25 +1224,20 @@ static void init_main_window(const gchar *glade_file) · 100 unmodified lines | ||
| 1229 | 1224 | g_signal_connect(save_btn, "clicked", |
| 1230 | 1225 | G_CALLBACK(on_save_clicked), NULL); |
| 1231 | 1226 | |
| 1232 | − style = gtk_widget_get_style(main_wnd); | |
| 1233 | − | |
| 1234 | 1227 | single_btn = glade_xml_get_widget(xml, "button4"); |
| 1235 | 1228 | g_signal_connect(single_btn, "clicked", |
| 1236 | 1229 | G_CALLBACK(on_single_clicked), NULL); |
| 1237 | − replace_button_icon(xml, main_wnd->window, style, | |
| 1238 | − "button4", (gchar **) xpm_single_view); | |
| 1230 | + replace_button_icon(single_btn, xpm_single_view); | |
| 1239 | 1231 | |
| 1240 | 1232 | split_btn = glade_xml_get_widget(xml, "button5"); |
| 1241 | 1233 | g_signal_connect(split_btn, "clicked", |
| 1242 | 1234 | G_CALLBACK(on_split_clicked), NULL); |
| 1243 | − replace_button_icon(xml, main_wnd->window, style, | |
| 1244 | − "button5", (gchar **) xpm_split_view); | |
| 1235 | + replace_button_icon(split_btn, xpm_split_view); | |
| 1245 | 1236 | |
| 1246 | 1237 | full_btn = glade_xml_get_widget(xml, "button6"); |
| 1247 | 1238 | g_signal_connect(full_btn, "clicked", |
| 1248 | 1239 | G_CALLBACK(on_full_clicked), NULL); |
| 1249 | − replace_button_icon(xml, main_wnd->window, style, | |
| 1250 | − "button6", (gchar **) xpm_tree_view); | |
| 1240 | + replace_button_icon(full_btn, xpm_tree_view); | |
| 1251 | 1241 | |
| 1252 | 1242 | widget = glade_xml_get_widget(xml, "button7"); |
| 1253 | 1243 | g_signal_connect(widget, "clicked", |