~fabrixxm/oliver

b7e3f546e97ba433272dd9847097e69bd4cd4fe6 — fabrixxm 6 months ago e30a189
osx custom theme and decorations layout

on osx set custom theme in launcher, set decoration layout in app
M macos/build.py => macos/build.py +5 -0
@@ 82,6 82,11 @@ for gschemafile in GSCHEMAS:
    shutil.copy(gschemafile, f'{APPDIR}/Contents/Resources/share/glib-2.0/schemas/{os.path.basename(gschemafile)}')
print("\r[•]")

# Add Theme
print("[ ] Copy theme", end="")
shutil.copytree("themes", f'{APPDIR}/Contents/Resources/share/')
print("\r[•]")

# Build .app bundle
print("[ ] Build bundle ...")
deploy_with_deps(APPDIR, bin)

M macos/launcher.sh => macos/launcher.sh +4 -0
@@ 40,6 40,10 @@ export GDK_PIXBUF_MODULE_FILE="$bundle_lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
export PANGO_LIBDIR="$bundle_lib"
export PANGO_SYSCONFDIR="$bundle_etc"

# osx-like theme 
export GTK_THEME="WhiteSur-Light"


APP=$name
I18NDIR="$bundle_data/locale"
# Set the locale-related variables appropriately:

A macos/themes/WhiteSur-Light/gtk-4.0/gtk-dark.css => macos/themes/WhiteSur-Light/gtk-4.0/gtk-dark.css +1 -0
@@ 0,0 1,1 @@
@import url("resource:///org/gnome/theme/gtk-dark.css");

A macos/themes/WhiteSur-Light/gtk-4.0/gtk.css => macos/themes/WhiteSur-Light/gtk-4.0/gtk.css +1 -0
@@ 0,0 1,1 @@
@import url("resource:///org/gnome/theme/gtk.css");

A macos/themes/WhiteSur-Light/gtk-4.0/gtk.gresource => macos/themes/WhiteSur-Light/gtk-4.0/gtk.gresource +0 -0
A macos/themes/WhiteSur-Light/gtk-4.0/thumbnail.png => macos/themes/WhiteSur-Light/gtk-4.0/thumbnail.png +0 -0
A macos/themes/WhiteSur-Light/index.theme => macos/themes/WhiteSur-Light/index.theme +13 -0
@@ 0,0 1,13 @@
[Desktop Entry]
Type=X-GNOME-Metatheme
Name=WhiteSur-Light
Comment=A MacOS BigSur like Gtk+ theme based on Elegant Design
Encoding=UTF-8

[X-GNOME-Metatheme]
GtkTheme=WhiteSur-Light
MetacityTheme=WhiteSur-Light
IconTheme=WhiteSur
CursorTheme=WhiteSur-cursors
ButtonLayout=close,minimize,maximize:menu


M scripts/run_local.sh => scripts/run_local.sh +1 -1
@@ 10,4 10,4 @@ glib-compile-schemas --strict builddir/data

export GSETTINGS_SCHEMA_DIR=builddir/data
export G_MESSAGES_DEBUG=all
builddir/src/net.kirgroup.Oliver $@
\ No newline at end of file
builddir/src/net.kirgroup.Oliver $@

M src/application.vala => src/application.vala +4 -0
@@ 52,10 52,14 @@ namespace Oliver {

            this.is_osx = Environment.get_os_info (OsInfoKey.NAME) == "macOS";
            this.is_linux = !this.is_osx;

        }

        public override void activate () {
            base.activate ();
            if (this.is_osx) {
                Gtk.Settings.get_default ().gtk_decoration_layout = "close,minimize,maximize:menu";
            }
            var win = this.active_window;
            if (win == null) {
                win = new Window (this);