Author: cazfi
Date: Sat Apr  1 11:20:07 2017
New Revision: 35176

URL: http://svn.gna.org/viewcvs/freeciv?rev=35176&view=rev
Log:
Replace gtk_button_set_image() with modern constructs

See hrm Feature #647930

Modified:
    trunk/client/gui-gtk-4.0/chatline.c
    trunk/client/gui-gtk-4.0/editprop.c
    trunk/client/gui-gtk-4.0/gui_stuff.c
    trunk/client/gui-gtk-4.0/voteinfo_bar.c

Modified: trunk/client/gui-gtk-4.0/chatline.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-4.0/chatline.c?rev=35176&r1=35175&r2=35176&view=diff
==============================================================================
--- trunk/client/gui-gtk-4.0/chatline.c (original)
+++ trunk/client/gui-gtk-4.0/chatline.c Sat Apr  1 11:20:07 2017
@@ -1442,8 +1442,7 @@
   button = gtk_toggle_button_new();
   g_object_set(button, "margin", 2, NULL);
   gtk_container_add(GTK_CONTAINER(hbox), button);
-  gtk_button_set_image(GTK_BUTTON(button),
-                       gtk_image_new_from_icon_name("gtk-edit", 0));
+  gtk_button_set_icon_name(GTK_BUTTON(button), "gtk-edit");
   g_signal_connect(button, "toggled", G_CALLBACK(button_toggled), &toolkit);
   gtk_widget_set_tooltip_text(GTK_WIDGET(button), _("Chat tools"));
   toolkit.toggle_button = button;

Modified: trunk/client/gui-gtk-4.0/editprop.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-4.0/editprop.c?rev=35176&r1=35175&r2=35176&view=diff
==============================================================================
--- trunk/client/gui-gtk-4.0/editprop.c (original)
+++ trunk/client/gui-gtk-4.0/editprop.c Sat Apr  1 11:20:07 2017
@@ -4727,7 +4727,7 @@
   struct property_page *pp;
   GtkWidget *vbox, *vbox2, *hbox, *hbox2, *paned, *frame, *w;
   GtkWidget *scrollwin, *view, *label, *entry, *notebook;
-  GtkWidget *button, *hsep, *image;
+  GtkWidget *button, *hsep;
   GtkTreeSelection *sel;
   GtkCellRenderer *cell;
   GtkTreeViewColumn *col;
@@ -4859,8 +4859,7 @@
     gtk_container_add(GTK_CONTAINER(vbox), hbox);
 
     button = gtk_button_new();
-    image = gtk_image_new_from_icon_name("list-add", GTK_ICON_SIZE_BUTTON);
-    gtk_button_set_image(GTK_BUTTON(button), image);
+    gtk_button_set_icon_name(GTK_BUTTON(button), "list-add");
     gtk_button_set_label(GTK_BUTTON(button), _("Create"));
     gtk_size_group_add_widget(sizegroup, button);
     gtk_widget_set_tooltip_text(button,
@@ -4875,9 +4874,7 @@
     gtk_container_add(GTK_CONTAINER(hbox), button);
 
     button = gtk_button_new();
-    image = gtk_image_new_from_icon_name("list-remove",
-                                         GTK_ICON_SIZE_BUTTON);
-    gtk_button_set_image(GTK_BUTTON(button), image);
+    gtk_button_set_icon_name(GTK_BUTTON(button), "list-remove");
     gtk_button_set_label(GTK_BUTTON(button), _("Destroy"));
     gtk_size_group_add_widget(sizegroup, button);
     gtk_widget_set_tooltip_text(button,

Modified: trunk/client/gui-gtk-4.0/gui_stuff.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-4.0/gui_stuff.c?rev=35176&r1=35175&r2=35176&view=diff
==============================================================================
--- trunk/client/gui-gtk-4.0/gui_stuff.c        (original)
+++ trunk/client/gui-gtk-4.0/gui_stuff.c        Sat Apr  1 11:20:07 2017
@@ -77,13 +77,11 @@
                                  const gchar *label_text)
 {
   GtkWidget *button;
-  GtkWidget *image;
 
   button = gtk_button_new_with_mnemonic(label_text);
 
   if (icon_name != NULL) {
-    image = gtk_image_new_from_icon_name(icon_name, GTK_ICON_SIZE_BUTTON);
-    gtk_button_set_image(GTK_BUTTON(button), image);
+    gtk_button_set_icon_name(GTK_BUTTON(button), icon_name);
   }
 
   return button;
@@ -578,7 +576,7 @@
     break;
   case GUI_DIALOG_TAB:
     {
-      GtkWidget *hbox, *label, *image, *button, *event_box;
+      GtkWidget *hbox, *label, *button, *event_box;
       gint w, h;
       gchar *buf;
 
@@ -604,12 +602,7 @@
       gtk_widget_set_tooltip_text(button, buf);
       g_free(buf);
 
-      image = gtk_image_new_from_icon_name("window-close", GTK_ICON_SIZE_MENU);
-      gtk_widget_set_margin_start(image, 0);
-      gtk_widget_set_margin_end(image, 0);
-      gtk_widget_set_margin_top(image, 0);
-      gtk_widget_set_margin_bottom(image, 0);
-      gtk_button_set_image(GTK_BUTTON(button), image);
+      gtk_button_set_icon_name(GTK_BUTTON(button), "window-close");
 
       gtk_container_add(GTK_CONTAINER(hbox), button);
 

Modified: trunk/client/gui-gtk-4.0/voteinfo_bar.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-4.0/voteinfo_bar.c?rev=35176&r1=35175&r2=35176&view=diff
==============================================================================
--- trunk/client/gui-gtk-4.0/voteinfo_bar.c     (original)
+++ trunk/client/gui-gtk-4.0/voteinfo_bar.c     Sat Apr  1 11:20:07 2017
@@ -91,7 +91,7 @@
 **************************************************************************/
 GtkWidget *voteinfo_bar_new(bool split_bar)
 {
-  GtkWidget *label, *button, *vbox, *hbox, *arrow;
+  GtkWidget *label, *button, *vbox, *hbox;
   struct voteinfo_bar *vib;
   const int BUTTON_HEIGHT = 12;
 
@@ -131,11 +131,6 @@
   gtk_widget_set_name(label, "vote label");
   vib->label = label;
 
-  arrow = gtk_image_new_from_icon_name("media-seek-backward",
-                                       GTK_ICON_SIZE_SMALL_TOOLBAR);
-  gtk_widget_set_halign(arrow, GTK_ALIGN_CENTER);
-  gtk_widget_set_valign(arrow, GTK_ALIGN_START);
-
   if (split_bar) {
     hbox = gtk_grid_new();
     gtk_grid_set_column_spacing(GTK_GRID(hbox), 4);
@@ -146,7 +141,7 @@
   gtk_widget_set_margin_end(button, 16);
   g_signal_connect(button, "clicked",
                    G_CALLBACK(voteinfo_bar_next_callback), NULL);
-  gtk_button_set_image(GTK_BUTTON(button), arrow);
+  gtk_button_set_icon_name(GTK_BUTTON(button), "media-seek-backward");
   gtk_widget_set_size_request(button, -1, BUTTON_HEIGHT);
   gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
   gtk_widget_set_focus_on_click(button, FALSE);


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to