[gnome-software/bilelmoussaoui/no-frame: 4/7] gs-history-dialog: Stop using GtkFrame




commit d37588fdaa86a3549561214a1dad19cffd035d1b
Author: Phaedrus Leeds <mwleeds protonmail com>
Date:   Sat Apr 10 22:12:13 2021 -0700

    gs-history-dialog: Stop using GtkFrame
    
    Use a libhandy css class instead which is cleaner.

 src/gs-history-dialog.c  | 28 ----------------------------
 src/gs-history-dialog.ui | 20 ++++++--------------
 2 files changed, 6 insertions(+), 42 deletions(-)
---
diff --git a/src/gs-history-dialog.c b/src/gs-history-dialog.c
index 4b1ae57aa..eb202bdc5 100644
--- a/src/gs-history-dialog.c
+++ b/src/gs-history-dialog.c
@@ -145,29 +145,6 @@ gs_history_dialog_set_app (GsHistoryDialog *dialog, GsApp *app)
        }
 }
 
-static void
-update_header_func (GtkListBoxRow *row,
-                   GtkListBoxRow *before,
-                   gpointer user_data)
-{
-       GtkWidget *header;
-
-       /* first entry */
-       header = gtk_list_box_row_get_header (row);
-       if (before == NULL) {
-               gtk_list_box_row_set_header (row, NULL);
-               return;
-       }
-
-       /* already set */
-       if (header != NULL)
-               return;
-
-       /* set new */
-       header = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
-       gtk_list_box_row_set_header (row, header);
-}
-
 static void
 scrollbar_mapped_cb (GtkWidget *sb, GtkScrolledWindow *swin)
 {
@@ -206,11 +183,6 @@ gs_history_dialog_init (GsHistoryDialog *dialog)
        dialog->sizegroup_timestamp = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
        dialog->sizegroup_version = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
-       gtk_list_box_set_header_func (GTK_LIST_BOX (dialog->list_box),
-                                     update_header_func,
-                                     dialog,
-                                     NULL);
-
        scrollbar = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (dialog->scrolledwindow));
        g_signal_connect (scrollbar, "map", G_CALLBACK (scrollbar_mapped_cb), dialog->scrolledwindow);
        g_signal_connect (scrollbar, "unmap", G_CALLBACK (scrollbar_mapped_cb), dialog->scrolledwindow);
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>


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