[gnome-todo/wip/gbsneto/newtask-row-top-margin: 4/4] task-list-view: Set 12px top margin when list is not empty



commit bd54f49b37f46c616b2b70089e769cff0da1f0cf
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sun Oct 22 20:01:08 2017 -0200

    task-list-view: Set 12px top margin when list is not empty
    
    The "new task" row doesn't stand out visually from the other list
    items. Increasing the margin-top on GtdNewTaskRow a bit would
    improve this by separating it from the existing rows.
    
    This commit implement changing the top margin to 12px when there
    are visible tasks.
    
    Fixes: #105

 src/gtd-task-list-view.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/gtd-task-list-view.c b/src/gtd-task-list-view.c
index 71e54b3..bcfb2c9 100644
--- a/src/gtd-task-list-view.c
+++ b/src/gtd-task-list-view.c
@@ -588,9 +588,15 @@ gtd_task_list_view__update_empty_state (GtdTaskListView *view)
         }
     }
 
-  gtk_widget_set_visible (view->priv->empty_box, is_empty);
-  gtd_empty_list_widget_set_is_empty (GTD_EMPTY_LIST_WIDGET (view->priv->empty_box),
-                                      view->priv->complete_tasks == 0);
+  gtk_widget_set_visible (priv->empty_box, is_empty);
+  gtd_empty_list_widget_set_is_empty (GTD_EMPTY_LIST_WIDGET (priv->empty_box),
+                                      priv->complete_tasks == 0);
+
+  /*
+   * If there are visible tasks, we visually separate the New Task row by
+   * increasing the top margin to 12px.
+   */
+  gtk_widget_set_margin_top (GTK_WIDGET (priv->new_task_row), is_empty ? 3 : 12);
 
   g_list_free (tasks);
 }


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