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
8 changes: 6 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ i18n = import('i18n')

add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (app_id), language:'c')
windows_build = build_machine.system() == 'windows'
macos_build = build_machine.system() == 'darwin'


#================================
Expand All @@ -61,6 +62,8 @@ endif
# Windows needs icons, special arguments, and skip libportal
if windows_build
vala_flags += ['--define', 'WINDOWS']
elif macos_build
vala_flags += ['--define', 'MACOS']
endif

# Hot fixes for flathub builds
Expand Down Expand Up @@ -111,7 +114,8 @@ dependencies = [
if windows_build
dependencies += dependency('gio-windows-2.0')
ico_src = import('windows').compile_resources('windows/icons/ico.rc')

elif macos_build
dependencies += dependency('gio-unix-2.0')
else
dependencies += dependency('gio-unix-2.0')
dependencies += dependency('libportal')
Expand All @@ -128,5 +132,5 @@ subdir('src')
gnome.post_install(
glib_compile_schemas: true,
gtk_update_icon_cache: true,
update_desktop_database: true
update_desktop_database: not macos_build
)
9 changes: 7 additions & 2 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ public class Jorts.Application : Gtk.Application {
debug ("Jorts Startup…");
base.startup ();
Gtk.init ();
Granite.init ();

#if !MACOS
Granite.init ();
#endif
add_action_entries (ACTION_ENTRIES, this);
set_accels_for_action ("app.action_quit", {"<Control>Q"});
set_accels_for_action ("app.action_new", {"<Control>N"});
Expand All @@ -105,11 +107,14 @@ public class Jorts.Application : Gtk.Application {


// Force the eOS icon theme, and set the blueberry as fallback, if for some reason it fails for individual notes
#if !MACOS
var granite_settings = Granite.Settings.get_default ();
#endif
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 ();

#if !MACOS
// Also follow dark if system is dark lIke mY sOul.
gtk_settings.gtk_application_prefer_dark_theme = (
granite_settings.prefers_color_scheme == DARK
Expand All @@ -120,7 +125,7 @@ public class Jorts.Application : Gtk.Application {
granite_settings.prefers_color_scheme == DARK
);
});

#endif
print ("""
🎉✨ ACTIVATING: SUPER COOL JORTS 😎🔥❗🎶🤌
Your Notes are all belong to us!
Expand Down
2 changes: 1 addition & 1 deletion src/Views/PreferencesView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
/****************************************************/
/* Autostart Request */
/****************************************************/
#if !WINDOWS
#if !WINDOWS && !MACOS
var both_buttons = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 5) {
halign = Gtk.Align.FILL
};
Expand Down
2 changes: 2 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ sources = files (

if windows_build
sources += ico_src
elif macos_build
# noop
else
sources += files('Utils' / 'Libportal.vala')
endif
Expand Down