[gnome-software/bilelmoussaoui/no-frame] ui: stop using GtkFrame




commit 02682306e035ae4aa9187e06385be38d5f501dd1
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Tue Mar 2 12:28:08 2021 +0100

    ui: stop using GtkFrame
    
    This replace GtkFrame with a css class from libhandy
    which also removes the double border you can see sometimes

 src/gs-app-version-history-dialog.ui | 24 ++++------
 src/gs-details-page.c                |  4 +-
 src/gs-details-page.ui               | 91 ++++++++++++++++--------------------
 src/gs-history-dialog.ui             | 20 +++-----
 src/gs-removal-dialog.ui             | 15 +++---
 src/gs-repos-dialog.c                | 10 ++--
 src/gs-repos-dialog.ui               | 29 ++++--------
 src/gs-update-dialog.ui              | 14 ++----
 8 files changed, 78 insertions(+), 129 deletions(-)
---
diff --git a/src/gs-app-version-history-dialog.ui b/src/gs-app-version-history-dialog.ui
index 062b4d6f5..ede850ad2 100644
--- a/src/gs-app-version-history-dialog.ui
+++ b/src/gs-app-version-history-dialog.ui
@@ -25,23 +25,17 @@
                 <property name="visible">True</property>
                 <property name="vexpand">True</property>
                 <property name="hexpand">False</property>
+                <property name="margin-start">12</property>
+                <property name="margin-end">12</property>
+                <property name="margin-bottom">18</property>
+                <property name="margin-top">18</property>
                 <child>
-                  <object class="GtkFrame">
+                  <object class="GtkListBox" id="listbox">
                     <property name="visible">True</property>
-                    <property name="shadow_type">none</property>
-                    <property name="margin-start">12</property>
-                    <property name="margin-end">12</property>
-                    <property name="margin-bottom">18</property>
-                    <property name="margin-top">18</property>
-                    <child>
-                      <object class="GtkListBox" id="listbox">
-                        <property name="visible">True</property>
-                        <property name="selection-mode">none</property>
-                        <style>
-                          <class name="content"/>
-                        </style>
-                      </object>
-                    </child>
+                    <property name="selection-mode">none</property>
+                    <style>
+                      <class name="content"/>
+                    </style>
                   </object>
                 </child>
               </object>
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index 5e61cb12f..29ca9ae13 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -120,7 +120,6 @@ struct _GsDetailsPage
        GtkWidget               *label_licenses_intro;
        GtkWidget               *list_box_addons;
        GtkWidget               *list_box_version_history;
-       GtkWidget               *box_version_history_frame;
        GtkWidget               *row_latest_version;
        GtkWidget               *version_history_button;
        GtkWidget               *box_reviews;
@@ -1208,7 +1207,7 @@ gs_details_page_refresh_all (GsDetailsPage *self)
        if (version_history == NULL) {
                const char *version = gs_app_get_version (self->app);
                if (version == NULL || *version == '\0')
-                       gtk_widget_set_visible (self->box_version_history_frame, FALSE);
+                       gtk_widget_set_visible (self->list_box_version_history, FALSE);
                else
                        gs_app_version_history_row_set_info (GS_APP_VERSION_HISTORY_ROW 
(self->row_latest_version),
                                                             version, gs_app_get_release_date (self->app), 
NULL);
@@ -2902,7 +2901,6 @@ gs_details_page_class_init (GsDetailsPageClass *klass)
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, label_failed);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, list_box_addons);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, list_box_version_history);
-       gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_version_history_frame);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, row_latest_version);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, version_history_button);
        gtk_widget_class_bind_template_child (widget_class, GsDetailsPage, box_reviews);
diff --git a/src/gs-details-page.ui b/src/gs-details-page.ui
index c60da937c..6ecc935a9 100644
--- a/src/gs-details-page.ui
+++ b/src/gs-details-page.ui
@@ -139,13 +139,13 @@
                                 <child>
                                   <object class="GtkEventBox" id="star_eventbox">
                                     <property name="visible">True</property>
-                                      <child>
-                                  <object class="GsStarWidget" id="star">
-                                    <property name="visible">True</property>
-                                    <property name="halign">start</property>
-                                    <property name="valign">center</property>
-                                  </object>
-                                </child>
+                                    <child>
+                                      <object class="GsStarWidget" id="star">
+                                        <property name="visible">True</property>
+                                        <property name="halign">start</property>
+                                        <property name="valign">center</property>
+                                      </object>
+                                    </child>
                                   </object>
                                 </child>
                                 <child>
@@ -424,69 +424,56 @@
                                 </child>
                               </object>
                             </child>
-
                             <child>
-                              <object class="GtkFrame" id="box_addons_frame">
+                              <object class="GtkListBox" id="list_box_addons">
                                 <property name="visible">True</property>
-                                <property name="shadow_type">none</property>
+                                <property name="selection_mode">none</property>
                                 <property name="halign">fill</property>
                                 <property name="valign">start</property>
