diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 2741a5b9..262f7e0e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -54,7 +54,7 @@ body: options: - I installed from Flathub (all Linuxes) - I installed from Appcenter (elementary OS) - - I built it from sources (with Meson+Ninja) + - I built it from sources (with Meson+Ninja, or from AUR) validations: required: true diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7606cc52..92e03f5b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -15,15 +15,15 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/elementary/flatpak-platform/runtime:8 + image: ghcr.io/elementary/flatpak-platform/runtime:8.2 options: --privileged steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Build - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + uses: flatpak/flatpak-github-actions/flatpak-builder@v6.6 with: bundle: jorts.flatpak manifest-path: io.github.elly_code.jorts.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 55dc6216..f652d38a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: "CI: Lint" +name: "Lint" on: pull_request: diff --git a/data/Application.css b/data/Application.css index adb547f8..6366fd92 100644 --- a/data/Application.css +++ b/data/Application.css @@ -164,3 +164,10 @@ window.animated editablelabel, window.animated actionbar image { transition: color 750ms cubic-bezier(0.4, 0, 0.2, 1); } + +/* Devel builds get these. Libadwaita has that too, but we do not use it. */ +window.devel { + border-style: solid; + border-width: 3px; + border-color: @warning_color; +} \ No newline at end of file diff --git a/data/jorts.desktop.in b/data/jorts.desktop.in.in similarity index 73% rename from data/jorts.desktop.in rename to data/jorts.desktop.in.in index 0b95141c..6ab536d5 100644 --- a/data/jorts.desktop.in +++ b/data/jorts.desktop.in.in @@ -1,11 +1,11 @@ [Desktop Entry] Type=Application Version=1.5 -Name=Jorts +Name=@APP_NAME@ GenericName=Sticky notes Comment=Write down notes, reminders, random thoughts and other short-term informations -Icon=io.github.elly_code.jorts -Exec=io.github.elly_code.jorts +Icon=@APP_ID@ +Exec=@APP_ID@ Terminal=false Actions=NewNote;Preferences; Categories=Office;GTK; @@ -16,9 +16,9 @@ SingleMainWindow=false [Desktop Action NewNote] Name=New sticky note Icon=list-add -Exec=io.github.elly_code.jorts --new-note +Exec=@APP_ID@ --new-note [Desktop Action Preferences] Name=Show Preferences Icon=open-menu -Exec=io.github.elly_code.jorts --preferences +Exec=@APP_ID@ --preferences diff --git a/data/jorts.gschema.xml b/data/jorts.gschema.xml.in similarity index 90% rename from data/jorts.gschema.xml rename to data/jorts.gschema.xml.in index 694d73cc..880ce511 100644 --- a/data/jorts.gschema.xml +++ b/data/jorts.gschema.xml.in @@ -1,6 +1,6 @@ - + false Change font to an illegible one diff --git a/data/jorts.metainfo.xml.in b/data/jorts.metainfo.xml.in.in similarity index 97% rename from data/jorts.metainfo.xml.in rename to data/jorts.metainfo.xml.in.in index 2f9c5a0a..39117dea 100644 --- a/data/jorts.metainfo.xml.in +++ b/data/jorts.metainfo.xml.in.in @@ -1,10 +1,11 @@ - io.github.elly_code.jorts + @APP_ID@ CC0-1.0 GPL-3.0+ + @APP_ID@.desktop - Jorts + @APP_NAME@ Write on colourful little squares

Neither jeans nor shorts, just like jorts!

@@ -18,7 +19,6 @@

This is a fork of an old version of "Notejot" by lainsce. The community liked it so much, we thought it would be great to revive it!

