[gnome-software: 82/110] gs-shell: Cleanup primary menu image
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 82/110] gs-shell: Cleanup primary menu image
- Date: Tue, 5 Oct 2021 20:32:42 +0000 (UTC)
commit e096ca832ca38e55b825a23ae4fc8966ef4bde5a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Aug 26 08:32:57 2021 -0300
gs-shell: Cleanup primary menu image
GTK4 overrides the button child when setting a menu, so simply
suggest an icon name and let GTK4 figure it all out for us.
src/gs-details-page.c | 8 ++++----
src/gs-details-page.ui | 27 +--------------------------
src/gs-shell.ui | 9 ++-------
3 files changed, 7 insertions(+), 37 deletions(-)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index 513f47086..198400b8d 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -138,7 +138,7 @@ struct _GsDetailsPage
GtkWidget *origin_popover;
GtkWidget *origin_popover_list_box;
GtkWidget *origin_box;
- GtkWidget *origin_button_label;
+ GtkWidget *origin_button;
GtkWidget *box_license;
GsLicenseTile *license_tile;
GtkInfoBar *translation_infobar;
@@ -295,9 +295,9 @@ gs_details_page_update_origin_button (GsDetailsPage *self,
origin_ui = gs_app_get_origin_ui (self->app);
if (origin_ui != NULL)
- gtk_label_set_text (GTK_LABEL (self->origin_button_label), origin_ui);
+ gtk_menu_button_set_label (GTK_MENU_BUTTON (self->origin_button), origin_ui);
else
- gtk_label_set_text (GTK_LABEL (self->origin_button_label), "");
+ gtk_menu_button_set_label (GTK_MENU_BUTTON (self->origin_button), "");
gtk_widget_set_sensitive (self->origin_box, sensitive);
gtk_widget_show (self->origin_box);
@@ -2302,7 +2302,7 @@ gs_details_page_class_init (GsDetailsPageClass *klass)
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, origin_popover);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, origin_popover_list_box);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, origin_box);
- gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, origin_button_label);
+ gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, origin_button);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_license);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, license_tile);
gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, translation_infobar);
diff --git a/src/gs-details-page.ui b/src/gs-details-page.ui
index ff12dcbb7..9a157c410 100644
--- a/src/gs-details-page.ui
+++ b/src/gs-details-page.ui
@@ -1054,33 +1054,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="sensitive">True</property>
+ <property name="always-show-arrow">True</property>
<property name="popover">origin_popover</property>
- <child>
- <object class="GtkGrid">
- <property name="column-spacing">12</property>
- <property name="visible">1</property>
- <property name="valign">GTK_ALIGN_CENTER</property>
- <child>
- <object class="GtkLabel" id="origin_button_label">
- <property name="ellipsize">end</property>
- <property name="label"></property>
- <property name="max_width_chars">20</property>
- <property name="valign">GTK_ALIGN_CENTER</property>
- <property name="visible">1</property>
- <property name="xalign">0</property>
- <property name="width_chars">10</property>
- </object>
- </child>
- <child>
- <object class="GtkImage">
- <property name="icon-name">pan-down-symbolic</property>
- <property name="pixel-size">16</property>
- <property name="valign">GTK_ALIGN_CENTER</property>
- <property name="visible">1</property>
- </object>
- </child>
- </object>
- </child>
</object>
</child>
</object>
diff --git a/src/gs-shell.ui b/src/gs-shell.ui
index 5615a6111..43dcfb322 100644
--- a/src/gs-shell.ui
+++ b/src/gs-shell.ui
@@ -211,17 +211,12 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="sensitive">True</property>
+ <property name="primary">True</property>
+ <property name="icon_name">open-menu-symbolic</property>
<property name="menu_model">primary_menu</property>
<accessibility>
<property name="label" translatable="yes">Primary
Menu</property>
</accessibility>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon_name">open-menu-symbolic</property>
- <property name="icon-size">normal</property>
- </object>
- </child>
<style>
<class name="image-button"/>
</style>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]