Skip to content
Merged
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
90 changes: 45 additions & 45 deletions data/Application.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,65 +77,65 @@ window.scribbly editablelabel {
}

/* Font zooms */
window.s20 textview.view {font-size: 40%;}
window.s20 editablelabel {font-size: 25%;}
window.s20 editablelabel.editing {font-size: 20%;}
.s20 textview.view {font-size: 40%;}
.s20 editablelabel {font-size: 25%;}
.s20 editablelabel.editing {font-size: 20%;}

window.s40 textview.view {font-size: 60%;}
window.s40 editablelabel {font-size: 45%;}
window.s40 editablelabel.editing {font-size: 40%;}
.s40 textview.view {font-size: 60%;}
.s40 editablelabel {font-size: 45%;}
.s40 editablelabel.editing {font-size: 40%;}

window.s60 textview.view {font-size: 80%;}
window.s60 editablelabel {font-size: 65%;}
window.s60 editablelabel.editing {font-size: 60%;}
.s60 textview.view {font-size: 80%;}
.s60 editablelabel {font-size: 65%;}
.s60 editablelabel.editing {font-size: 60%;}

window.s80 textview.view {font-size: 100%;}
window.s80 editablelabel {font-size: 85%;}
window.s80 editablelabel.editing {font-size: 80%;}
.s80 textview.view {font-size: 100%;}
.s80 editablelabel {font-size: 85%;}
.s80 editablelabel.editing {font-size: 80%;}

window.s100 textview.view {font-size: 120%;}
window.s100 editablelabel {font-size: 105%;}
window.s100 editablelabel.editing {font-size: 100%;}
.s100 textview.view {font-size: 120%;}
.s100 editablelabel {font-size: 105%;}
.s100 editablelabel.editing {font-size: 100%;}

window.s120 textview.view {font-size: 140%;}
window.s120 editablelabel {font-size: 125%;}
window.s120 editablelabel.editing {font-size: 120%;}
.s120 textview.view {font-size: 140%;}
.s120 editablelabel {font-size: 125%;}
.s120 editablelabel.editing {font-size: 120%;}

window.s140 textview.view {font-size: 160%;}
window.s140 editablelabel {font-size: 145%;}
window.s140 editablelabel.editing {font-size: 140%;}
.s140 textview.view {font-size: 160%;}
.s140 editablelabel {font-size: 145%;}
.s140 editablelabel.editing {font-size: 140%;}

window.s160 textview.view {font-size: 180%;}
window.s160 editablelabel {font-size: 165%;}
window.s160 editablelabel.editing {font-size: 160%;}
.s160 textview.view {font-size: 180%;}
.s160 editablelabel {font-size: 165%;}
.s160 editablelabel.editing {font-size: 160%;}

window.s180 textview.view {font-size: 200%;}
window.s180 editablelabel {font-size: 185%;}
window.s180 editablelabel.editing {font-size: 180%;}
.s180 textview.view {font-size: 200%;}
.s180 editablelabel {font-size: 185%;}
.s180 editablelabel.editing {font-size: 180%;}

window.s200 textview.view {font-size: 220%;}
window.s200 editablelabel {font-size: 205%;}
window.s200 editablelabel.editing {font-size: 200%;}
.s200 textview.view {font-size: 220%;}
.s200 editablelabel {font-size: 205%;}
.s200 editablelabel.editing {font-size: 200%;}

window.s220 textview.view {font-size: 240%;}
window.s220 editablelabel {font-size: 225%;}
window.s220 editablelabel.editing {font-size: 220%;}
.s220 textview.view {font-size: 240%;}
.s220 editablelabel {font-size: 225%;}
.s220 editablelabel.editing {font-size: 220%;}

window.s240 textview.view {font-size: 260%;}
window.s240 editablelabel {font-size: 245%;}
window.s240 editablelabel.editing {font-size: 240%;}
.s240 textview.view {font-size: 260%;}
.s240 editablelabel {font-size: 245%;}
.s240 editablelabel.editing {font-size: 240%;}

