network: unfuzzy symbolic buttons and make them square

Use the 'image-button' style class to make symbolic buttons square
(as supported by latest Adwaita), and make sure to use the correct icon
size for all symbolics to avoid fuzzyness.

https://bugzilla.gnome.org/show_bug.cgi?id=693357
This commit is contained in:
Cosimo Cecchi 2013-02-07 16:23:54 -05:00
parent 2acd6a5303
commit 0969b36a65
6 changed files with 16 additions and 0 deletions

View file

@ -212,6 +212,7 @@ add_address_row (CEPageIP4 *page,
gtk_grid_attach (GTK_GRID (row), widget, 2, 3, 1, 1);
delete_button = gtk_button_new ();
gtk_style_context_add_class (gtk_widget_get_style_context (delete_button), "image-button");
g_signal_connect (delete_button, "clicked", G_CALLBACK (remove_row), page);
image = gtk_image_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
gtk_button_set_image (GTK_BUTTON (delete_button), image);
@ -341,6 +342,7 @@ add_dns_row (CEPageIP4 *page,
gtk_box_pack_start (GTK_BOX (row), widget, TRUE, TRUE, 0);
delete_button = gtk_button_new ();
gtk_style_context_add_class (gtk_widget_get_style_context (delete_button), "image-button");
g_signal_connect (delete_button, "clicked", G_CALLBACK (remove_row), page);
image = gtk_image_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
gtk_button_set_image (GTK_BUTTON (delete_button), image);
@ -465,6 +467,7 @@ add_route_row (CEPageIP4 *page,
gtk_grid_attach (GTK_GRID (row), widget, 2, 4, 1, 1);
delete_button = gtk_button_new ();
gtk_style_context_add_class (gtk_widget_get_style_context (delete_button), "image-button");
g_signal_connect (delete_button, "clicked", G_CALLBACK (remove_row), page);
image = gtk_image_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
gtk_button_set_image (GTK_BUTTON (delete_button), image);

View file

@ -214,6 +214,7 @@ add_address_row (CEPageIP6 *page,
gtk_grid_attach (GTK_GRID (row), widget, 2, 3, 1, 1);
delete_button = gtk_button_new ();
gtk_style_context_add_class (gtk_widget_get_style_context (delete_button), "image-button");
g_signal_connect (delete_button, "clicked", G_CALLBACK (remove_row), page);
image = gtk_image_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
gtk_button_set_image (GTK_BUTTON (delete_button), image);
@ -345,6 +346,7 @@ add_dns_row (CEPageIP6 *page,
gtk_box_pack_start (GTK_BOX (row), widget, TRUE, TRUE, 0);
delete_button = gtk_button_new ();
gtk_style_context_add_class (gtk_widget_get_style_context (delete_button), "image-button");
g_signal_connect (delete_button, "clicked", G_CALLBACK (remove_row), page);
image = gtk_image_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
gtk_button_set_image (GTK_BUTTON (delete_button), image);
@ -473,6 +475,7 @@ add_route_row (CEPageIP6 *page,
gtk_grid_attach (GTK_GRID (row), widget, 2, 4, 1, 1);
delete_button = gtk_button_new ();
gtk_style_context_add_class (gtk_widget_get_style_context (delete_button), "image-button");
g_signal_connect (delete_button, "clicked", G_CALLBACK (remove_row), page);
image = gtk_image_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
gtk_button_set_image (GTK_BUTTON (delete_button), image);

View file

@ -334,6 +334,7 @@ add_row (NetDeviceEthernet *device, NMConnection *connection)
image = gtk_image_new_from_icon_name ("emblem-system-symbolic", GTK_ICON_SIZE_MENU);
gtk_widget_show (image);
widget = gtk_button_new ();
gtk_style_context_add_class (gtk_widget_get_style_context (widget), "image-button");
gtk_widget_set_margin_left (widget, 12);
gtk_widget_set_margin_right (widget, 12);
gtk_widget_set_margin_top (widget, 12);

View file

@ -1532,6 +1532,7 @@ make_row (GtkSizeGroup *rows,
image = gtk_image_new_from_icon_name ("emblem-system-symbolic", GTK_ICON_SIZE_MENU);
gtk_widget_show (image);
widget = gtk_button_new ();
gtk_style_context_add_class (gtk_widget_get_style_context (widget), "image-button");
gtk_widget_set_no_show_all (widget, TRUE);
if (!connecting)
gtk_widget_show (widget);

View file

@ -5,6 +5,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">emblem-system-symbolic</property>
<property name="icon_size">1</property>
</object>
<object class="GtkWindow" id="window_tmp">
<property name="can_focus">False</property>
@ -194,6 +195,9 @@
<property name="receives_default">True</property>
<property name="halign">end</property>
<property name="image">image1</property>
<style>
<class name="image-button"/>
</style>
</object>
<packing>
<property name="expand">True</property>

View file

@ -322,11 +322,15 @@
<property name="vexpand">True</property>
<property name="use_underline">True</property>
<property name="xalign">1</property>
<style>
<class name="image-button"/>
</style>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">emblem-system-symbolic</property>
<property name="icon_size">1</property>
</object>
</child>
</object>