diff --git a/GTG/core/filters.py b/GTG/core/filters.py index 84a3f3f14..ba02c635a 100644 --- a/GTG/core/filters.py +++ b/GTG/core/filters.py @@ -42,19 +42,20 @@ def __init__(self, ds, pane): super(TagEmptyFilter, self).__init__() self.ds = ds self.pane = pane + self.show_zero = True def do_match(self, item) -> bool: tag = unwrap(item, Tag) - if self.pane == 'open': - return tag.task_count_open > 0 + if self.pane == 'open_view': + return self.show_zero or tag.task_count_open > 0 - elif self.pane == 'closed': - return tag.task_count_closed > 0 + elif self.pane == 'closed_view': + return self.show_zero or tag.task_count_closed > 0 - elif self.pane == 'workview': - return tag.task_count_actionable > 0 and tag.actionable + elif self.pane == 'actionable_view': + return (self.show_zero or tag.task_count_actionable > 0) and tag.actionable else: return True diff --git a/GTG/gtk/browser/sidebar.py b/GTG/gtk/browser/sidebar.py index 65793dd02..43580d2d7 100644 --- a/GTG/gtk/browser/sidebar.py +++ b/GTG/gtk/browser/sidebar.py @@ -146,7 +146,7 @@ def __init__(self, app, ds: Datastore, browser): # ------------------------------------------------------------------------------- # Tags Section # ------------------------------------------------------------------------------- - self.tags_filter = TagEmptyFilter(ds, 'open') + self.tags_filter = TagEmptyFilter(ds, 'open_view') self.filtered_tags = Gtk.FilterListModel() self.filtered_tags.set_model(ds.tags.tree_model) self.filtered_tags.set_filter(self.tags_filter)