-                                <child>
-                                  <object class="GtkListBox" id="list_box_addons">
-                                    <property name="visible">True</property>
-                                    <property name="selection_mode">none</property>
-                                    <style>
-                                      <class name="content"/>
-                                    </style>
-                                  </object>
-                                </child>
+                                <style>
+                                  <class name="content"/>
+                                </style>
                               </object>
                             </child>
                           </object>
                         </child>
                         <child>
-                          <object class="GtkFrame" id="box_version_history_frame">
+                          <object class="GtkListBox" id="list_box_version_history">
                             <property name="visible">True</property>
-                            <property name="shadow_type">none</property>
+                            <property name="selection_mode">none</property>
                             <property name="halign">fill</property>
                             <property name="valign">start</property>
+                            <style>
+                              <class name="content"/>
+                            </style>
+                            <child>
+                              <object class="GsAppVersionHistoryRow" id="row_latest_version">
+                              </object>
+                            </child>
                             <child>
-                              <object class="GtkListBox" id="list_box_version_history">
+                              <object class="GtkListBoxRow" id="version_history_button">
                                 <property name="visible">True</property>
-                                <property name="selection_mode">none</property>
-                                <style>
-                                  <class name="content"/>
-                                </style>
-                                <child>
-                                  <object class="GsAppVersionHistoryRow" id="row_latest_version">
-                                  </object>
-                                </child>
+                                <property name="can_focus">True</property>
                                 <child>
-                                  <object class="GtkListBoxRow" id="version_history_button">
+                                  <object class="GtkBox">
                                     <property name="visible">True</property>
-                                    <property name="can_focus">True</property>
+                                    <property name="orientation">horizontal</property>
+                                    <property name="halign">center</property>
+                                    <property name="margin_top">12</property>
+                                    <property name="margin_bottom">12</property>
+                                    <child>
+                                      <object class="GtkLabel">
+                                        <property name="visible">True</property>
+                                        <property name="xalign">0</property>
+                                        <property name="yalign">0.5</property>
+                                        <property name="label" translatable="yes">Version History</property>
+                                      </object>
+                                    </child>
                                     <child>
-                                      <object class="GtkBox">
+                                      <object class="GtkImage">
                                         <property name="visible">True</property>
-                                        <property name="orientation">horizontal</property>
-                                        <property name="halign">center</property>
-                                        <property name="margin_top">12</property>
-                                        <property name="margin_bottom">12</property>
-                                        <child>
-                                          <object class="GtkLabel">
-                                            <property name="visible">True</property>
-                                            <property name="xalign">0</property>
-                                            <property name="yalign">0.5</property>
-                                            <property name="label" translatable="yes">Version 
History</property>
-                                          </object>
-                                        </child>
-                                        <child>
-                                          <object class="GtkImage">
-                                            <property name="visible">True</property>
-                                            <property name="icon-name">go-next-symbolic</property>
-                                            <property name="margin_start">6</property>
-                                          </object>
-                                        </child>
+                                        <property name="icon-name">go-next-symbolic</property>
+                                        <property name="margin_start">6</property>
                                       </object>
                                     </child>
                                   </object>
diff --git a/src/gs-history-dialog.ui b/src/gs-history-dialog.ui
index 942e2a55c..b8b585b51 100644
--- a/src/gs-history-dialog.ui
+++ b/src/gs-history-dialog.ui
@@ -23,22 +23,14 @@
             <property name="vscrollbar_policy">automatic</property>
             <property name="vexpand">True</property>
             <child>
-              <object class="GtkFrame" id="frame">
+              <object class="GtkListBox" id="list_box">
                 <property name="visible">True</property>
-                <property name="shadow_type">none</property>
-                <property name="halign">fill</property>
-                <property name="valign">start</property>
-                <style>
-                  <class name="view"/>
-                </style>
-                <child>
-                  <object class="GtkListBox" id="list_box">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="selection_mode">none</property>
-                  </object>
-                </child>
+                <property name="can_focus">True</property>
+                <property name="selection_mode">none</property>
               </object>
+              <style>
+                <class name="content" />
+              </style>
             </child>
           </object>
         </child>
diff --git a/src/gs-removal-dialog.ui b/src/gs-removal-dialog.ui
index 3d03c755f..cbba2c893 100644
--- a/src/gs-removal-dialog.ui
+++ b/src/gs-removal-dialog.ui
@@ -8,17 +8,14 @@
     <property name="vscrollbar_policy">automatic</property>
     <property name="shadow_type">none</property>
     <child>
-      <object class="GtkFrame" id="frame">
-        <property name="visible">True</property>
-        <property name="shadow_type">in</property>
+      <object class="GtkListBox" id="listbox">
         <property name="halign">fill</property>
         <property name="valign">start</property>
-        <child>
-          <object class="GtkListBox" id="listbox">
-            <property name="visible">True</property>
-            <property name="selection_mode">none</property>
-          </object>
-        </child>
+        <property name="visible">True</property>
+        <property name="selection_mode">none</property>
+        <style>
+          <class name="content" />
+        </style>
       </object>
     </child>
   </object>