- io.github.elly_code.jorts.desktop io.github.ellie_commons.jorts @@ -68,9 +68,6 @@ pointing touch - - 1 - diff --git a/data/meson.build b/data/meson.build index 98b65f4e..01d19c39 100644 --- a/data/meson.build +++ b/data/meson.build @@ -1,34 +1,6 @@ -#======== SETTINGS ======== -install_data ( - 'jorts.gschema.xml', - install_dir: get_option('datadir') / 'glib-2.0' / 'schemas', - rename: meson.project_name() + '.gschema.xml' -) - # metainfo confuses windows, and icons are if not windows_build - #======== Internationalization ======== - #Translate and install our .desktop file - i18n.merge_file( - input: 'jorts.desktop.in', - output: meson.project_name() + '.desktop', - po_dir: meson.project_source_root() / 'po' / 'extra', - type: 'desktop', - install: true, - install_dir: get_option('datadir') / 'applications' - ) - - #======== Metainfo ======== - #Translate and install our .metainfo file - i18n.merge_file( - input: 'jorts.metainfo.xml.in', - output: meson.project_name() + '.metainfo.xml', - po_dir: meson.project_source_root() / 'po' / 'extra', - install: true, - install_dir: get_option('datadir') / 'metainfo' - ) - #======== ICONS ======== # Install our icons in all the required sizes # "variant" variable has been declared earlier in the base meson @@ -38,20 +10,93 @@ if not windows_build install_data( 'icons' / variant / 'hicolor' / i + '.png', install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i / 'apps', - rename: meson.project_name() + '.png' + rename: app_id + '.png' ) install_data( 'icons' / variant / 'hicolor@2' / i + '@2.png', install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i + '@2' / 'apps', - rename: meson.project_name() + '.png' + rename: app_id + '.png' ) endforeach install_data( 'icons' / variant / 'scalable.svg', install_dir: get_option('datadir') / 'icons' / 'scalable' / 'apps', - rename: meson.project_name() + '.svg' + rename: app_id + '.svg' + ) + + + # Inject some variables into the desktop file before merging in the translations + desktop_conf = configuration_data() + desktop_conf.set('APP_NAME', app_name) + desktop_conf.set('APP_ID', app_id) + desktop_file_in = configure_file( + input: 'jorts.desktop.in.in', + output: '@0@.desktop.in'.format(app_id), + configuration: desktop_conf, + ) + + desktop_file = i18n.merge_file( + input: desktop_file_in, + output: '@0@.desktop'.format(app_id), + po_dir: meson.project_source_root() / 'po', + type: 'desktop', + install: true, + install_dir: get_option('datadir') / 'applications', + ) + + + # Inject some variables into the metainfo file before merging in the translations + appstream_conf = configuration_data() + appstream_conf.set('APP_NAME', app_name) + appstream_conf.set('APP_ID', app_id) + appstream_conf.set('GETTEXT_PACKAGE', app_id) + appstream_file_in = configure_file( + input: 'jorts.metainfo.xml.in.in', + output: '@0@.metainfo.xml.in'.format(app_id), + configuration: appstream_conf, + ) + + appstream_file = i18n.merge_file( + input: appstream_file_in, + output: '@0@.metainfo.xml'.format(app_id), + po_dir: meson.project_source_root() / 'po', + install: true, + install_dir: get_option('datadir') / 'metainfo', ) + + + # Test definitions + desktop_utils = find_program('desktop-file-validate', required: false) + if desktop_utils.found() + test('Validate desktop file', desktop_utils, args: [desktop_file]) + endif + + appstreamcli = find_program('appstreamcli', required: false, disabler: true) + test('Validate appstream file', + appstreamcli, + args: ['validate', '--no-net', '--explain', appstream_file], + ) endif + +gschema_conf = configuration_data() +gschema_conf.set('APP_ID', app_id) +gschema_file = configure_file( + input: 'jorts.gschema.xml.in', + output: '@0@.gschema.xml'.format(app_id), + configuration: gschema_conf, +) + +install_data( + gschema_file, + install_dir: get_option('datadir') / 'glib-2.0' / 'schemas', +) + +compile_schemas = find_program('glib-compile-schemas', required: false, disabler: true) +test('Validate schema file', +compile_schemas, +args: ['--strict', '--dry-run', meson.current_source_dir()], +) + diff --git a/io.github.elly_code.jorts.devel.yml b/io.github.elly_code.jorts.devel.yml new file mode 100644 index 00000000..e12b8e84 --- /dev/null +++ b/io.github.elly_code.jorts.devel.yml @@ -0,0 +1,65 @@ +# +# This is danger +# +id: io.github.elly_code.jorts.devel +# elementary SDK is not available on Flathub, so use the elementary BaseApp instead +base: io.elementary.BaseApp +base-version: 'circe-25.08' +runtime: org.gnome.Platform +runtime-version: '49' +sdk: org.gnome.Sdk +command: io.github.elly_code.jorts.devel + +tags: ['devel'] +desktop-file-name-prefix: '(devel)' + +finish-args: + - '--share=ipc' + - '--device=dri' + - '--socket=fallback-x11' + - '--socket=wayland' + +cleanup: + - '/include' + - '/lib/pkgconfig' + - '/man' + - '/share/doc' + - '/share/gtk-doc' + - '/share/man' + - '/share/pkgconfig' + - '/share/installed-tests' + - '*.la' + - '*.a' + +modules: + # Needed for the Scribbly mode + # It should be present by default on elementary OS, but better not assume it is the case + - name: RedactedScript + buildsystem: simple + build-commands: + - install -Dm0644 RedactedScript-Regular.ttf -t ${FLATPAK_DEST}/share/fonts + - install -Dm0644 OFL.txt -t ${FLATPAK_DEST}/share/doc/redacted-font + - install -Dm0644 AUTHORS.txt -t ${FLATPAK_DEST}/share/doc/redacted-font + - install -Dm0644 README.md -t ${FLATPAK_DEST}/share/doc/redacted-font + sources: + - type: file + url: https://github.com/christiannaths/redacted-font/raw/63e542017bab347ba9be54d7d99b99d4754c3d97/RedactedScript/fonts/ttf/RedactedScript-Regular.ttf + sha256: 1ebaab9642a2f43fa33f449760469903143fd1d08b2433eb6c15e28602d9360d + - type: file + url: https://raw.githubusercontent.com/christiannaths/redacted-font/284dfb0397d1911c3388f72389f08b3c13446134/OFL.txt + sha256: ed836da2ff14b9b2d04001057e03c0531afdd2626bf66a612b17124589f58efa + - type: file + url: https://raw.githubusercontent.com/christiannaths/redacted-font/284dfb0397d1911c3388f72389f08b3c13446134/AUTHORS.txt + sha256: 84977eeb6e582a6d10bea0eda40e1c6dfdc8904309c6011932a9e2632c727043 + - type: file + url: https://raw.githubusercontent.com/christiannaths/redacted-font/284dfb0397d1911c3388f72389f08b3c13446134/README.md + sha256: e594f7f6bf03f7b11897d219184e215466cdfb9a8268b54cb7d5a626482dd722 + + - name: jorts + buildsystem: meson + config-opts: + - -Dvariant=['default'] + - -Ddevelopment=true + sources: + - type: dir + path: . diff --git a/meson.build b/meson.build index 79a0109f..2559cf8c 100644 --- a/meson.build +++ b/meson.build @@ -1,20 +1,36 @@ # Name our project -project('io.github.elly_code.jorts', ['vala', 'c'], +project( + 'io.github.elly_code.jorts', + 'vala', 'c', version: '4.0.1' ) +app_name = 'Jorts' +app_id = meson.project_name() +app_version = meson.project_version() + +vala_flags = [] +if get_option('development') + app_id += '.devel' + name_prefix = '(devel) ' + vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip() + version_suffix = '-@0@'.format (vcs_tag) + vala_flags += ['--define', 'DEVEL'] + +else + name_prefix = '' + version_suffix = '' +endif + + gnome = import('gnome') i18n = import('i18n') -add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language:'c') +add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (app_id), language:'c') windows_build = build_machine.system() == 'windows' #================================ -# Set flags for icon variants, and target in the case of windows builds - -vala_flags = [] - # Cool icon variants variant = get_option('variant')[0] @@ -39,7 +55,7 @@ if flathub vala_flags += ['--define', 'FLATHUB'] endif -add_project_arguments(vala_flags, language: 'vala') + #================================ # Import the stylesheet @@ -47,7 +63,10 @@ add_project_arguments(vala_flags, language: 'vala') ## Set de config data config_data = configuration_data() config_data.set_quoted('LOCALEDIR', get_option('prefix') / get_option('localedir')) -config_data.set_quoted('GETTEXT_PACKAGE', meson.project_name()) +config_data.set_quoted('GETTEXT_PACKAGE', app_id) +config_data.set_quoted('APP_NAME', app_name) +config_data.set_quoted('APP_ID', app_id) +config_data.set_quoted('APP_VERSION', app_version) config_file = configure_file( input: 'src/Config.vala.in', output: '@BASENAME@', @@ -64,12 +83,25 @@ gresource = gnome.compile_resources( #================================ # dependencies + + +gtk422 = dependency('gtk4', version: '>= 4.22', required: false) + +if gtk422.found() + gtk_dep = gtk422 + vala_flags = ['--define', 'HAS_GTK422'] + +else + gtk_dep = dependency('gtk4') +endif + +add_project_arguments(vala_flags, language: 'vala') dependencies = [ dependency('granite-7'), dependency('gobject-2.0'), dependency('json-glib-1.0'), dependency('gee-0.8'), - dependency('gtk4'), + gtk_dep, ] # We need to compile an icon into the exe to avoid "missing icon" icon at every turn diff --git a/meson_options.txt b/meson_options.txt index 6ac14e8e..50fed8bd 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -8,4 +8,5 @@ option('flathub', type : 'boolean', value : false, description : 'Slight modifications for Flathub' -) \ No newline at end of file +) +option('development', type: 'boolean', value: false, description: 'If this is a development build') \ No newline at end of file diff --git a/po/meson.build b/po/meson.build index e672ff71..f2c04f0a 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1,4 +1,4 @@ -i18n.gettext(meson.project_name(), +i18n.gettext(app_id, args: '--directory=' + meson.project_source_root(), preset: 'glib' ) diff --git a/src/Application.vala b/src/Application.vala index 225322d3..67828157 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -72,7 +72,7 @@ public class Jorts.Application : Gtk.Application { public Application () { Object (flags: ApplicationFlags.HANDLES_COMMAND_LINE, - application_id: Jorts.Constants.RDNN); + application_id: APP_ID); } /*************************************************/ @@ -155,7 +155,7 @@ Please wait while the app remembers all the things... /*************************************************/ static construct { - gsettings = new GLib.Settings (Jorts.Constants.RDNN); + gsettings = new GLib.Settings (APP_ID); } /*************************************************/ @@ -166,6 +166,11 @@ Please wait while the app remembers all the things... Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); Intl.textdomain (GETTEXT_PACKAGE); +#if HAS_GTK422 + support_save = true; + autosave_interval = 0; +#endif + //add_main_option_entries (CMD_OPTION_ENTRIES); manager = new Jorts.NoteManager (this); } @@ -266,7 +271,6 @@ Please wait while the app remembers all the things... return 0; } - hold (); activate (); return 0; } diff --git a/src/Config.vala.in b/src/Config.vala.in index a3c7bd42..53908282 100644 --- a/src/Config.vala.in +++ b/src/Config.vala.in @@ -1,2 +1,5 @@ public const string GETTEXT_PACKAGE = @GETTEXT_PACKAGE@; -public const string LOCALEDIR = @LOCALEDIR@; \ No newline at end of file +public const string LOCALEDIR = @LOCALEDIR@; +public const string APP_NAME = @APP_NAME@; +public const string APP_ID = @APP_ID@; +public const string APP_VERSION = @APP_VERSION@; \ No newline at end of file diff --git a/src/Constants.vala b/src/Constants.vala index c4b44850..48326315 100644 --- a/src/Constants.vala +++ b/src/Constants.vala @@ -1,9 +1,10 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ +//vala-lint=skip-file /** * I just dump all my constants here @@ -11,14 +12,11 @@ namespace Jorts.Constants { /*************************************************/ - const string RDNN = "io.github.elly_code.jorts"; - const string DONATE_LINK = "https://ko-fi.com/teamcons"; + const string DONATE_LINK = "https://ko-fi.com/teamcons/tip"; // signature theme #if HALLOWEEN const Jorts.Themes DEFAULT_THEME = Jorts.Themes.ORANGE; -#elif CLASSIC - const Jorts.Themes DEFAULT_THEME = Jorts.Themes.BANANA; #else const Jorts.Themes DEFAULT_THEME = Jorts.Themes.BLUEBERRY; #endif @@ -26,11 +24,14 @@ namespace Jorts.Constants { // in ms const int DEBOUNCE = 900; + // CSS + const string STYLE_THEMEDBUTTON = "themedbutton"; + // We need to say stop at some point const int ZOOM_MAX = 300; const int DEFAULT_ZOOM = 100; const int ZOOM_MIN = 20; - const bool DEFAULT_MONO = false; + const bool DEFAULT_MONO = false; // For new stickies const int DEFAULT_WIDTH = 290; @@ -47,6 +48,12 @@ namespace Jorts.Constants { const int DEFAULT_PREF_HEIGHT = 270; #endif + + // Autocomplete save me + const string KEY_SCRIBBLY = "scribbly-mode-active"; + const string KEY_HIDEBAR = "hide-bar"; + const string KEY_LIST = "list-item-start"; + // Used by random_emote () for the emote selection menu const string[] EMOTES = { "face-angel-symbolic", diff --git a/src/Objects/NoteData.vala b/src/Objects/NoteData.vala index bad5f1ca..fd833535 100644 --- a/src/Objects/NoteData.vala +++ b/src/Objects/NoteData.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ diff --git a/src/Objects/Themes.vala b/src/Objects/Themes.vala index ce763565..8c7c5564 100644 --- a/src/Objects/Themes.vala +++ b/src/Objects/Themes.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /*************************************************/ diff --git a/src/Objects/Zoom.vala b/src/Objects/Zoom.vala index 85e42cf2..65562d06 100644 --- a/src/Objects/Zoom.vala +++ b/src/Objects/Zoom.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /*************************************************/ diff --git a/src/Objects/Zoomkind.vala b/src/Objects/ZoomType.vala similarity index 77% rename from src/Objects/Zoomkind.vala rename to src/Objects/ZoomType.vala index 9c7657c7..28a2ee55 100644 --- a/src/Objects/Zoomkind.vala +++ b/src/Objects/ZoomType.vala @@ -1,21 +1,21 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /*************************************************/ /** * Used in a signal to tell windows in which way to change zoom */ - public enum Jorts.Zoomkind { + public enum Jorts.ZoomType { ZOOM_OUT, DEFAULT_ZOOM, ZOOM_IN, NONE; - public static Zoomkind from_delta (double delta) { + public static ZoomType from_delta (double delta) { if (delta == 0) {return NONE;} diff --git a/src/Services/ColorController.vala b/src/Services/ColorController.vala index ab718164..5eca0e22 100644 --- a/src/Services/ColorController.vala +++ b/src/Services/ColorController.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /*************************************************/ diff --git a/src/Services/NoteManager.vala b/src/Services/NoteManager.vala index 714ff51b..3dd283ea 100644 --- a/src/Services/NoteManager.vala +++ b/src/Services/NoteManager.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /** @@ -136,6 +136,9 @@ public class Jorts.NoteManager : Object { }; storage.save (array); +#if HAS_GTK422 + application.save (); +#endif } /*************************************************/ diff --git a/src/Services/ScribblyController.vala b/src/Services/ScribblyController.vala index 19e7970b..10c2d0db 100644 --- a/src/Services/ScribblyController.vala +++ b/src/Services/ScribblyController.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /*************************************************/ diff --git a/src/Services/Storage.vala b/src/Services/Storage.vala index faeacb3a..6d860218 100644 --- a/src/Services/Storage.vala +++ b/src/Services/Storage.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /** diff --git a/src/Services/ZoomController.vala b/src/Services/ZoomController.vala index 14cd4af7..f125a03b 100644 --- a/src/Services/ZoomController.vala +++ b/src/Services/ZoomController.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /*************************************************/ @@ -30,12 +30,12 @@ public class Jorts.ZoomController : Object { /** * Handler. Wraps a zoom enum into the correct function- */ - public void zoom_changed (Jorts.Zoomkind zoomkind) { + public void zoom_changed (Jorts.ZoomType zoomtype) { debug ("Zoom changed!"); - switch (zoomkind) { - case Zoomkind.ZOOM_IN: zoom_in (); return; // vala-lint=double-spaces - case Zoomkind.DEFAULT_ZOOM: zoom_default (); return; // vala-lint=double-spaces - case Zoomkind.ZOOM_OUT: zoom_out (); return; // vala-lint=double-spaces + switch (zoomtype) { + case ZoomType.ZOOM_IN: zoom_in (); return; // vala-lint=double-spaces + case ZoomType.DEFAULT_ZOOM: zoom_default (); return; // vala-lint=double-spaces + case ZoomType.ZOOM_OUT: zoom_out (); return; // vala-lint=double-spaces default: return; // vala-lint=double-spaces } } @@ -116,7 +116,7 @@ public class Jorts.ZoomController : Object { return Gdk.EVENT_PROPAGATE; } - zoom_changed (Zoomkind.from_delta (dy)); + zoom_changed (ZoomType.from_delta (dy)); debug ("Go! Zoooommmmm"); return Gdk.EVENT_PROPAGATE; diff --git a/src/Utils/Libportal.vala b/src/Utils/Libportal.vala index 719b1ea2..d74f7de2 100644 --- a/src/Utils/Libportal.vala +++ b/src/Utils/Libportal.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ namespace Jorts.Utils { diff --git a/src/Utils/Random.vala b/src/Utils/Random.vala index 8f462642..5518c68d 100644 --- a/src/Utils/Random.vala +++ b/src/Utils/Random.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /* CONTENT diff --git a/src/Views/NoteView.vala b/src/Views/NoteView.vala index d90966a7..60cff3f1 100644 --- a/src/Views/NoteView.vala +++ b/src/Views/NoteView.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ public class Jorts.NoteView : Gtk.Box { diff --git a/src/Views/PreferencesView.vala b/src/Views/PreferencesView.vala index 6d2a59af..0d58e0ad 100644 --- a/src/Views/PreferencesView.vala +++ b/src/Views/PreferencesView.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ public class Jorts.PreferencesView : Gtk.Box { @@ -63,8 +63,7 @@ lists_box.append (list_label); lists_box.append (list_entry); - Application.gsettings.bind ( - "list-item-start", + Application.gsettings.bind (Constants.KEY_LIST, list_entry, "text", SettingsBindFlags.DEFAULT); @@ -81,7 +80,7 @@ var scribbly_box = new Jorts.SettingsSwitch ( _("Scribble mode"), _("Scribble text of unfocused notes (Ctrl+H)"), - "scribbly-mode-active"); + Constants.KEY_SCRIBBLY); settingsbox.append (scribbly_box); @@ -94,7 +93,7 @@ ///TRANSLATORS: Instead of bottom bar you can also use "Action bar" or "button bar" _("Hide bottom bar"), _("Keyboard shortcuts will still function (Ctrl+T)"), - "hide-bar"); + Constants.KEY_HIDEBAR); settingsbox.append (hidebar_box); diff --git a/src/Widgets/ActionBar.vala b/src/Widgets/ActionBar.vala index 5866c08a..7d92e2b1 100644 --- a/src/Widgets/ActionBar.vala +++ b/src/Widgets/ActionBar.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /** @@ -31,7 +31,7 @@ ) }; new_item.action_name = Application.ACTION_PREFIX + Application.ACTION_NEW; - new_item.add_css_class ("themedbutton"); + new_item.add_css_class (Constants.STYLE_THEMEDBUTTON); var delete_item = new Gtk.Button () { icon_name = "edit-delete-symbolic", @@ -42,7 +42,7 @@ _("Delete sticky note") ) }; - delete_item.add_css_class ("themedbutton"); + delete_item.add_css_class (Constants.STYLE_THEMEDBUTTON); delete_item.action_name = StickyNoteWindow.ACTION_PREFIX + StickyNoteWindow.ACTION_DELETE; /* **** RIGHT **** */ @@ -55,7 +55,7 @@ _("Toggle list") ) }; - list_button.add_css_class ("themedbutton"); + list_button.add_css_class (Constants.STYLE_THEMEDBUTTON); list_button.action_name = StickyNoteWindow.ACTION_PREFIX + StickyNoteWindow.ACTION_TOGGLE_LIST; emojichooser_popover = new Gtk.EmojiChooser (); @@ -69,7 +69,7 @@ _("Insert emoji") ) }; - emoji_button.add_css_class ("themedbutton"); + emoji_button.add_css_class (Constants.STYLE_THEMEDBUTTON); emoji_button.popover = emojichooser_popover; menu_button = new Gtk.MenuButton () { @@ -82,7 +82,7 @@ ) }; menu_button.direction = Gtk.ArrowType.UP; - menu_button.add_css_class ("themedbutton"); + menu_button.add_css_class (Constants.STYLE_THEMEDBUTTON); /* **** Widget **** */ actionbar = new Gtk.ActionBar () { @@ -106,7 +106,7 @@ // Hide the list button if user has specified no list item symbol on_prefix_changed (); - Application.gsettings.changed["list-item-start"].connect (on_prefix_changed); + Application.gsettings.changed[Constants.KEY_LIST].connect (on_prefix_changed); } @@ -115,7 +115,9 @@ * StickyNoteWindow will decide itself whether to show immediately or not */ public void reveal_bind () { - Application.gsettings.bind ("hide-bar", this.actionbar, "revealed", SettingsBindFlags.INVERT_BOOLEAN); + Application.gsettings.bind (Constants.KEY_HIDEBAR, + this.actionbar, "revealed", + SettingsBindFlags.INVERT_BOOLEAN); } // Skip the current icon to avoid picking it twice @@ -130,6 +132,6 @@ } private void on_prefix_changed () { - list_button.visible = (Application.gsettings.get_string ("list-item-start") != ""); + list_button.visible = (Application.gsettings.get_string (Constants.KEY_LIST) != ""); } } diff --git a/src/Widgets/EditableLabel.vala b/src/Widgets/EditableLabel.vala index ae3a48d0..c8e854ff 100644 --- a/src/Widgets/EditableLabel.vala +++ b/src/Widgets/EditableLabel.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /** diff --git a/src/Widgets/Popover.vala b/src/Widgets/Popover.vala index aa8708e4..e158a3a9 100644 --- a/src/Widgets/Popover.vala +++ b/src/Widgets/Popover.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /** @@ -28,7 +28,7 @@ public class Jorts.Popover : Gtk.Popover { public int zoom { set {font_size_box.zoom = value;}} public signal void theme_changed (Jorts.Themes selected); - public signal void zoom_changed (Jorts.Zoomkind zoomkind); + public signal void zoom_changed (Jorts.ZoomType zoomtype); public signal void monospace_changed (bool if_monospace); static construct @@ -71,7 +71,7 @@ public class Jorts.Popover : Gtk.Popover { // Propagate settings changes to the higher level color_box.theme_changed.connect ((theme) => {theme_changed (theme);}); monospace_box.monospace_changed.connect (on_monospace_changed); - font_size_box.zoom_changed.connect ((zoomkind) => {zoom_changed (zoomkind);}); + font_size_box.zoom_changed.connect ((zoomtype) => {zoom_changed (zoomtype);}); // Allow scrolling shenanigans from popover var keypress_controller = new Gtk.EventControllerKey (); diff --git a/src/Widgets/PopoverWidgets/ColorBox.vala b/src/Widgets/PopoverWidgets/ColorBox.vala index 3e070eb9..f6776840 100644 --- a/src/Widgets/PopoverWidgets/ColorBox.vala +++ b/src/Widgets/PopoverWidgets/ColorBox.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /** diff --git a/src/Widgets/PopoverWidgets/ColorPill.vala b/src/Widgets/PopoverWidgets/ColorPill.vala index 8892e4d5..94beb0da 100644 --- a/src/Widgets/PopoverWidgets/ColorPill.vala +++ b/src/Widgets/PopoverWidgets/ColorPill.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /* diff --git a/src/Widgets/PopoverWidgets/MonospaceBox.vala b/src/Widgets/PopoverWidgets/MonospaceBox.vala index 6748fd7c..90735ae2 100644 --- a/src/Widgets/PopoverWidgets/MonospaceBox.vala +++ b/src/Widgets/PopoverWidgets/MonospaceBox.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /** diff --git a/src/Widgets/PopoverWidgets/ZoomBox.vala b/src/Widgets/PopoverWidgets/ZoomBox.vala index fb375f87..33b01d2c 100644 --- a/src/Widgets/PopoverWidgets/ZoomBox.vala +++ b/src/Widgets/PopoverWidgets/ZoomBox.vala @@ -1,14 +1,14 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /** * Horizontal box with a +, label, and -, representing zoom controls * Gives off zoom_changed signal to tell the user has clicked one of three -* The signal transmits a Jorts.Zoomkind Enum +* The signal transmits a Jorts.ZoomType Enum */ public class Jorts.ZoomBox : Gtk.Box { @@ -26,7 +26,7 @@ public class Jorts.ZoomBox : Gtk.Box { } } - public signal void zoom_changed (Jorts.Zoomkind zoomkind); + public signal void zoom_changed (Jorts.ZoomType zoomtype); construct { orientation = Gtk.Orientation.HORIZONTAL; @@ -69,14 +69,14 @@ public class Jorts.ZoomBox : Gtk.Box { } private void zoom_out () { - zoom_changed (Zoomkind.ZOOM_OUT); + zoom_changed (ZoomType.ZOOM_OUT); } private void zoom_default () { - zoom_changed (Zoomkind.DEFAULT_ZOOM); + zoom_changed (ZoomType.DEFAULT_ZOOM); } private void zoom_in () { - zoom_changed (Zoomkind.ZOOM_IN); + zoom_changed (ZoomType.ZOOM_IN); } } diff --git a/src/Widgets/PreferencesWidgets/SettingsSwitch.vala b/src/Widgets/PreferencesWidgets/SettingsSwitch.vala index 25d1d970..8e018dfd 100644 --- a/src/Widgets/PreferencesWidgets/SettingsSwitch.vala +++ b/src/Widgets/PreferencesWidgets/SettingsSwitch.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /** diff --git a/src/Widgets/TextView.vala b/src/Widgets/TextView.vala index c96a9d5a..bde1453b 100644 --- a/src/Widgets/TextView.vala +++ b/src/Widgets/TextView.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ /** diff --git a/src/Windows/PreferenceWindow.vala b/src/Windows/PreferenceWindow.vala index a838f3f7..298dc65b 100644 --- a/src/Windows/PreferenceWindow.vala +++ b/src/Windows/PreferenceWindow.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ @@ -24,6 +24,9 @@ public class Jorts.PreferenceWindow : Gtk.Window { application = app; +#if DEVEL + add_css_class ("devel"); +#endif /********************************************/ /* HEADERBAR BS */ diff --git a/src/Windows/StickyNoteWindow.vala b/src/Windows/StickyNoteWindow.vala index 4a76be8a..760a2f41 100644 --- a/src/Windows/StickyNoteWindow.vala +++ b/src/Windows/StickyNoteWindow.vala @@ -1,8 +1,8 @@ /* * SPDX-License-Identifier: GPL-3.0-or-later * SPDX-FileCopyrightText: 2017-2024 Lains - * 2025 Stella & Charlie (teamcons.carrd.co) * 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/) + * 2025-2026 Stella & Charlie (teamcons.carrd.co) */ @@ -13,8 +13,7 @@ * Can be packaged into a noteData file for convenient storage * Reports to the NoteManager for saving */ -public class Jorts.StickyNoteWindow : Gtk.Window { - +public class Jorts.StickyNoteWindow : Gtk.ApplicationWindow { public Jorts.NoteView view; public Popover popover; public TextView textview; @@ -63,6 +62,11 @@ public class Jorts.StickyNoteWindow : Gtk.Window { debug ("[STICKY NOTE] New StickyNoteWindow instance!"); application = app; +#if DEVEL + add_css_class ("devel"); +#endif + + var actions = new SimpleActionGroup (); actions.add_action_entries (ACTION_ENTRIES, this); insert_action_group ("win", actions); @@ -132,6 +136,12 @@ public class Jorts.StickyNoteWindow : Gtk.Window { } else { bind_hidebar (); } + +#if HAS_GTK422 + // Check what we can save + save_state.connect (on_save_state); + restore_state.connect (on_restore_state); +#endif } @@ -215,4 +225,24 @@ public class Jorts.StickyNoteWindow : Gtk.Window { private void action_zoom_out () {zoom_controller.zoom_out ();} private void action_zoom_default () {zoom_controller.zoom_default ();} private void action_zoom_in () {zoom_controller.zoom_in ();} + +#if HAS_GTK422 + 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; + } +#endif } diff --git a/src/meson.build b/src/meson.build index faa95d87..79fd70cc 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,5 +1,5 @@ sources = files ( - 'Objects' / 'Zoomkind.vala', + 'Objects' / 'ZoomType.vala', 'Objects' / 'Zoom.vala', 'Objects' / 'Themes.vala', 'Objects' / 'NoteData.vala', @@ -44,7 +44,7 @@ endif # win_subsystem doesnt seem to bother standard builds executable( - meson.project_name(), + app_id, gresource, config_file, sources,