Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
9 changes: 3 additions & 6 deletions data/icons/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,18 @@ foreach i : icon_sizes
icon_variant / 'hicolor' / i + '.png',
install_dir: datadir / 'icons' / 'hicolor' / i + 'x' + i / 'apps',
rename: app_id + '.png'
)
)

install_data(
icon_variant / 'hicolor@2' / i + '@2.png',
install_dir: datadir / 'icons' / 'hicolor' / i + 'x' + i + '@2' / 'apps',
rename: app_id + '.png'
)
)

endforeach

install_data(
icon_variant / 'scalable.svg',
install_dir: datadir / 'icons' / 'scalable' / 'apps',
rename: app_id + '.svg'
)



)
15 changes: 7 additions & 8 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ gresource_file = configure_file(
input: app_name + '.gresource.xml.in',
output: app_id + '.gresource.xml',
configuration: config_data,
)
)

gresource = gnome.compile_resources(
'gresource',
gresource_file,
source_dir: '.'
)
)


#========================
Expand All @@ -30,7 +30,7 @@ gschema_file = configure_file(
install_data(
gschema_file,
install_dir: datadir / 'glib-2.0' / 'schemas'
)
)


#========================
Expand Down Expand Up @@ -62,7 +62,7 @@ desktop_file_in = configure_file(
input: app_name + '.desktop.in.in',
output: app_id + '.desktop.in',
configuration: config_data,
)
)

desktop_file = i18n.merge_file(
input: desktop_file_in,
Expand All @@ -71,7 +71,7 @@ desktop_file = i18n.merge_file(
type: 'desktop',
install: true,
install_dir: datadir / 'applications',
)
)


#========================
Expand All @@ -82,7 +82,7 @@ appstream_file_in = configure_file(
input: app_name + '.metainfo.xml.in.in',
output: app_id + '.metainfo.xml.in',
configuration: config_data,
)
)

appstream_file = i18n.merge_file(
input: appstream_file_in,
Expand All @@ -91,5 +91,4 @@ appstream_file = i18n.merge_file(
type: 'xml',
install: true,
install_dir: datadir / 'metainfo',
)

)
3 changes: 1 addition & 2 deletions io.github.ellie_commons.jorts.flathub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ cleanup:
- /share/gir-1.0
- /share/vala

# Cleanup development-related files inherited from the BaseApp to reduce package size of your app.
cleanup-commands:
- /app/cleanup-BaseApp.sh

Expand All @@ -29,8 +28,8 @@ modules:
buildsystem: meson
config-opts:
- --buildtype=release
- -Dlegacy_rdnn=true
- -Dicon_variant=default
- -Dlegacy_rdnn=true
sources:
- type: dir
path: .
2 changes: 1 addition & 1 deletion io.github.elly_code.jorts.devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ modules:
buildsystem: meson
config-opts:
- --buildtype=debug
- -Ddevelopment=true
- -Dicon_variant=default
- -Ddevelopment=true
sources:
- type: dir
path: .
18 changes: 11 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
project(
'jorts',
['c', 'vala'], # The floor is vala
['c', 'vala'], # The floor is vala
license: 'GPL-3.0-or-later',
version: '4.3.0', # Versioning: first should follow Gtk version, second and third depending how proud you are of the update
meson_version: '>= 1.1' # Use meson.option instead of meson_options.txt
)
)

app_name = meson.project_name()
app_version = meson.project_version()
Expand Down Expand Up @@ -48,7 +48,12 @@ endif

gnome = import('gnome')
i18n = import('i18n')
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (app_id), language:'c')
add_project_arguments(
'-DGETTEXT_PACKAGE="@0@"'.format (app_id), #
'-DG_LOG_DOMAIN="@0@"'.format (app_id), # Dev builds add the app_id to G_MESSAGES_DEBUG
'-w', # Because of Vala we get ten thousand warnings we can do nothing about
language:'c'
)


# Play nice with clang
Expand Down Expand Up @@ -84,7 +89,6 @@ build_machine_system = build_machine.system()

if build_machine_system == 'windows'
windows = true

endif

# Here is to adjust the project accordingly to stuff
Expand Down Expand Up @@ -116,8 +120,8 @@ config_data = configuration_data(
'PUBLISHER': publisher,
'ALTERNATE_APP_ID': alternate_app_id,
'LOCALEDIR': prefix / get_option('localedir')
}
)
}
)

subdir('po')
subdir('data')
Expand All @@ -134,4 +138,4 @@ gnome.post_install(
glib_compile_schemas: true,
gtk_update_icon_cache: true,
update_desktop_database: true
)
)
1 change: 1 addition & 0 deletions po/POTFILES
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ src/Views/PreferencesView.vala
src/Widgets/ActionBar.vala
src/Widgets/EditableLabel.vala
src/Widgets/EditableLabel.vala
src/Widgets/HyperTextView.vala
src/Widgets/Popover.vala
src/Widgets/PopoverWidgets/ColorBox.vala
src/Widgets/PopoverWidgets/MonospaceBox.vala
Expand Down
20 changes: 0 additions & 20 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ public class Jorts.Application : Gtk.Application {
Intl.bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
Intl.textdomain (GETTEXT_PACKAGE);

#if DEVEL
//GLib.Environment.set_variable ("LANGUAGE", "C", true);
GLib.Environment.set_variable ("GTK_DEBUG", "interactive", true);
//print (LOCALEDIR);
#endif
}

