From 2521fa38f97ba3c6f069ae5b0358526a998c9a0a Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Fri, 5 Dec 2025 23:02:51 +0900 Subject: [PATCH 1/2] chore: App: Rely on Granite.StyleManager Granite.StyleManager handles dark mode since 7.7.0 --- .github/workflows/ci.yml | 4 +++- io.github.elework.spreadsheet.yml | 4 +++- meson.build | 2 +- src/App.vala | 12 +----------- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fab32a5..15e8626 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,9 @@ jobs: fail-fast: false container: - image: ghcr.io/elementary/flatpak-platform/runtime:8.2-${{ matrix.arch }} + # TODO Use stable version of runtime with granite-7 >= 7.7.0 when released + #image: ghcr.io/elementary/flatpak-platform/runtime:8.2-${{ matrix.arch }} + image: ghcr.io/elementary/flatpak-platform/runtime:daily-${{ matrix.arch }} options: --privileged steps: diff --git a/io.github.elework.spreadsheet.yml b/io.github.elework.spreadsheet.yml index f4bcfa2..536360f 100644 --- a/io.github.elework.spreadsheet.yml +++ b/io.github.elework.spreadsheet.yml @@ -1,6 +1,8 @@ id: io.github.elework.spreadsheet runtime: io.elementary.Platform -runtime-version: '8.2' +# TODO Use stable version of runtime with granite-7 >= 7.7.0 when released +#runtime-version: '8.3' +runtime-version: 'daily' sdk: io.elementary.Sdk command: io.github.elework.spreadsheet finish-args: diff --git a/meson.build b/meson.build index d54288c..f55b28c 100644 --- a/meson.build +++ b/meson.build @@ -88,7 +88,7 @@ executable(meson.project_name(), dependency('gio-2.0', version: '>= 2.74'), # GLib.ListStore.n_items dependency('glib-2.0'), dependency('gobject-2.0'), - dependency('granite-7'), + dependency('granite-7', version: '>= 7.7.0'), dependency('gtk4', version: '>= 4.10'), # Gtk.FileDialog dependency('libadwaita-1'), dependency('pango') diff --git a/src/App.vala b/src/App.vala index fd7e042..4265b1b 100644 --- a/src/App.vala +++ b/src/App.vala @@ -42,17 +42,7 @@ public class Spreadsheet.App : Gtk.Application { protected override void startup () { base.startup (); - // Follow OS-wide dark preference - unowned var granite_settings = Granite.Settings.get_default (); - unowned var gtk_settings = Gtk.Settings.get_default (); - - granite_settings.bind_property ("prefers-color-scheme", gtk_settings, "gtk-application-prefer-dark-theme", - BindingFlags.DEFAULT | BindingFlags.SYNC_CREATE, - (binding, granite_prop, ref gtk_prop) => { - gtk_prop = (Granite.Settings.ColorScheme) granite_prop == Granite.Settings.ColorScheme.DARK; - return true; - } - ); + Granite.init (); add_action_entries (ACTION_ENTRIES, this); set_accels_for_action (ACTION_PREFIX + ACTION_NAME_NEW, ACTION_ACCELS_NEW); From 3b655d3f155074a6500657fd665b66abfae11ce4 Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Fri, 5 Dec 2025 23:09:42 +0900 Subject: [PATCH 2/2] Fix typo --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15e8626..ff9211a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: container: # TODO Use stable version of runtime with granite-7 >= 7.7.0 when released - #image: ghcr.io/elementary/flatpak-platform/runtime:8.2-${{ matrix.arch }} + #image: ghcr.io/elementary/flatpak-platform/runtime:8.3-${{ matrix.arch }} image: ghcr.io/elementary/flatpak-platform/runtime:daily-${{ matrix.arch }} options: --privileged