window.s260 textview.view {font-size: 280%;}
window.s260 editablelabel {font-size: 265%;}
window.s260 editablelabel.editing {font-size: 260%;}
.s260 textview.view {font-size: 280%;}
.s260 editablelabel {font-size: 265%;}
.s260 editablelabel.editing {font-size: 260%;}

window.s280 textview.view {font-size: 300%;}
window.s280 editablelabel {font-size: 285%;}
window.s280 editablelabel.editing {font-size: 280%;}
.s280 textview.view {font-size: 300%;}
.s280 editablelabel {font-size: 285%;}
.s280 editablelabel.editing {font-size: 280%;}

window.s300 textview.view {font-size: 320%;}
window.s300 editablelabel {font-size: 305%;}
window.s300 editablelabel.editing {font-size: 300%;}
.s300 textview.view {font-size: 320%;}
.s300 editablelabel {font-size: 305%;}
.s300 editablelabel.editing {font-size: 300%;}


/* ANIMATION */
Expand Down
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 @@ -3,7 +3,7 @@ id: io.github.ellie_commons.jorts
base: io.elementary.BaseApp
base-version: 'circe-25.08'
runtime: org.gnome.Platform
runtime-version: '50beta'
runtime-version: '49'
sdk: org.gnome.Sdk
command: io.github.ellie_commons.jorts

Expand All @@ -17,7 +17,6 @@ cleanup:
- '/include'
- '/lib/pkgconfig'
- '/man'
- '/share/doc'
- '/share/gtk-doc'
- '/share/man'
- '/share/pkgconfig'
Expand Down
1 change: 0 additions & 1 deletion io.github.elly_code.jorts.devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ cleanup:
- '/include'
- '/lib/pkgconfig'
- '/man'
- '/share/doc'
- '/share/gtk-doc'
- '/share/man'
- '/share/pkgconfig'
Expand Down
8 changes: 3 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Name our project
project(
'io.github.elly_code.jorts',
'jorts',
'vala', 'c',
version: '4.0.2'
)

app_name = 'Jorts'


correct_app_id = 'io.github.elly_code.jorts'
legacy_app_id = 'io.github.ellie_commons.jorts'
correct_app_id = 'io.github.elly_code.' + meson.project_name()
legacy_app_id = 'io.github.ellie_commons.' + meson.project_name()