diff --git a/src/gs-repos-dialog.c b/src/gs-repos-dialog.c
index 2389313d4..9e764e507 100644
--- a/src/gs-repos-dialog.c
+++ b/src/gs-repos-dialog.c
@@ -28,8 +28,6 @@ struct _GsReposDialog
 
        GCancellable    *cancellable;
        GsPluginLoader  *plugin_loader;
-       GtkWidget       *frame;
-       GtkWidget       *frame_third_party;
        GtkWidget       *label_description;
        GtkWidget       *label_empty;
        GtkWidget       *label_header;
@@ -498,11 +496,11 @@ static void
 refresh_third_party_repo (GsReposDialog *dialog)
 {
        if (dialog->third_party_repo == NULL) {
-               gtk_widget_hide (dialog->frame_third_party);
+               gtk_widget_hide (dialog->listbox_third_party);
                return;
        }
 
-       gtk_widget_show (dialog->frame_third_party);
+       gtk_widget_show (dialog->listbox_third_party);
 }
 
 static void
@@ -571,7 +569,7 @@ get_sources_cb (GsPluginLoader *plugin_loader,
                add_repo (dialog, app);
        }
 
-       gtk_widget_set_visible (dialog->frame,
+       gtk_widget_set_visible (dialog->listbox,
                gtk_list_box_get_row_at_index (GTK_LIST_BOX (dialog->listbox), 0) != NULL);
 }
 
@@ -863,8 +861,6 @@ gs_repos_dialog_class_init (GsReposDialogClass *klass)
 
        gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Software/gs-repos-dialog.ui");
 
-       gtk_widget_class_bind_template_child (widget_class, GsReposDialog, frame);
-       gtk_widget_class_bind_template_child (widget_class, GsReposDialog, frame_third_party);
        gtk_widget_class_bind_template_child (widget_class, GsReposDialog, label_description);
        gtk_widget_class_bind_template_child (widget_class, GsReposDialog, label_empty);
        gtk_widget_class_bind_template_child (widget_class, GsReposDialog, label_header);
diff --git a/src/gs-repos-dialog.ui b/src/gs-repos-dialog.ui
index b53b574af..32867c30e 100644
--- a/src/gs-repos-dialog.ui
+++ b/src/gs-repos-dialog.ui
@@ -120,40 +120,31 @@
                       </object>
                     </child>
                     <child>
-                      <object class="GtkFrame" id="frame_third_party">
+                      <object class="GtkListBox" id="listbox_third_party">
                         <property name="visible">True</property>
-                        <property name="shadow_type">in</property>
+                        <property name="selection_mode">none</property>
                         <property name="halign">fill</property>
                         <property name="valign">start</property>
                         <property name="margin_bottom">16</property>
                         <child>
-                          <object class="GtkListBox" id="listbox_third_party">
+                          <object class="GsThirdPartyRepoRow" id="row_third_party">
                             <property name="visible">True</property>
-                            <property name="selection_mode">none</property>
-                            <child>
-                              <object class="GsThirdPartyRepoRow" id="row_third_party">
-                                <property name="visible">True</property>
-                                <property name="activatable">False</property>
-                              </object>
-                            </child>
+                            <property name="activatable">False</property>
                           </object>
                         </child>
                       </object>
                     </child>
                     <child>
-                      <object class="GtkFrame" id="frame">
-                        <property name="visible">True</property>
-                        <property name="shadow_type">in</property>
+                      <object class="GtkListBox" id="listbox">
                         <property name="halign">fill</property>
                         <property name="valign">start</property>
                         <property name="vexpand">True</property>
                         <property name="margin_top">9</property>
-                        <child>
-                          <object class="GtkListBox" id="listbox">
-                            <property name="visible">True</property>
-                            <property name="selection_mode">none</property>
-                          </object>
-                        </child>
+                        <property name="visible">True</property>
+                        <property name="selection_mode">none</property>
+                        <style>
+                          <class name="content" />
+                        </style>
                       </object>
                     </child>
                   </object>
diff --git a/src/gs-update-dialog.ui b/src/gs-update-dialog.ui
index 1c89be29e..cbf4102ce 100644
--- a/src/gs-update-dialog.ui
+++ b/src/gs-update-dialog.ui
@@ -273,21 +273,15 @@
                 <property name="vscrollbar_policy">automatic</property>
                 <property name="shadow_type">none</property>
                 <child>
-                  <object class="GtkFrame" id="frame_installed_updates">
+                  <object class="GsUpdateList" id="list_box_installed_updates">
                     <property name="visible">True</property>
-                    <property name="shadow_type">none</property>
+                    <property name="can_focus">True</property>
+                    <property name="selection_mode">none</property>
                     <property name="halign">fill</property>
                     <property name="valign">start</property>
                     <style>
-                      <class name="view"/>
+                      <class name="content" />
                     </style>
-                    <child>
-                      <object class="GsUpdateList" id="list_box_installed_updates">
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="selection_mode">none</property>
-                      </object>
-                    </child>
                   </object>
                 </child>
               </object>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]