From 808a5decedf63d6659a87c5c9f79551c6006cada Mon Sep 17 00:00:00 2001 From: mrvladus Date: Fri, 5 Jan 2024 11:39:31 +0300 Subject: [PATCH] Update metainfo and fix details --- data/io.github.mrvladus.List.metainfo.xml.in.in | 8 +++++++- errands/widgets/details.py | 11 ++++++++--- errands/widgets/lists.py | 8 ++++---- errands/widgets/task.py | 1 + 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/data/io.github.mrvladus.List.metainfo.xml.in.in b/data/io.github.mrvladus.List.metainfo.xml.in.in index dec2e4c0..fbd099c0 100644 --- a/data/io.github.mrvladus.List.metainfo.xml.in.in +++ b/data/io.github.mrvladus.List.metainfo.xml.in.in @@ -52,15 +52,21 @@ +

Added:

+
    +
  • Deleting task with drag and drop on top of the trash button
  • +

Fixed:

  • App icon having black background on KDE
  • -
  • Drag and Drop bug on KDE, where "+" drop area stays shown
  • +
  • Drag and Drop bug on KDE, where task's "+" drop area stays shown

Translations:

  • Updated Russian translation
  • Updated Italian translation (Albano Battistella)
  • +
  • Updated Dutch translation (Heimen Stoffels)
  • +
  • Updated Spanish translation (Clay Gomera)
diff --git a/errands/widgets/details.py b/errands/widgets/details.py index c418f99d..d738aa01 100644 --- a/errands/widgets/details.py +++ b/errands/widgets/details.py @@ -19,9 +19,9 @@ def __init__(self, window) -> None: super().__init__() self.window = window self.split_view = window.split_view_inner - self.build_ui() + self._build_ui() - def build_ui(self): + def _build_ui(self): # Header Bar hb = Adw.HeaderBar(show_title=False, show_back_button=False) # Back button @@ -262,9 +262,14 @@ def add_tag(self, text: str) -> None: self.tags.add(tag) def update_info(self, parent): + self.parent = parent + + if parent == None: + self.status.set_visible(True) + return + Log.debug("Details: Update info") - self.parent = parent # Edit text self.edit_entry.set_text(self.parent.get_prop("text")) # Notes diff --git a/errands/widgets/lists.py b/errands/widgets/lists.py index 44d0f998..0d4dc7fd 100644 --- a/errands/widgets/lists.py +++ b/errands/widgets/lists.py @@ -231,13 +231,12 @@ def _entry_changed(entry, _, dialog): def _confirm(_, res, entry): if res == "cancel": - Log.debug("Adding new list is cancelled") return name = entry.props.text.rstrip().lstrip() uid = UserData.add_list(name) row = self.add_list(name, uid) - row.activate() + self.lists.select_row(row) Sync.sync() entry = Gtk.Entry(placeholder_text=_("New List Name")) @@ -265,13 +264,14 @@ def on_trash_btn_clicked(self, _btn): self.window.split_view_inner.set_show_sidebar(False) def on_list_swiched(self, _, row: Gtk.ListBoxRow): + Log.debug("Lists: Switch list") if row: name = row.label.get_label() self.stack.set_visible_child_name(name) self.window.split_view.set_show_content(True) GSettings.set("last-open-list", "s", name) self.status_page.set_visible(False) - self.window.details.status.set_visible(True) + self.window.details.update_info(None) def get_lists(self) -> list[TaskList]: lists: list[TaskList] = [] @@ -338,7 +338,7 @@ def update_ui(self): ): self.window.details.update_info(self.window.details.parent) else: - self.window.details.status.set_visible(True) + self.window.details.update_info(None) class ListItem(Gtk.ListBoxRow): diff --git a/errands/widgets/task.py b/errands/widgets/task.py index c6ed4b59..dab60598 100644 --- a/errands/widgets/task.py +++ b/errands/widgets/task.py @@ -287,6 +287,7 @@ def on_details_clicked(self, *args): # Close details on second click if ( self.details.parent == self + and not self.details.status.get_visible() and self.window.split_view_inner.get_show_sidebar() ): self.window.split_view_inner.set_show_sidebar(False)