[gnome-todo] task-list-view: Make it a GtkBox



commit 5532c503fe446deb6329c71324734e2263d07a96
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Jun 5 20:17:27 2019 -0300

    task-list-view: Make it a GtkBox
    
    And simplify the UI file a bit.

 src/task-list-view/gtd-task-list-view.c  |   2 +-
 src/task-list-view/gtd-task-list-view.h  |   2 +-
 src/task-list-view/gtd-task-list-view.ui | 106 +++++++++++++++----------------
 3 files changed, 53 insertions(+), 57 deletions(-)
---
diff --git a/src/task-list-view/gtd-task-list-view.c b/src/task-list-view/gtd-task-list-view.c
index 17591ee..4df65fc 100644
--- a/src/task-list-view/gtd-task-list-view.c
+++ b/src/task-list-view/gtd-task-list-view.c
@@ -158,7 +158,7 @@ static void          on_task_row_exited_cb                       (GtdTaskListVie
 static gboolean      scroll_to_bottom_cb                         (gpointer            data);
 
 
-G_DEFINE_TYPE_WITH_PRIVATE (GtdTaskListView, gtd_task_list_view, GTK_TYPE_OVERLAY)
+G_DEFINE_TYPE_WITH_PRIVATE (GtdTaskListView, gtd_task_list_view, GTK_TYPE_BOX)
 
 static const GActionEntry gtd_task_list_view_entries[] = {
   { "clear-completed-tasks", on_clear_completed_tasks_activated_cb },
diff --git a/src/task-list-view/gtd-task-list-view.h b/src/task-list-view/gtd-task-list-view.h
index 709b905..0f2f3bf 100644
--- a/src/task-list-view/gtd-task-list-view.h
+++ b/src/task-list-view/gtd-task-list-view.h
@@ -27,7 +27,7 @@ G_BEGIN_DECLS
 
 #define GTD_TYPE_TASK_LIST_VIEW (gtd_task_list_view_get_type())
 
-G_DECLARE_FINAL_TYPE (GtdTaskListView, gtd_task_list_view, GTD, TASK_LIST_VIEW, GtkOverlay)
+G_DECLARE_FINAL_TYPE (GtdTaskListView, gtd_task_list_view, GTD, TASK_LIST_VIEW, GtkBox)
 
 /**
  * GtdTaskListViewFilterFunc:
diff --git a/src/task-list-view/gtd-task-list-view.ui b/src/task-list-view/gtd-task-list-view.ui
index 8adb4bb..e42dcae 100644
--- a/src/task-list-view/gtd-task-list-view.ui
+++ b/src/task-list-view/gtd-task-list-view.ui
@@ -1,68 +1,64 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="3.16"/>
-  <template class="GtdTaskListView" parent="GtkOverlay">
+  <template class="GtdTaskListView" parent="GtkBox">
+    <property name="vexpand">1</property>
+    <property name="orientation">vertical</property>
     <child>
-      <object class="GtkBox" id="main_box">
+      <object class="GtkScrolledWindow" id="scrolled_window">
+        <property name="can_focus">1</property>
+        <property name="hexpand">1</property>
         <property name="vexpand">1</property>
-        <property name="orientation">vertical</property>
+        <property name="min-content-height">320</property>
         <child>
-          <object class="GtkScrolledWindow" id="scrolled_window">
-            <property name="can_focus">1</property>
-            <property name="hexpand">1</property>
-            <property name="vexpand">1</property>
-            <property name="min-content-height">320</property>
+          <object class="GtkStack" id="stack">
+            <property name="homogeneous">0</property>
+            <property name="expand">1</property>
+            <property name="transition-type">crossfade</property>
             <child>
-              <object class="GtkStack" id="stack">
-                <property name="homogeneous">0</property>
-                <property name="expand">1</property>
-                <property name="transition-type">crossfade</property>
-                <child>
-                  <object class="GtkStackPage">
-                    <property name="name">listbox</property>
-                    <property name="child">
-                      <object class="GtkBox">
-                        <property name="margin-top">6</property>
-                        <property name="margin-bottom">64</property>
-                        <property name="margin-start">18</property>
-                        <property name="margin-end">18</property>
-                        <property name="orientation">vertical</property>
-                        <child>
-                          <object class="GtkListBox" id="listbox">
-                            <property name="hexpand">1</property>
-                            <property name="selection_mode">none</property>
-                            <signal name="drag-drop" handler="listbox_drag_drop" object="GtdTaskListView" 
swapped="no"/>
-                            <signal name="drag-leave" handler="listbox_drag_leave" object="GtdTaskListView" 
swapped="no"/>
-                            <signal name="drag-motion" handler="listbox_drag_motion" 
object="GtdTaskListView" swapped="no"/>
-                            <signal name="row-activated" handler="on_listbox_row_activated_cb" 
object="GtdTaskListView" swapped="no"/>
-                            <style>
-                              <class name="transparent"/>
-                            </style>
-                          </object>
-                        </child>
-                        <child>
-                          <object class="GtdNewTaskRow" id="new_task_row">
-                            <property name="margin-bottom">24</property>
-                            <signal name="enter" handler="on_new_task_row_entered_cb" 
object="GtdTaskListView" swapped="yes"/>
-                            <signal name="exit" handler="on_new_task_row_exited_cb" object="GtdTaskListView" 
swapped="yes"/>
-                          </object>
-                        </child>
+              <object class="GtkStackPage">
+                <property name="name">listbox</property>
+                <property name="child">
+                  <object class="GtkBox">
+                    <property name="margin-top">6</property>
+                    <property name="margin-bottom">64</property>
+                    <property name="margin-start">18</property>
+                    <property name="margin-end">18</property>
+                    <property name="orientation">vertical</property>
+                    <child>
+                      <object class="GtkListBox" id="listbox">
+                        <property name="hexpand">1</property>
+                        <property name="selection_mode">none</property>
+                        <signal name="drag-drop" handler="listbox_drag_drop" object="GtdTaskListView" 
swapped="no"/>
+                        <signal name="drag-leave" handler="listbox_drag_leave" object="GtdTaskListView" 
swapped="no"/>
+                        <signal name="drag-motion" handler="listbox_drag_motion" object="GtdTaskListView" 
swapped="no"/>
+                        <signal name="row-activated" handler="on_listbox_row_activated_cb" 
object="GtdTaskListView" swapped="no"/>
+                        <style>
+                          <class name="transparent"/>
+                        </style>
                       </object>
-                    </property>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkStackPage">
-                    <property name="name">loading</property>
-                    <property name="child">
-                      <object class="GtkSpinner">
-                        <property name="active">1</property>
-                        <property name="width-request">96</property>
-                        <property name="height-request">96</property>
+                    </child>
+                    <child>
+                      <object class="GtdNewTaskRow" id="new_task_row">
+                        <property name="margin-bottom">24</property>
+                        <signal name="enter" handler="on_new_task_row_entered_cb" object="GtdTaskListView" 
swapped="yes"/>
+                        <signal name="exit" handler="on_new_task_row_exited_cb" object="GtdTaskListView" 
swapped="yes"/>
                       </object>
-                    </property>
+                    </child>
+                  </object>
+                </property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkStackPage">
+                <property name="name">loading</property>
+                <property name="child">
+                  <object class="GtkSpinner">
+                    <property name="active">1</property>
+                    <property name="width-request">96</property>
+                    <property name="height-request">96</property>
                   </object>
-                </child>
+                </property>
               </object>
             </child>
           </object>


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