[gnome-todo] task-list-view: replaced "Done (0)" with "Done" in the done_label



commit 3fdaa02b9e0c644125d90ca6b35d9d9388654ba4
Author: Evgeny Shulgin <izarizar mail ru>
Date:   Thu Apr 20 19:38:04 2017 +0300

    task-list-view: replaced "Done (0)" with "Done" in the done_label
    
    In the list of tasks we have the label "Done (X)", after clicking
    back_button we will get "Done (0)" for a few moments before the
    page dissapears.
    
    For fixing this bug we will use two variants of this label: the
    first one for complete_tasks > 0, the second for complete_tasks = 0.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=781348

 src/gtd-task-list-view.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/gtd-task-list-view.c b/src/gtd-task-list-view.c
index a878b41..dae4a8a 100644
--- a/src/gtd-task-list-view.c
+++ b/src/gtd-task-list-view.c
@@ -773,9 +773,16 @@ gtd_task_list_view__update_done_label (GtdTaskListView *view)
 
   gtk_revealer_set_reveal_child (GTK_REVEALER (view->priv->revealer), view->priv->complete_tasks > 0);
 
-  new_label = g_strdup_printf ("%s (%d)",
-                               _("Done"),
-                               view->priv->complete_tasks);
+  if (view->priv->complete_tasks == 0)
+    {
+      new_label = g_strdup_printf ("%s", _("Done"));
+    }
+  else
+    {
+      new_label = g_strdup_printf ("%s (%d)",
+                                   _("Done"),
+                                   view->priv->complete_tasks);
+    }
 
   gtk_label_set_label (view->priv->done_label, new_label);
 


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