Skip to content

Commit

Permalink
Book overview redesign (#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbende authored Jul 14, 2024
1 parent 3dc4217 commit be48baa
Show file tree
Hide file tree
Showing 19 changed files with 446 additions and 621 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,22 @@ jobs:
- uses: actions/checkout@v4

- name: Install deps
if: ${{ matrix.arch == 'aarch64' }}
run: |
dnf -y install docker
if: ${{ matrix.arch == 'aarch64' }}
- name: Set up QEMU
id: qemu
if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
if: ${{ matrix.arch == 'aarch64' }}

- uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6
with:
repository-name: gnome-nightly
repository-url: https://nightly.gnome.org/gnome-nightly.flatpakrepo
bundle: Cozy.flatpak
manifest-path: com.github.geigi.cozy.json
cache-key: "flatpak-builder-${{ github.sha }}"
arch: ${{ matrix.arch }}
arch: ${{ matrix.arch }}
2 changes: 1 addition & 1 deletion com.github.geigi.cozy.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"app-id": "com.github.geigi.cozy",
"runtime": "org.gnome.Platform",
"runtime-version": "46",
"runtime-version": "master",
"sdk": "org.gnome.Sdk",
"command": "com.github.geigi.cozy",
"finish-args": [
Expand Down
4 changes: 1 addition & 3 deletions cozy/app_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from cozy.power_manager import PowerManager
from cozy.report import reporter
from cozy.ui.app_view import AppView
from cozy.ui.book_detail_view import BookDetailView
from cozy.ui.headerbar import Headerbar
from cozy.ui.library_view import LibraryView
from cozy.ui.main_view import CozyUI
Expand Down Expand Up @@ -50,7 +49,6 @@ def __init__(self, gtk_app, main_window_builder, main_window):
self.library_view: LibraryView = LibraryView(main_window_builder)
self.app_view: AppView = AppView(main_window_builder)
self.headerbar: Headerbar = Headerbar(main_window_builder)
self.book_detail_view: BookDetailView = BookDetailView(main_window_builder)
self.media_controller: MediaController = MediaController(main_window_builder)
self.search_view: SearchView = SearchView(main_window_builder, self.headerbar)

Expand Down Expand Up @@ -115,8 +113,8 @@ def open_reader(self, reader: str):
self.library_view_model.selected_filter = reader

def open_book(self, book: Book):
self.book_detail_view_model.open_book_detail_view()
self.book_detail_view_model.book = book
self.app_view_model.open_book_detail_view()

def open_library(self):
self.library_view_model.open_library()
Expand Down
7 changes: 7 additions & 0 deletions cozy/ui/app_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ def _connect_ui_elements(self):

def _connect_view_model(self):
self._view_model.bind_to("view", self._on_view_changed)
self._view_model.bind_to("open_book_overview", self._on_open_book_overview)

def _on_open_book_overview(self):
if self._navigation_view.props.visible_page.props.tag == "book_overview":
self._navigation_view.pop_to_tag("book_overview")
else:
self._navigation_view.push_by_tag("book_overview")

def _on_view_changed(self):
view = self._view_model.view
Expand Down
Loading

0 comments on commit be48baa

Please sign in to comment.