Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign book detail view #948

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cozy/ui/chapter_element.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from gi.repository import Adw, GObject, Gtk
from os import path

from cozy.control.time_format import ns_to_time
from cozy.model.chapter import Chapter


@Gtk.Template.from_resource("/com/github/geigi/cozy/ui/chapter_element.ui")
class ChapterElement(Adw.ActionRow):
__gtype_name__ = "ChapterElement"
Expand All @@ -23,6 +23,7 @@ def __init__(self, chapter: Chapter):
self.set_title(self.chapter.name)
self.number_label.set_text(str(self.chapter.number))
self.duration_label.set_text(ns_to_time(self.chapter.length))
self.set_tooltip_text(path.basename(self.chapter.file))

@GObject.Signal(arg_types=(object,))
def play_pause_clicked(self, *_): ...
Expand Down
21 changes: 20 additions & 1 deletion data/ui/book_detail.blp
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,30 @@ template $BookDetail: Adw.NavigationPage {
}

menu book_menu_model {
section {
item {
action: 'app.mark_book_as_read';
label: _("Mark as Read");
}

item {
action: 'app.jump_to_book_folder';
label: _("Open in Files");
}
}

section {
item {
action: 'book_overview.download';
label: _("_Available Offline");
label: _("Download Book");
Copy link
Collaborator

@rdbende rdbende Aug 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a two-state action, that's why I went with "Available Offline".

hidden-when: "action-disabled";
}
}

section {
item {
action: 'app.remove_book';
label: _("Delete Permanently…");
}
}
}