Skip to content

Commit

Permalink
Update metainfo and fix details
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvladus committed Jan 5, 2024
1 parent af5582f commit 808a5de
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
8 changes: 7 additions & 1 deletion data/io.github.mrvladus.List.metainfo.xml.in.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,21 @@
<releases>
<release version="45.1.3" date="2024-01-05">
<description translatable="no">
<p>Added:</p>
<ul>
<li>Deleting task with drag and drop on top of the trash button</li>
</ul>
<p>Fixed:</p>
<ul>
<li>App icon having black background on KDE</li>
<li>Drag and Drop bug on KDE, where "+" drop area stays shown</li>
<li>Drag and Drop bug on KDE, where task's "+" drop area stays shown</li>
</ul>
<p>Translations:</p>
<ul>
<li>Updated Russian translation</li>
<li>Updated Italian translation (Albano Battistella)</li>
<li>Updated Dutch translation (Heimen Stoffels)</li>
<li>Updated Spanish translation (Clay Gomera)</li>
</ul>
</description>
</release>
Expand Down
11 changes: 8 additions & 3 deletions errands/widgets/details.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions errands/widgets/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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] = []
Expand Down Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions errands/widgets/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 808a5de

Please sign in to comment.