Merge branch 'wip/exalm/image-button' into 'master'

Ensure consistent header bar buttons in the demo and tests

See merge request GNOME/gtk!3537
This commit is contained in:
Matthias Clasen 2021-05-09 23:06:25 +00:00
commit 1601e204f4
8 changed files with 14 additions and 29 deletions

View File

@ -13,13 +13,13 @@
</style>
<child>
<object class="GtkButton">
<property name="icon-name">pan-start-symbolic</property>
<property name="icon-name">go-previous-symbolic</property>
<signal name="clicked" handler="fishbowl_prev_button_clicked_cb" object="bowl" swapped="no"/>
</object>
</child>
<child>
<object class="GtkButton">
<property name="icon-name">pan-end-symbolic</property>
<property name="icon-name">go-next-symbolic</property>
<signal name="clicked" handler="fishbowl_next_button_clicked_cb" object="bowl" swapped="no"/>
</object>
</child>

View File

@ -10,12 +10,8 @@
<object class="GtkButton" id="reset">
<property name="receives-default">1</property>
<property name="tooltip-text">Reset</property>
<property name="icon-name">view-refresh-symbolic</property>
<signal name="clicked" handler="font_features_reset_features" swapped="no"/>
<child>
<object class="GtkImage">
<property name="icon-name">view-refresh-symbolic</property>
</object>
</child>
</object>
</child>
</object>

View File

@ -18,8 +18,6 @@ do_headerbar (GtkWidget *do_widget)
GtkWidget *header;
GtkWidget *button;
GtkWidget *box;
GtkWidget *image;
GIcon *icon;
if (!window)
{
@ -32,20 +30,14 @@ do_headerbar (GtkWidget *do_widget)
header = gtk_header_bar_new ();
button = gtk_button_new ();
icon = g_themed_icon_new ("mail-send-receive-symbolic");
image = gtk_image_new_from_gicon (icon);
g_object_unref (icon);
gtk_button_set_child (GTK_BUTTON (button), image);
button = gtk_button_new_from_icon_name ("mail-send-receive-symbolic");
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_add_css_class (box, "linked");
button = gtk_button_new ();
gtk_button_set_child (GTK_BUTTON (button), gtk_image_new_from_icon_name ("pan-start-symbolic"));
button = gtk_button_new_from_icon_name ("go-previous-symbolic");
gtk_box_append (GTK_BOX (box), button);
button = gtk_button_new ();
gtk_button_set_child (GTK_BUTTON (button), gtk_image_new_from_icon_name ("pan-end-symbolic"));
button = gtk_button_new_from_icon_name ("go-next-symbolic");
gtk_box_append (GTK_BOX (box), button);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), box);

View File

@ -13,13 +13,13 @@
</style>
<child>
<object class="GtkButton">
<property name="icon-name">pan-start-symbolic</property>
<property name="icon-name">go-previous-symbolic</property>
<signal name="clicked" handler="iconscroll_prev_clicked_cb"/>
</object>
</child>
<child>
<object class="GtkButton">
<property name="icon-name">pan-end-symbolic</property>
<property name="icon-name">go-next-symbolic</property>
<signal name="clicked" handler="iconscroll_next_clicked_cb"/>
</object>
</child>

View File

@ -2606,12 +2606,12 @@ microphone-sensitivity-medium-symbolic</property>
</style>
<child>
<object class="GtkButton">
<property name="icon-name">pan-start-symbolic</property>
<property name="icon-name">go-previous-symbolic</property>
</object>
</child>
<child>
<object class="GtkButton">
<property name="icon-name">pan-end-symbolic</property>
<property name="icon-name">go-next-symbolic</property>
</object>
</child>
</object>

View File

@ -439,7 +439,6 @@ change_header (GtkButton *button, gpointer data)
GtkWidget *window = GTK_WIDGET (data);
GtkWidget *label;
GtkWidget *widget;
GtkWidget *image;
GtkWidget *header;
if (button && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
@ -470,10 +469,8 @@ change_header (GtkButton *button, gpointer data)
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), widget);
widget= gtk_button_new ();
image = gtk_image_new_from_icon_name ("bookmark-new-symbolic");
widget= gtk_button_new_from_icon_name ("bookmark-new-symbolic");
g_signal_connect (widget, "clicked", G_CALLBACK (on_bookmark_clicked), window);
gtk_button_set_child (GTK_BUTTON (widget), image);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), widget);
}

View File

@ -30,13 +30,13 @@
</style>
<child>
<object class="GtkButton">
<property name="label">&lt;</property>
<property name="icon-name">go-previous-symbolic</property>
<property name="valign">center</property>
</object>
</child>
<child>
<object class="GtkButton">
<property name="label">&gt;</property>
<property name="icon-name">go-next-symbolic</property>
<property name="valign">center</property>
</object>
</child>

View File

@ -32,7 +32,7 @@
<object class="GtkHeaderBar">
<child type="start">
<object class="GtkButton" id="back_btn">
<property name="label">&lt;</property>
<property name="icon-name">go-previous-symbolic</property>
<property name="valign">center</property>
</object>
</child>