/*************************************************/
Expand Down Expand Up @@ -140,16 +134,6 @@ public class Jorts.Application : Gtk.Application {
);
});

print ("""
🎉✨ ACTIVATING: SUPER COOL JORTS 😎🔥❗🎶🤌
Your Notes are all belong to us!
_ _
(\o/) (\o/) <--- Tiny electric angels working in the background
/_\ /_\

Please wait while the app remembers all the things…
""");

/* Quit if all sticky notes are closed and preferences arent shown */
window_removed.connect (check_if_quit);

Expand Down Expand Up @@ -194,10 +178,6 @@ Please wait while the app remembers all the things…
if (show_pref) {action_show_preferences (); show_pref = false;}
}

public static int main (string[] args) {
return new Application ().run (args);
}

private void action_show_preferences () {
debug ("Showing preferences!");

Expand Down
25 changes: 25 additions & 0 deletions src/Interfaces/Zoomable.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* SPDX-FileCopyrightText: 2017-2024 Lains
* 2025 Contributions from the ellie_Commons community (github.com/ellie-commons/)
* 2025-2026 Stella & Charlie (teamcons.carrd.co)
*/

/*************************************************/
/**
* Implemented by childs of ZoomedWindow
*/
public interface Jorts.Zoomable : Gtk.Widget {

/**
* Called by ZoomedWindow after changing zoom value.
*
* The default implementation does nothing.
*
* If you need to do some changes, such as display the new value, or refresh some displayed elements, override this.
*/
public virtual void on_zoom_changed (int new_zoom) {
debug ("Zoom changed: %i", new_zoom);
return;
}
}
2 changes: 1 addition & 1 deletion src/Services/ColorController.vala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
public class Jorts.ColorController : Object {

private weak Jorts.StickyNoteWindow window;
private unowned Jorts.StickyNoteWindow window;

private Jorts.Themes _theme;
public Jorts.Themes theme {
Expand Down
12 changes: 8 additions & 4 deletions src/Services/NoteManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ public class Jorts.NoteManager : Object {
private static bool saving_lock = true;
private static NoteData? last_deleted = null;

private Jorts.Application application;
public Gee.ArrayList<StickyNoteWindow> open_notes;
private unowned Jorts.Application application;
public Gee.ArrayList<unowned StickyNoteWindow> open_notes;
public Jorts.Storage storage;

public NoteManager (Jorts.Application app) {
this.application = app;
}

construct {
open_notes = new Gee.ArrayList<StickyNoteWindow> ();
open_notes = new Gee.ArrayList<unowned StickyNoteWindow> ();
storage = new Jorts.Storage ();
}

Expand All @@ -40,6 +40,7 @@ public class Jorts.NoteManager : Object {
Json.Array loaded_data = storage.load ();

if (loaded_data.get_length () == 0) {

var note_data = new NoteData ();
note_data.theme = DEFAULT_THEME;

Expand Down Expand Up @@ -103,6 +104,9 @@ public class Jorts.NoteManager : Object {
application.remove_window ((Gtk.Window)note);

note.close ();
note.dispose ();
note.destroy ();
note = null;

immediately_save ();
}
Expand Down Expand Up @@ -131,7 +135,7 @@ public class Jorts.NoteManager : Object {
public void immediately_save () {
var array = new Json.Array ();

foreach (Jorts.StickyNoteWindow note in open_notes) {
foreach (unowned Jorts.StickyNoteWindow note in open_notes) {
var data = note.packaged ();
var object = data.to_json ();
array.add_object_element (object);
Expand Down
2 changes: 1 addition & 1 deletion src/Services/ScribblyController.vala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class Jorts.ScribblyController : Object {

private const string STYLE_SCRIBBLED = "scribbled";
private weak Jorts.StickyNoteWindow window;
private unowned Jorts.StickyNoteWindow window;

private bool _scribble;
public bool scribble {
Expand Down
21 changes: 17 additions & 4 deletions src/Views/NoteView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2025-2026 Stella & Charlie (teamcons.carrd.co)
*/

public class Jorts.NoteView : Gtk.Box {
public class Jorts.NoteView : Gtk.Box, Zoomable {
public Gtk.HeaderBar headerbar;
public Jorts.EditableLabel editablelabel;
public Jorts.TextView textview;
Expand Down Expand Up @@ -67,9 +67,6 @@
app.set_accels_for_action (ACTION_PREFIX + ACTION_SHOW_MENU, {"<Control>G", "<Control>O"});
app.set_accels_for_action (ACTION_PREFIX + ACTION_TOGGLE_MONO, {"<Control>m"});




orientation = VERTICAL;
spacing = 0;

Expand Down Expand Up @@ -141,7 +138,23 @@
private void action_show_menu () {menu_button.activate ();}
private void action_toggle_mono () {monospace = !monospace;}

public void on_zoom_changed (int new_zoom) {
textview.queue_refresh_indentation ();

// Adapt headerbar size to avoid weird flickering
headerbar.height_request = Jorts.Zoom.from_int (new_zoom).to_ui_size ();

// Reflect the number in the popover
popover.zoom = new_zoom;

// Keep it for next new notes
NoteData.latest_zoom = new_zoom;

//window.has_changed ();
}

~NoteView () {
actionbar.destroy ();
debug ("Destroyed");
}
}
Loading