From 5cd0ebdab5e17114a36c2a74ce4609961d1358a2 Mon Sep 17 00:00:00 2001 From: teamcons Date: Tue, 21 Apr 2026 16:53:23 +0200 Subject: [PATCH 1/4] this one uses gtk 4.23 and above --- src/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index 4547cab0..85cc89fd 100644 --- a/src/meson.build +++ b/src/meson.build @@ -22,7 +22,7 @@ dependencies = [ dependency('gobject-2.0'), dependency('json-glib-1.0'), dependency('gee-0.8'), - dependency('gtk4') + dependency('gtk4', version: '>=4.23') ] # We need to compile an icon into the exe to avoid "missing icon" icon at every turn From e0dd2e504a5884d2543bc6c3ddc02aa9911c88a7 Mon Sep 17 00:00:00 2001 From: teamcons Date: Tue, 21 Apr 2026 16:59:23 +0200 Subject: [PATCH 2/4] make use of the new (since 4.22) prefers-reduced-motion --- data/Application.css | 19 +++++++++++++++++++ src/Services/NoteManager.vala | 24 ------------------------ 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/data/Application.css b/data/Application.css index d292eabc..bfa0cca4 100644 --- a/data/Application.css +++ b/data/Application.css @@ -156,6 +156,25 @@ window.animated actionbar image { transition: color 750ms cubic-bezier(0.4, 0, 0.2, 1); } +@media (prefers-reduced-motion: reduce) { + window.animated, + window.animated overshoot, + window.animated undershoot { + transition: none; + } + + window.animated textview, + window.animated textview text, + window.animated headertitle, + window.animated actionbar, + window.animated actionbar .themedbutton:hover, + window.animated actionbar .themedbutton:focus, + window.animated editablelabel, + window.animated actionbar image { + transition: none; + } +} + /* Devel builds get these. Libadwaita has that too, but we do not use it. */ window.devel { diff --git a/src/Services/NoteManager.vala b/src/Services/NoteManager.vala index 5e62d6cf..d2e62ef5 100644 --- a/src/Services/NoteManager.vala +++ b/src/Services/NoteManager.vala @@ -74,8 +74,6 @@ public class Jorts.NoteManager : Object { } saving_lock = false; - on_reduceanimation_changed (); - Gtk.Settings.get_default ().notify["enable-animations"].connect (on_reduceanimation_changed); } /*************************************************/ @@ -156,28 +154,6 @@ public class Jorts.NoteManager : Object { storage.save (array); } - /*************************************************/ - /** - * Handler to add or remove CSS animations from all active notes - */ - public void on_reduceanimation_changed () { - debug ("Reduce animation changed!"); - - if (Gtk.Settings.get_default ().gtk_enable_animations) { - foreach (var window in open_notes) { - window.add_css_class ("animated"); - } - - } else { - foreach (var window in open_notes) { - // If we remove without checking we get a critical - if ("animated" in window.css_classes) { - window.remove_css_class ("animated"); - } - } - } - } - public void action_new () { debug ("New Note"); create_note (); From f402d1a6013ca4872ddc84e16766bcb735a962ae Mon Sep 17 00:00:00 2001 From: teamcons Date: Tue, 21 Apr 2026 17:17:49 +0200 Subject: [PATCH 3/4] bump platform to nightly --- io.github.elly_code.jorts.devel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io.github.elly_code.jorts.devel.yml b/io.github.elly_code.jorts.devel.yml index c5a7f5cf..d2ad4b76 100644 --- a/io.github.elly_code.jorts.devel.yml +++ b/io.github.elly_code.jorts.devel.yml @@ -6,7 +6,7 @@ id: io.github.elly_code.jorts.devel base: io.elementary.BaseApp base-version: 'circe-25.08' runtime: org.gnome.Platform -runtime-version: '49' +runtime-version: 'master' sdk: org.gnome.Sdk command: io.github.elly_code.jorts.devel From 6642343ef8c7a352d41cebd76bfcf074474133f1 Mon Sep 17 00:00:00 2001 From: teamcons Date: Tue, 28 Apr 2026 18:55:50 +0200 Subject: [PATCH 4/4] bam it back --- src/Windows/StickyNoteWindow.vala | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Windows/StickyNoteWindow.vala b/src/Windows/StickyNoteWindow.vala index 8e7dcb2f..8e30b90c 100644 --- a/src/Windows/StickyNoteWindow.vala +++ b/src/Windows/StickyNoteWindow.vala @@ -83,6 +83,8 @@ public class Jorts.StickyNoteWindow : Gtk.ApplicationWindow { add_css_class (STYLE_DEVEL); #endif + save_state.connect (on_save_state); + restore_state.connect (on_restore_state); /***************************************************/ /* CONNECTS AND BINDS */ @@ -194,4 +196,23 @@ public class Jorts.StickyNoteWindow : Gtk.ApplicationWindow { application.activate_action (NoteManager.ACTION_SAVE, null); } private void action_delete () {((Jorts.Application)this.application).note_manager.delete_note (this); this.destroy ();} + + private bool on_save_state (VariantDict state) { + state.insert_value ("title", new GLib.Variant ("s", data.title)); + state.insert_value ("content", new GLib.Variant ("s", data.content)); + state.insert_value ("color", new GLib.Variant ("s", data.theme.to_string ())); + state.insert_value ("mono", new GLib.Variant ("s", data.monospace.to_string ())); + state.insert_value ("zoom", new GLib.Variant ("s", data.zoom.to_string ())); + return false; + } + + // Check what we can save + private bool on_restore_state (VariantDict state) { + var title_v = state.lookup_value ("title", GLib.VariantType.STRING); + print ("\n" + title_v.get_string ()); + + return true; + } + + }