if get_option('legacy-rdnn')
app_id = legacy_app_id
Expand Down
76 changes: 25 additions & 51 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class Jorts.Application : Gtk.Application {
public static GLib.Settings gsettings;
public static Gtk.Settings gtk_settings;

public Jorts.NoteManager manager;
public Jorts.NoteManager note_manager;
public static Jorts.PreferenceWindow? preferences;

// Used for commandline option handling
Expand All @@ -53,7 +53,6 @@ public class Jorts.Application : Gtk.Application {

public const string ACTION_PREFIX = "app.";
public const string ACTION_QUIT = "action_quit";
public const string ACTION_NEW = "action_new";
public const string ACTION_TOGGLE_SCRIBBLY = "action_toggle_scribbly";
public const string ACTION_TOGGLE_ACTIONBAR = "action_toggle_actionbar";
public const string ACTION_SHOW_PREFERENCES = "action_show_preferences";
Expand All @@ -63,18 +62,33 @@ public class Jorts.Application : Gtk.Application {

private const GLib.ActionEntry[] ACTION_ENTRIES = {
{ ACTION_QUIT, quit},
{ ACTION_NEW, action_new },
{ ACTION_TOGGLE_SCRIBBLY, action_toggle_scribbly},
{ ACTION_TOGGLE_ACTIONBAR, action_toggle_actionbar},
{ ACTION_SHOW_PREFERENCES, action_show_preferences},
{ ACTION_SAVE, action_save},
};

public Application () {
Object (flags: ApplicationFlags.HANDLES_COMMAND_LINE,
application_id: APP_ID);
}


/*************************************************/
static construct {
gsettings = new GLib.Settings (APP_ID);
}

/*************************************************/
construct {
// The localization thingamabob
Intl.setlocale (LocaleCategory.ALL, "");
Intl.bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
Intl.textdomain (GETTEXT_PACKAGE);
}



/*************************************************/
public override void startup () {
debug ("Jorts Startup…");
Expand All @@ -84,31 +98,18 @@ public class Jorts.Application : Gtk.Application {

add_action_entries (ACTION_ENTRIES, this);
set_accels_for_action ("app.action_quit", {"<Control>Q"});
set_accels_for_action ("app.action_new", {"<Control>N"});
set_accels_for_action ("app.action_save", {"<Control>S"});
set_accels_for_action ("app.action_toggle_actionbar", {"<Control>T"});
set_accels_for_action ("app.action_show_preferences", {"<Control>P"});
set_accels_for_action ("app.action_toggle_scribbly", {"<Control>H"});

set_accels_for_action ("win.action_delete", {"<Control>W"});
set_accels_for_action ("win.action_zoom_out", {"<Control>minus", "<Control>KP_Subtract"});
set_accels_for_action ("win.action_zoom_default", {"<Control>equal", "<Control>0", "<Control>KP_0"});
set_accels_for_action ("win.action_zoom_in", {"<Control>plus", "<Control>KP_Add"});
set_accels_for_action ("win.action_toggle_mono", {"<Control>m"});
set_accels_for_action ("win.action_focus_title", {"<Control>L"});
set_accels_for_action ("win.action_show_emoji", {"<Control>period"});
set_accels_for_action ("win.action_toggle_list", {"<Shift>F12"});
set_accels_for_action ("win.action_show_menu", {"<Control>G", "<Control>O"});

set_accels_for_action ("textview.action_toggle_list", {"<Shift>F12"});


note_manager = new Jorts.NoteManager (this);
add_action_entries (NoteManager.ACTION_ENTRIES, note_manager);

// Force the eOS icon theme, and set the blueberry as fallback, if for some reason it fails for individual notes
var granite_settings = Granite.Settings.get_default ();
gtk_settings = Gtk.Settings.get_default ();
gtk_settings.gtk_icon_theme_name = "elementary";
gtk_settings.gtk_theme_name = "io.elementary.stylesheet." + Jorts.Constants.DEFAULT_THEME.to_string ().ascii_down ();
gtk_settings.gtk_theme_name = "io.elementary.stylesheet." + DEFAULT_THEME.to_string ().ascii_down ();

// Also follow dark if system is dark lIke mY sOul.
gtk_settings.gtk_application_prefer_dark_theme = (
Expand Down Expand Up @@ -153,23 +154,6 @@ Please wait while the app remembers all the things...
);
}

/*************************************************/
static construct {
gsettings = new GLib.Settings (APP_ID);
}

/*************************************************/
construct {
// The localization thingamabob
Intl.setlocale (LocaleCategory.ALL, "");
Intl.bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
Intl.textdomain (GETTEXT_PACKAGE);

//add_main_option_entries (CMD_OPTION_ENTRIES);
manager = new Jorts.NoteManager (this);
}

// Clicked: Either show all windows, or rebuild from storage
protected override void activate () {
debug ("[JORTS] Jorts, activate!");
Expand All @@ -178,27 +162,22 @@ Please wait while the app remembers all the things...
//GLib.Environment.set_variable ("LANGUAGE", "pt_br", true);

/* Either we show all sticky notes, or we load everything lol */
if (manager.open_notes.size > 0) {
foreach (var window in manager.open_notes) {
if (note_manager.open_notes.size > 0) {
foreach (var window in note_manager.open_notes) {
if (window.visible) {window.present ();}
}
} else {
manager.init ();
note_manager.init ();
}

if (new_note) {manager.create_note (); new_note = false;}
if (new_note) {note_manager.create_note (); new_note = false;}
if (show_pref) {action_show_preferences (); show_pref = false;}
}

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

private void action_new () {
debug ("New Note");
manager.create_note ();
}

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

Expand All @@ -223,11 +202,6 @@ Please wait while the app remembers all the things...
gsettings.set_boolean ("hide-bar", !current);
}

private void action_save () {
debug ("Saving...");
manager.save_all ();
}

// checked upon window closing to make sure we do not linger in the background
public void check_if_quit () {
debug ("Windows open: %s".printf (get_windows ().length ().to_string ()));
Expand Down
3 changes: 2 additions & 1 deletion src/Constants.vala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* I just dump all my constants here
*/
namespace Jorts.Constants {
namespace Jorts {

/*************************************************/
const string DONATE_LINK = "https://ko-fi.com/teamcons/tip";
Expand Down Expand Up @@ -40,6 +40,7 @@ namespace Jorts.Constants {

const int SPACING_STANDARD = 5;
const int SPACING_DOUBLE = 10;
const int SPACING_TRIPLE = 15;

// Autocomplete save me
const string KEY_SCRIBBLY = "scribbly-mode-active";
Expand Down
22 changes: 11 additions & 11 deletions src/Objects/NoteData.vala
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
public class Jorts.NoteData : Object {

// Will determine properties (or lack thereof) for any new note
public static Jorts.Themes latest_theme = Jorts.Constants.DEFAULT_THEME;
public static int latest_zoom = Jorts.Constants.DEFAULT_ZOOM;
public static bool latest_mono = Jorts.Constants.DEFAULT_MONO;
public static Jorts.Themes latest_theme = DEFAULT_THEME;
public static int latest_zoom = DEFAULT_ZOOM;
public static bool latest_mono = DEFAULT_MONO;

public string? title;
public Jorts.Themes? theme;
Expand All @@ -36,8 +36,8 @@ public class Jorts.NoteData : Object {
this.content = content ?? "";
this.monospace = monospace ?? latest_mono;
this.zoom = zoom ?? latest_zoom;
this.width = width ?? Jorts.Constants.DEFAULT_WIDTH;
this.height = height ?? Jorts.Constants.DEFAULT_HEIGHT;
this.width = width ?? DEFAULT_WIDTH;
this.height = height ?? DEFAULT_HEIGHT;
}

/*************************************************/
Expand All @@ -48,15 +48,15 @@ public class Jorts.NoteData : Object {
title = node.get_string_member_with_default ("title", (_("Forgot title!")));
theme = (Jorts.Themes)node.get_int_member_with_default ("color", Jorts.Themes.random_theme ());
content = node.get_string_member_with_default ("content","");
monospace = node.get_boolean_member_with_default ("monospace", Jorts.Constants.DEFAULT_MONO);
zoom = (int)node.get_int_member_with_default ("zoom", Jorts.Constants.DEFAULT_ZOOM);
monospace = node.get_boolean_member_with_default ("monospace", DEFAULT_MONO);
zoom = (int)node.get_int_member_with_default ("zoom", DEFAULT_ZOOM);

// Make sure the values are nothing crazy
if (zoom < Jorts.Constants.ZOOM_MIN) { zoom = Jorts.Constants.ZOOM_MIN;}
else if (zoom > Jorts.Constants.ZOOM_MAX) { zoom = Jorts.Constants.ZOOM_MAX;}
if (zoom < ZOOM_MIN) { zoom = ZOOM_MIN;}
else if (zoom > ZOOM_MAX) { zoom = ZOOM_MAX;}

width = (int)node.get_int_member_with_default ("width", Jorts.Constants.DEFAULT_WIDTH);
height = (int)node.get_int_member_with_default ("height", Jorts.Constants.DEFAULT_HEIGHT);
width = (int)node.get_int_member_with_default ("width", DEFAULT_WIDTH);
height = (int)node.get_int_member_with_default ("height", DEFAULT_HEIGHT);
}

/*************************************************/
Expand Down
2 changes: 1 addition & 1 deletion src/Services/ColorController.vala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class Jorts.ColorController : Object {
Application.gtk_settings.gtk_theme_name = stylesheet;

// Cleanup;
window.changed ();
window.has_changed ();
}

/**
Expand Down
Loading
Loading