From bdf2397cda818dcfaffc7cbf7140f3a553cec4bd Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 11:22:15 +0200 Subject: [PATCH 001/149] add first run gshema --- data/com.github.AdwCustomizerTeam.AdwCustomizer.gschema.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.gschema.xml b/data/com.github.AdwCustomizerTeam.AdwCustomizer.gschema.xml index 16539ddce..fe28f5558 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.gschema.xml +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.gschema.xml @@ -13,5 +13,8 @@ false + + true + \ No newline at end of file From 449afa7fd337048fae1f3d1dbe321896f3abbece Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 11:30:32 +0200 Subject: [PATCH 002/149] add view switcher : WIP --- src/ui/window.blp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index 0562b4d13..2074ffb6f 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -36,6 +36,11 @@ template AdwcustomizerMainWindow : ApplicationWindow { label: _("Presets"); } + [title] + Adw.ViewSwitcherTitle view-switcher { + stack: stack + } + [end] MenuButton { icon-name: "open-menu-symbolic"; @@ -50,7 +55,15 @@ template AdwcustomizerMainWindow : ApplicationWindow { } }; - Adw.PreferencesPage content { } + Box { + Adw.ViewStack stack { + MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + } + Adw.PreferencesPage content { } + } } menu presets-menu { From f064ffd831ce64f9273123ae9853d1ed9eef96a9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 11:31:28 +0200 Subject: [PATCH 003/149] update --- src/ui/window.blp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index 2074ffb6f..d29835c9f 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -30,12 +30,6 @@ template AdwcustomizerMainWindow : ApplicationWindow { // tooltip-text: _("Presets"); // } - [title] - MenuButton presets-dropdown { - menu-model: presets-menu; - label: _("Presets"); - } - [title] Adw.ViewSwitcherTitle view-switcher { stack: stack From 7b0e86e13cfdb249d0d712036f7aa4497af40ca8 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 12:17:28 +0200 Subject: [PATCH 004/149] rework ui --- src/ui/window.blp | 163 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 115 insertions(+), 48 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index d29835c9f..9048ead61 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -1,62 +1,116 @@ using Gtk 4.0; using Adw 1; -template AdwcustomizerMainWindow : ApplicationWindow { +template AdwcustomizerMainWindow : Adw.ApplicationWindow { title: _("Adwaita Manager"); default-width: 1280; default-height: 720; - titlebar: HeaderBar { - [start] - Button apply-button { - styles ["suggested-action"] - label: _("Apply"); - action-name: "app.apply_color_scheme"; - } + Adw.Leaflet leaflet { + can-navigate-back: true; + can-unfold: false; - [start] - Button save-preset-button { - action-name: "app.save_preset"; - tooltip-text: _("Save Preset"); - Adw.ButtonContent { - icon-name: "document-save-symbolic"; - } - } + Gtk.Box main_view { + orientation: vertical; - // [start] - // MenuButton presets-dropdown { - // icon-name: "palette-symbolic"; - // menu-model: presets-menu; - // tooltip-text: _("Presets"); - // } + Adw.HeaderBar titlebar { + centering-policy: strict; - [title] - Adw.ViewSwitcherTitle view-switcher { - stack: stack - } + [start] + Button apply-button { + styles ["suggested-action"] + label: _("Apply"); + action-name: "app.apply_color_scheme"; + } - [end] - MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } + [start] + Button save-preset-button { + action-name: "app.save_preset"; + tooltip-text: _("Save Preset"); + Adw.ButtonContent { + icon-name: "document-save-symbolic"; + } + } - [end] - MenuButton errors-button { - styles ["raised", "error"] - icon-name: "dialog-warning-symbolic"; - popover: errors-popover; - } - }; + [title] + Adw.ViewSwitcherTitle title { + stack: view_stack; + } - Box { - Adw.ViewStack stack { - MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } - } - Adw.PreferencesPage content { } + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + + [end] + MenuButton presets-dropdown { + menu-model: presets-menu; + label: _("Presets"); + icon-name: "palette-symbolic.svg"; + } + + [end] + MenuButton errors-button { + styles ["raised", "error"] + icon-name: "dialog-warning-symbolic"; + popover: errors-popover; + } + + } + + Gtk.Box { + orientation: vertical; + + Adw.ViewStack view_stack { + vexpand: true; + hexpand: true; + + Adw.ViewStackPage { + name: "colors"; + title: C_("Navigation", "Colors"); + icon-name: "puzzle-piece-symbolic"; + + child: Gtk.Label { + label: _("WIP"); + }; + + } + + Adw.ViewStackPage { + name: "monet"; + title: C_("Navigation", "Monet"); + icon-name: "globe-symbolic"; + + + child: Gtk.Label { + label: _("WIP"); + }; + + } + + Adw.ViewStackPage { + name: "css"; + title: C_("Navigation", "CSS"); + icon-name: "globe-symbolic"; + + + child: Gtk.Label { + label: _("WIP"); + }; + + //child: .ExmBrowsePage browse_page {}; + } + } + + Adw.ViewSwitcherBar { + stack: view_stack; + reveal: bind title.title-visible; + } + } + } + + Adw.PreferencesPage content { } } } @@ -76,9 +130,22 @@ menu presets-menu { } } + menu main-menu { - item (_("Reset Applied Color Scheme"), "app.reset_color_scheme") - item (_("About Adwaita Manager"), "app.about") + section { + item { + label: _("Release Notes"); + action: "win.show-release-notes"; + } + item { + label: _("Reset Applied Color Scheme"); + action: "app.reset_color_scheme"; + } + item { + label: _("About Adwaita Manager"); + action: "app.about"; + } + } } Popover errors-popover { From d1912a88595b26e15ee7f4de76df58004cc2ac92 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 12:36:29 +0200 Subject: [PATCH 005/149] update presets --- src/ui/window.blp | 2 +- src/window.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index 9048ead61..4dcdf3334 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -47,7 +47,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { MenuButton presets-dropdown { menu-model: presets-menu; label: _("Presets"); - icon-name: "palette-symbolic.svg"; + icon-name: "palette-symbolic"; } [end] diff --git a/src/window.py b/src/window.py index 267ae0178..427d332c3 100644 --- a/src/window.py +++ b/src/window.py @@ -26,7 +26,7 @@ # use or other dealings in this Software without prior written # authorization. -from gi.repository import Gtk, Adw, Gio +from gi.repository import Gtk, Adw, Gio, Gdk from .error import AdwcustomizerError from .settings_schema import settings_schema from .palette_shades import AdwcustomizerPaletteShades @@ -35,11 +35,12 @@ from .custom_css_group import AdwcustomizerCustomCSSGroup @Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') -class AdwcustomizerMainWindow(Gtk.ApplicationWindow): +class AdwcustomizerMainWindow(Adw.ApplicationWindow): __gtype_name__ = 'AdwcustomizerMainWindow' content = Gtk.Template.Child() save_preset_button = Gtk.Template.Child("save-preset-button") + main_menu = Gtk.Template.Child("main-menu") presets_dropdown = Gtk.Template.Child("presets-dropdown") presets_menu = Gtk.Template.Child("presets-menu") errors_button = Gtk.Template.Child("errors-button") From 46c17e3b2d946a5aecd5123ebfb30bb2568bfa51 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 14:18:38 +0200 Subject: [PATCH 006/149] update about --- src/main.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 4c284ec24..f414c9121 100644 --- a/src/main.py +++ b/src/main.py @@ -443,17 +443,33 @@ def show_about_window(self, *_args): application_name=_("Adwaita Manager"), application_icon="com.github.AdwCustomizerTeam.AdwCustomizer", developer_name=_("Adwaita Manager Team"), + website="https://github.com/AdwCustomizerTeam/AdwCustomizer", + support_url="https://github.com/orgs/AdwCustomizerTeam/discussions", + issue_url="https://github.com/AdwCustomizerTeam/AdwCustomizer/issues", developers=[ 'Artyom "ArtyIF" Fomin https://github.com/ArtyIF', "Verantor https://github.com/Verantor", + "0xMRTT https://github.com/0xMRTT", + ], + artists=[ + 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' + ], + designers=[ + 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' ], - artists=['David "Daudix UFO" Lapshin https://github.com/daudix-UFO'], # Translators: This is a place to put your credits (formats: "Name https://example.com" or "Name ", no quotes) and is not meant to be translated literally. - translator_credits=_("translator-credits"), + translator_credits="""Maxime V https://www.transifex.com/user/profile/Adaoh/ + FineFindus https://github.com/FineFindus + Karol Lademan https://www.transifex.com/user/profile/karlod/ + Monty Monteusz https://www.transifex.com/user/profile/MontyQIQI/ + Renato Corrêa https://www.transifex.com/user/profile/renatocrrs/ + Aggelos Tselios https://www.transifex.com/user/profile/AndroGR/ + David "Daudix UFO" Lapshin https://github.com/daudix-UFO' + Juanjo Cillero https://www.transifex.com/user/profile/renux918/ + Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.MIT_X11, ) - about.present() def update_custom_css_text(self, app_type, new_value): From 7feb520bcb488921adb2f0cdec364a72f0a4c330 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 14:35:30 +0200 Subject: [PATCH 007/149] migrate to AdwCustomizerTeam --- ....github.AdwCustomizerTeam.AdwCustomizer-palette-symbolic.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-palette-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-palette-symbolic.svg index 93d29cccd..2198e0591 100644 --- a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-palette-symbolic.svg +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-palette-symbolic.svg @@ -1,5 +1,5 @@ - + From 6998db86bdb531747b5278e66407ac5d819ae56e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 14:35:37 +0200 Subject: [PATCH 008/149] add brush icon --- src/adwcustomizer.gresource.xml | 4 ++++ ....AdwCustomizerTeam.AdwCustomizer-larger-brush-symbolic.svg | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-larger-brush-symbolic.svg diff --git a/src/adwcustomizer.gresource.xml b/src/adwcustomizer.gresource.xml index 26e33d912..8abce0381 100644 --- a/src/adwcustomizer.gresource.xml +++ b/src/adwcustomizer.gresource.xml @@ -20,5 +20,9 @@ preprocess="xml-stripblanks" alias="palette-symbolic.svg" >icons/com.github.AdwCustomizerTeam.AdwCustomizer-palette-symbolic.svg + icons/com.github.AdwCustomizerTeam.AdwCustomizer-larger-brush-symbolic.svg diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-larger-brush-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-larger-brush-symbolic.svg new file mode 100644 index 000000000..25f758677 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-larger-brush-symbolic.svg @@ -0,0 +1,2 @@ + + From ae32600c3defda57f7a53d564434a768ab44cc92 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 14:35:42 +0200 Subject: [PATCH 009/149] use brush --- src/ui/window.blp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index 4dcdf3334..6ca3c42ba 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -69,7 +69,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { Adw.ViewStackPage { name: "colors"; title: C_("Navigation", "Colors"); - icon-name: "puzzle-piece-symbolic"; + icon-name: "larger-brush-symbolic"; child: Gtk.Label { label: _("WIP"); From db9d755a862d98d419a7f407a73ad8e46a881b05 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 14:36:51 +0200 Subject: [PATCH 010/149] add pipette and code icons --- ...com.github.AdwCustomizerTeam.AdwCustomizer-code-symbolic.svg | 2 ++ ...ub.AdwCustomizerTeam.AdwCustomizer-color-picker-symbolic.svg | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-code-symbolic.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-color-picker-symbolic.svg diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-code-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-code-symbolic.svg new file mode 100644 index 000000000..540341b83 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-code-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-color-picker-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-color-picker-symbolic.svg new file mode 100644 index 000000000..3c37c4177 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-color-picker-symbolic.svg @@ -0,0 +1,2 @@ + + From 843ae4566b08f6cec6a2453fe5d65d139cad484f Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 14:43:09 +0200 Subject: [PATCH 011/149] add icons in gresource --- src/adwcustomizer.gresource.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/adwcustomizer.gresource.xml b/src/adwcustomizer.gresource.xml index 8abce0381..c596b3a00 100644 --- a/src/adwcustomizer.gresource.xml +++ b/src/adwcustomizer.gresource.xml @@ -24,5 +24,13 @@ preprocess="xml-stripblanks" alias="larger-brush-symbolic.svg" >icons/com.github.AdwCustomizerTeam.AdwCustomizer-larger-brush-symbolic.svg + icons/com.github.AdwCustomizerTeam.AdwCustomizer-color-picker-symbolic.svg + icons/com.github.AdwCustomizerTeam.AdwCustomizer-larger-brush-symbolic.svg From 3754dba774a6c89f715a848f3649947f313a3589 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 14:43:13 +0200 Subject: [PATCH 012/149] use icons --- src/ui/window.blp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index 6ca3c42ba..aa177615a 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -80,7 +80,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { Adw.ViewStackPage { name: "monet"; title: C_("Navigation", "Monet"); - icon-name: "globe-symbolic"; + icon-name: "color-picker-symbolic"; child: Gtk.Label { @@ -90,9 +90,9 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } Adw.ViewStackPage { - name: "css"; - title: C_("Navigation", "CSS"); - icon-name: "globe-symbolic"; + name: "plugins"; + title: C_("Navigation", "Plugins"); + icon-name: "settings-symbolic"; child: Gtk.Label { From 34a29911397e59a677997d7849e057d91ee993a2 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 14:47:17 +0200 Subject: [PATCH 013/149] add manage presets in window --- src/ui/window.blp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ui/window.blp b/src/ui/window.blp index aa177615a..e9da1e714 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -127,6 +127,10 @@ menu presets-menu { action: "app.load_preset"; target: "adwaita-dark"; } + item { + label: "Manage Presets"; + action: "app.manage_presets"; + } } } From 20894ce40e4592c846c6340626d71b37e861c0ad Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 14:50:52 +0200 Subject: [PATCH 014/149] add preferences page --- src/ui/window.blp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index e9da1e714..dbcf1847b 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -71,9 +71,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { title: C_("Navigation", "Colors"); icon-name: "larger-brush-symbolic"; - child: Gtk.Label { - label: _("WIP"); - }; + child: Adw.PreferencesPage content { }; } @@ -109,8 +107,6 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } } } - - Adw.PreferencesPage content { } } } From d5d1c509b38429d94079cc6ee3f95c91277658e0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 14:56:50 +0200 Subject: [PATCH 015/149] add icons --- ...om.github.AdwCustomizerTeam.AdwCustomizer-disk-saved.svg | 6 ++++++ ....github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved.svg | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved.svg diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved.svg new file mode 100644 index 000000000..8c37be35a --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved.svg new file mode 100644 index 000000000..3bccb16f9 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved.svg @@ -0,0 +1,6 @@ + + + + + + From 85c3c1da58f91b7b35b6a8e52643626c15c9c1b6 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 14:58:52 +0200 Subject: [PATCH 016/149] add in gresource --- src/adwcustomizer.gresource.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/adwcustomizer.gresource.xml b/src/adwcustomizer.gresource.xml index c596b3a00..9fe3e78a0 100644 --- a/src/adwcustomizer.gresource.xml +++ b/src/adwcustomizer.gresource.xml @@ -31,6 +31,14 @@ icons/com.github.AdwCustomizerTeam.AdwCustomizer-larger-brush-symbolic.svg + >icons/com.github.AdwCustomizerTeam.AdwCustomizer-code-symbolic.svg + icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved-symbolic.svg + icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-symbolic.svg From 529ea84db064dcb813f1c6e5181cab5f32010aa0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 15:02:01 +0200 Subject: [PATCH 017/149] remove symbolics --- src/adwcustomizer.gresource.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/adwcustomizer.gresource.xml b/src/adwcustomizer.gresource.xml index 9fe3e78a0..402e2888e 100644 --- a/src/adwcustomizer.gresource.xml +++ b/src/adwcustomizer.gresource.xml @@ -34,11 +34,11 @@ >icons/com.github.AdwCustomizerTeam.AdwCustomizer-code-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved-symbolic.svg + alias="disk-saved.svg" + >icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-symbolic.svg + alias="disk-unsaved.svg" + >icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved.svg From d2d2cad4c9247966c6029e403d9f425b32562cc0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 15:05:54 +0200 Subject: [PATCH 018/149] update save button --- src/main.py | 9 ++++----- src/ui/window.blp | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index f414c9121..538c28c55 100644 --- a/src/main.py +++ b/src/main.py @@ -226,16 +226,15 @@ def generate_gtk_css(self, app_type): def mark_as_dirty(self): self.is_dirty = True - self.props.active_window.save_preset_button.add_css_class("warning") - self.props.active_window.save_preset_button.add_css_class("raised") - self.props.active_window.save_preset_button.get_child().set_label( + self.props.active_window.save_preset_button.get_child().set_icon_name( + "disk-unsaved" + ) + self.props.active_window.save_preset_button.get_child().set_tooltip_text( _("Unsaved changes") ) def clear_dirty(self): self.is_dirty = False - self.props.active_window.save_preset_button.remove_css_class("warning") - self.props.active_window.save_preset_button.remove_css_class("raised") self.props.active_window.save_preset_button.get_child().set_label("") def reload_variables(self): diff --git a/src/ui/window.blp b/src/ui/window.blp index dbcf1847b..ebef87339 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -28,7 +28,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { action-name: "app.save_preset"; tooltip-text: _("Save Preset"); Adw.ButtonContent { - icon-name: "document-save-symbolic"; + icon-name: "disk-saved"; } } From d22e5c96e8c83882599befdc7f8253e05a851629 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 15:07:25 +0200 Subject: [PATCH 019/149] move save button at the end --- src/ui/window.blp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index ebef87339..fe8190f96 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -23,7 +23,19 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { action-name: "app.apply_color_scheme"; } - [start] + [title] + Adw.ViewSwitcherTitle title { + stack: view_stack; + } + + [end] + MenuButton presets-dropdown { + menu-model: presets-menu; + label: _("Presets"); + icon-name: "palette-symbolic"; + } + + [end] Button save-preset-button { action-name: "app.save_preset"; tooltip-text: _("Save Preset"); @@ -32,24 +44,12 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } } - [title] - Adw.ViewSwitcherTitle title { - stack: view_stack; - } - - [end] + [end] Gtk.MenuButton { icon-name: "open-menu-symbolic"; menu-model: main-menu; } - [end] - MenuButton presets-dropdown { - menu-model: presets-menu; - label: _("Presets"); - icon-name: "palette-symbolic"; - } - [end] MenuButton errors-button { styles ["raised", "error"] From d2c1deddf42e96aa9addd27b90ba74499885fd6e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 15:11:07 +0200 Subject: [PATCH 020/149] add menu-symbolic icon --- src/adwcustomizer.gresource.xml | 4 ++++ ...m.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg | 2 ++ src/ui/window.blp | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg diff --git a/src/adwcustomizer.gresource.xml b/src/adwcustomizer.gresource.xml index 402e2888e..b4893cb1c 100644 --- a/src/adwcustomizer.gresource.xml +++ b/src/adwcustomizer.gresource.xml @@ -40,5 +40,9 @@ preprocess="xml-stripblanks" alias="disk-unsaved.svg" >icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved.svg + icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg new file mode 100644 index 000000000..50b8a3c4d --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/src/ui/window.blp b/src/ui/window.blp index fe8190f96..ce2639164 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -46,7 +46,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { [end] Gtk.MenuButton { - icon-name: "open-menu-symbolic"; + icon-name: "menu-symbolic"; menu-model: main-menu; } From d94c8b0c4a1c0845f2b269b13eade30a11bd0dc4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 15:15:23 +0200 Subject: [PATCH 021/149] fix if XDG_CONFIG_HOME not set, will use $HOME/.config as fallback --- src/main.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main.py b/src/main.py index 538c28c55..ccf247c71 100644 --- a/src/main.py +++ b/src/main.py @@ -116,7 +116,7 @@ def reload_user_defined_presets(self): self.props.active_window.presets_menu.remove(1) preset_directory = os.path.join( - os.environ["XDG_CONFIG_HOME"], "presets") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets") if not os.path.exists(preset_directory): os.makedirs(preset_directory) @@ -174,7 +174,7 @@ def open_dir_callback(_, result): self.portal.open_uri( parent, - "file://" + os.path.join(os.environ["XDG_CONFIG_HOME"], "presets"), + "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets"), Xdp.OpenUriFlags.NONE, None, open_dir_callback, @@ -278,7 +278,7 @@ def load_preset_action(self, _unused, *args): if args[0].get_string().startswith("custom-"): self.load_preset_from_file( os.path.join( - os.environ["XDG_CONFIG_HOME"], + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets", args[0].get_string().replace("custom-", "", 1) + ".json", ) @@ -325,7 +325,7 @@ def show_save_preset_dialog(self, *_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ["XDG_CONFIG_HOME"], + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets", to_slug_case(self.preset_name) + ".json", ) @@ -348,7 +348,7 @@ def on_preset_entry_change(*_args): dialog.set_body( _( "Saving preset to {0}. If that preset already exists, it will be overwritten!" - ).format(os.path.join(os.environ["XDG_CONFIG_HOME"], "presets")) + ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets")) ) dialog.set_response_enabled("save", False) else: @@ -357,7 +357,7 @@ def on_preset_entry_change(*_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ["XDG_CONFIG_HOME"], + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets", to_slug_case(preset_entry.get_text()) + ".json", ) @@ -376,7 +376,7 @@ def save_preset(self, _unused, response, entry): if response == "save": with open( os.path.join( - os.environ["XDG_CONFIG_HOME"], + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets", to_slug_case(entry.get_text()) + ".json", ), @@ -396,7 +396,7 @@ def apply_color_scheme(self, widget, response): if response == "apply": if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ["XDG_CONFIG_HOME"], "gtk-4.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -406,7 +406,7 @@ def apply_color_scheme(self, widget, response): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ["XDG_CONFIG_HOME"], "gtk-3.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -420,7 +420,7 @@ def reset_color_scheme(self, widget, response): if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ["XDG_CONFIG_HOME"], "/gtk-3.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "/gtk-3.0/gtk.css") ) try: file.delete() @@ -429,7 +429,7 @@ def reset_color_scheme(self, widget, response): if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ["XDG_CONFIG_HOME"], "/gtk-3.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "/gtk-3.0/gtk.css") ) try: file.delete() From d16abdd16ada9a99191e1daae2a633eb3c16fd67 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 15:19:28 +0200 Subject: [PATCH 022/149] add css tab --- src/ui/window.blp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index ce2639164..89780b70a 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -97,7 +97,16 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { label: _("WIP"); }; - //child: .ExmBrowsePage browse_page {}; + } + + Adw.ViewStackPage { + name: "css"; + title: C_("Navigation", "CSS"); + icon-name: "code-symbolic"; + + + child: Adw.PreferencesPage content_css { }; + } } From 750903a058bc39954749328fb52462c533eb521b Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 15:21:34 +0200 Subject: [PATCH 023/149] remove tab 4 and add Adw.PreferencesPage on others tabs --- src/ui/window.blp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index 89780b70a..208a620b5 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -81,9 +81,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { icon-name: "color-picker-symbolic"; - child: Gtk.Label { - label: _("WIP"); - }; + child: Adw.PreferencesPage content_monet { }; } @@ -93,19 +91,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { icon-name: "settings-symbolic"; - child: Gtk.Label { - label: _("WIP"); - }; - - } - - Adw.ViewStackPage { - name: "css"; - title: C_("Navigation", "CSS"); - icon-name: "code-symbolic"; - - - child: Adw.PreferencesPage content_css { }; + child: Adw.PreferencesPage content_plugins { }; } } From 6dd2c46e01eb75782cb3ad69eaba773084d749a3 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 16:57:45 +0200 Subject: [PATCH 024/149] add monet page --- src/ui/window.blp | 2 -- src/window.py | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index 208a620b5..bb506ae1e 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -80,9 +80,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { title: C_("Navigation", "Monet"); icon-name: "color-picker-symbolic"; - child: Adw.PreferencesPage content_monet { }; - } Adw.ViewStackPage { diff --git a/src/window.py b/src/window.py index 427d332c3..e67672de7 100644 --- a/src/window.py +++ b/src/window.py @@ -39,6 +39,7 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): __gtype_name__ = 'AdwcustomizerMainWindow' content = Gtk.Template.Child() + content_monet = Gtk.Template.Child("content_monet") save_preset_button = Gtk.Template.Child("save-preset-button") main_menu = Gtk.Template.Child("main-menu") presets_dropdown = Gtk.Template.Child("presets-dropdown") @@ -50,6 +51,8 @@ def __init__(self, **kwargs): super().__init__(**kwargs) self.presets_dropdown.get_popover().connect("show", self.on_presets_dropdown_activate) + self.setup_monet_page() + for group in settings_schema["groups"]: pref_group = Adw.PreferencesGroup() pref_group.set_name(group["name"]) @@ -103,6 +106,55 @@ def __init__(self, **kwargs): "window-fullscreen", self, "fullscreened", Gio.SettingsBindFlags.DEFAULT ) + def on_file_picker_button_clicked(self, *args): + self.monet_file_chooser_dialog.show() + + def on_monet_file_chooser_response(self, widget, response): + if response == Gtk.ResponseType.ACCEPT: + image_file = self.monet_file_chooser_dialog.get_file() + image_basename = image_file.get_basename() + self.monet_file_chooser_button.set_label(image_basename) + self.monet_file_chooser_dialog.hide() + + def setup_monet_page(self): + monet_pref_group = Adw.PreferencesGroup() + monet_pref_group.set_name("monet") + monet_pref_group.set_title(_("Monet Engine")) + monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + + self.monet_file_chooser_row = Adw.ActionRow() + self.monet_file_chooser_row.set_title(_("Background Image")) + + self.monet_file_chooser_dialog = Gtk.FileChooserNative() + self.monet_file_chooser_dialog.set_transient_for(self) + + self.monet_file_chooser_button = Gtk.Button() + self.monet_file_chooser_button.set_label(_("Choose a file")) + self.monet_file_chooser_button.set_icon_name("folder-pictures-symbolic") + + self.monet_file_chooser_button.connect("clicked", self.on_file_picker_button_clicked ) + self.monet_file_chooser_dialog.connect("response", self.on_monet_file_chooser_response ) + self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) + monet_pref_group.add(self.monet_file_chooser_row) + + self.palette_picker = Adw.ActionRow() + self.palette_picker.set_name("monet_palette") + self.palette_picker.set_title(_("Monet Palette")) + self.palette_picker + self.palette_pickers = {} + for i in range(5): + i = i+1 + picker = Gtk.ColorButton() + picker.set_name(str(i)) + picker.set_rgba(Gdk.RGBA(red=0, green=0, blue=0, alpha=0)) + picker.set_valign(Gtk.Align.CENTER) + self.palette_pickers[str(i)] = picker + self.palette_picker.add_suffix(picker) + monet_pref_group.add(self.palette_picker) + + self.content_monet.add(monet_pref_group) + + def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) while child is not None: From 90b1ca12319c7bfbaf17805b34548d4a94183937 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 17:05:47 +0200 Subject: [PATCH 025/149] add toasts --- src/main.py | 3 + src/ui/window.blp | 154 +++++++++++++++++++++++----------------------- src/window.py | 2 +- 3 files changed, 82 insertions(+), 77 deletions(-) diff --git a/src/main.py b/src/main.py index ccf247c71..6fd57863d 100644 --- a/src/main.py +++ b/src/main.py @@ -143,6 +143,8 @@ def reload_user_defined_presets(self): "line": traceback.format_exc().strip(), } ) + self.toast_overlay.add_toast(Adw.Toast(title=_("Failed to load preset"))) + self.props.active_window.update_errors(self.global_errors) custom_menu_section = Gio.Menu() @@ -391,6 +393,7 @@ def save_preset(self, _unused, response, entry): } file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() + self.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) def apply_color_scheme(self, widget, response): if response == "apply": diff --git a/src/ui/window.blp b/src/ui/window.blp index bb506ae1e..122720b85 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -6,100 +6,102 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { default-width: 1280; default-height: 720; - Adw.Leaflet leaflet { - can-navigate-back: true; - can-unfold: false; - - Gtk.Box main_view { - orientation: vertical; + Adw.ToastOverlay toast_overlay { + Adw.Leaflet leaflet { + can-navigate-back: true; + can-unfold: false; + + Gtk.Box main_view { + orientation: vertical; + + Adw.HeaderBar titlebar { + centering-policy: strict; + + [start] + Button apply-button { + styles ["suggested-action"] + label: _("Apply"); + action-name: "app.apply_color_scheme"; + } - Adw.HeaderBar titlebar { - centering-policy: strict; + [title] + Adw.ViewSwitcherTitle title { + stack: view_stack; + } - [start] - Button apply-button { - styles ["suggested-action"] - label: _("Apply"); - action-name: "app.apply_color_scheme"; - } + [end] + MenuButton presets-dropdown { + menu-model: presets-menu; + label: _("Presets"); + icon-name: "palette-symbolic"; + } - [title] - Adw.ViewSwitcherTitle title { - stack: view_stack; - } + [end] + Button save-preset-button { + action-name: "app.save_preset"; + tooltip-text: _("Save Preset"); + Adw.ButtonContent { + icon-name: "disk-saved"; + } + } - [end] - MenuButton presets-dropdown { - menu-model: presets-menu; - label: _("Presets"); - icon-name: "palette-symbolic"; - } + [end] + Gtk.MenuButton { + icon-name: "menu-symbolic"; + menu-model: main-menu; + } - [end] - Button save-preset-button { - action-name: "app.save_preset"; - tooltip-text: _("Save Preset"); - Adw.ButtonContent { - icon-name: "disk-saved"; + [end] + MenuButton errors-button { + styles ["raised", "error"] + icon-name: "dialog-warning-symbolic"; + popover: errors-popover; } - } - [end] - Gtk.MenuButton { - icon-name: "menu-symbolic"; - menu-model: main-menu; - } - - [end] - MenuButton errors-button { - styles ["raised", "error"] - icon-name: "dialog-warning-symbolic"; - popover: errors-popover; } - } + Gtk.Box { + orientation: vertical; - Gtk.Box { - orientation: vertical; + Adw.ViewStack view_stack { + vexpand: true; + hexpand: true; - Adw.ViewStack view_stack { - vexpand: true; - hexpand: true; + Adw.ViewStackPage { + name: "colors"; + title: C_("Navigation", "Colors"); + icon-name: "larger-brush-symbolic"; + + child: Adw.PreferencesPage content { }; + + } - Adw.ViewStackPage { - name: "colors"; - title: C_("Navigation", "Colors"); - icon-name: "larger-brush-symbolic"; - - child: Adw.PreferencesPage content { }; - - } + Adw.ViewStackPage { + name: "monet"; + title: C_("Navigation", "Monet"); + icon-name: "color-picker-symbolic"; - Adw.ViewStackPage { - name: "monet"; - title: C_("Navigation", "Monet"); - icon-name: "color-picker-symbolic"; + child: Adw.PreferencesPage content_monet { }; + } - child: Adw.PreferencesPage content_monet { }; - } + Adw.ViewStackPage { + name: "plugins"; + title: C_("Navigation", "Plugins"); + icon-name: "settings-symbolic"; - Adw.ViewStackPage { - name: "plugins"; - title: C_("Navigation", "Plugins"); - icon-name: "settings-symbolic"; + child: Adw.PreferencesPage content_plugins { }; - child: Adw.PreferencesPage content_plugins { }; - - } - } + } + } - Adw.ViewSwitcherBar { - stack: view_stack; - reveal: bind title.title-visible; - } - } - } + Adw.ViewSwitcherBar { + stack: view_stack; + reveal: bind title.title-visible; + } + } + } + } } } diff --git a/src/window.py b/src/window.py index e67672de7..0607bb228 100644 --- a/src/window.py +++ b/src/window.py @@ -39,6 +39,7 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): __gtype_name__ = 'AdwcustomizerMainWindow' content = Gtk.Template.Child() + toast_overlay = Gtk.Template.Child() content_monet = Gtk.Template.Child("content_monet") save_preset_button = Gtk.Template.Child("save-preset-button") main_menu = Gtk.Template.Child("main-menu") @@ -52,7 +53,6 @@ def __init__(self, **kwargs): self.presets_dropdown.get_popover().connect("show", self.on_presets_dropdown_activate) self.setup_monet_page() - for group in settings_schema["groups"]: pref_group = Adw.PreferencesGroup() pref_group.set_name(group["name"]) From e7c0abaffe750573ad2ee962cf2aa9b1cb47b827 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 17:09:29 +0200 Subject: [PATCH 026/149] add toast for apply --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 6fd57863d..5a8194ca4 100644 --- a/src/main.py +++ b/src/main.py @@ -393,7 +393,7 @@ def save_preset(self, _unused, response, entry): } file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() - self.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) + self.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) def apply_color_scheme(self, widget, response): if response == "apply": @@ -417,6 +417,7 @@ def apply_color_scheme(self, widget, response): os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" ) as file: file.write(gtk3_css) + self.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): if response == "reset": From f42af792740fa941b9fea694e45a8a6056767cee Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 17:11:39 +0200 Subject: [PATCH 027/149] fix error. --- src/main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.py b/src/main.py index 5a8194ca4..1b34d85b6 100644 --- a/src/main.py +++ b/src/main.py @@ -86,9 +86,9 @@ def do_activate(self): necessary. """ - win = self.props.active_window - if not win: - win = AdwcustomizerMainWindow(application=self) + self.win = self.props.active_window + if not self.win: + self.win = AdwcustomizerMainWindow(application=self) self.create_action("open_preset_directory", self.open_preset_directory) self.create_stateful_action( @@ -109,7 +109,7 @@ def do_activate(self): "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita.json" ) - win.present() + self.win.present() def reload_user_defined_presets(self): if self.props.active_window.presets_menu.get_n_items() > 1: @@ -143,7 +143,7 @@ def reload_user_defined_presets(self): "line": traceback.format_exc().strip(), } ) - self.toast_overlay.add_toast(Adw.Toast(title=_("Failed to load preset"))) + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Failed to load preset"))) self.props.active_window.update_errors(self.global_errors) @@ -393,7 +393,7 @@ def save_preset(self, _unused, response, entry): } file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() - self.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) def apply_color_scheme(self, widget, response): if response == "apply": @@ -417,7 +417,7 @@ def apply_color_scheme(self, widget, response): os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" ) as file: file.write(gtk3_css) - self.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): if response == "reset": From 4b6d1623f94c9e6a7ac596c9635bcb4262014c33 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 17:14:15 +0200 Subject: [PATCH 028/149] update icons --- ....AdwCustomizerTeam.AdwCustomizer-disk-saved-symbolic.svg | 6 ++++++ ...om.github.AdwCustomizerTeam.AdwCustomizer-disk-saved.svg | 6 ------ ...dwCustomizerTeam.AdwCustomizer-disk-unsaved-symbolic.svg | 6 ++++++ ....github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved.svg | 6 ------ 4 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved-symbolic.svg delete mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-symbolic.svg delete mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved.svg diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved-symbolic.svg new file mode 100644 index 000000000..79a74915b --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved-symbolic.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved.svg deleted file mode 100644 index 8c37be35a..000000000 --- a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-symbolic.svg new file mode 100644 index 000000000..4d4e0c273 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-symbolic.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved.svg deleted file mode 100644 index 3bccb16f9..000000000 --- a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - From 3297e4562adfbd0b94527733812683daed28cde2 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 17:15:04 +0200 Subject: [PATCH 029/149] add -symbolic --- src/adwcustomizer.gresource.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/adwcustomizer.gresource.xml b/src/adwcustomizer.gresource.xml index b4893cb1c..691abdb8b 100644 --- a/src/adwcustomizer.gresource.xml +++ b/src/adwcustomizer.gresource.xml @@ -34,12 +34,12 @@ >icons/com.github.AdwCustomizerTeam.AdwCustomizer-code-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved.svg + alias="disk-saved-symbolic.svg" + >icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-saved-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved.svg + alias="disk-unsaved-symbolic.svg" + >icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-symbolic.svg Date: Wed, 10 Aug 2022 17:15:46 +0200 Subject: [PATCH 030/149] use new icons --- src/main.py | 5 ++++- src/ui/window.blp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 1b34d85b6..c862351dc 100644 --- a/src/main.py +++ b/src/main.py @@ -229,7 +229,7 @@ def generate_gtk_css(self, app_type): def mark_as_dirty(self): self.is_dirty = True self.props.active_window.save_preset_button.get_child().set_icon_name( - "disk-unsaved" + "disk-unsaved-symbolic" ) self.props.active_window.save_preset_button.get_child().set_tooltip_text( _("Unsaved changes") @@ -237,6 +237,9 @@ def mark_as_dirty(self): def clear_dirty(self): self.is_dirty = False + self.props.active_window.save_preset_button.get_child().set_icon_name( + "disk-saved-symbolic" + ) self.props.active_window.save_preset_button.get_child().set_label("") def reload_variables(self): diff --git a/src/ui/window.blp b/src/ui/window.blp index 122720b85..f68e973f1 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -41,7 +41,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { action-name: "app.save_preset"; tooltip-text: _("Save Preset"); Adw.ButtonContent { - icon-name: "disk-saved"; + icon-name: "disk-saved-symbolic"; } } From 40a05adcd7e65811faf08c14335430de521a2df1 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 17:20:19 +0200 Subject: [PATCH 031/149] move css to plugins --- src/window.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/window.py b/src/window.py index 0607bb228..4188e01c6 100644 --- a/src/window.py +++ b/src/window.py @@ -41,6 +41,7 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): content = Gtk.Template.Child() toast_overlay = Gtk.Template.Child() content_monet = Gtk.Template.Child("content_monet") + content_plugins = Gtk.Template.Child("content_plugins") save_preset_button = Gtk.Template.Child("save-preset-button") main_menu = Gtk.Template.Child("main-menu") presets_dropdown = Gtk.Template.Child("presets-dropdown") @@ -53,6 +54,7 @@ def __init__(self, **kwargs): self.presets_dropdown.get_popover().connect("show", self.on_presets_dropdown_activate) self.setup_monet_page() + self.setup_plugins_page() for group in settings_schema["groups"]: pref_group = Adw.PreferencesGroup() pref_group.set_name(group["name"]) @@ -81,13 +83,6 @@ def __init__(self, **kwargs): self.get_application().pref_palette_shades[color["prefix"]] = palette_shades self.content.add(palette_pref_group) - custom_css_group = AdwcustomizerCustomCSSGroup() - for app_type in settings_schema["custom_css_app_types"]: - self.get_application().custom_css[app_type] = "" - custom_css_group.load_custom_css(self.get_application().custom_css) - self.content.add(custom_css_group) - self.get_application().custom_css_group = custom_css_group - self.settings = Gio.Settings( "com.github.AdwCustomizerTeam.AdwCustomizer") @@ -154,6 +149,14 @@ def setup_monet_page(self): self.content_monet.add(monet_pref_group) + def setup_plugins_page(self): + custom_css_group = AdwcustomizerCustomCSSGroup() + for app_type in settings_schema["custom_css_app_types"]: + self.get_application().custom_css[app_type] = "" + custom_css_group.load_custom_css(self.get_application().custom_css) + self.content_plugins.add(custom_css_group) + self.get_application().custom_css_group = custom_css_group + def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) From 8655f0b1bcd82313c24177951ecd5d14cbf2244a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 17:21:31 +0200 Subject: [PATCH 032/149] move colors page setup to a special function --- src/window.py | 59 +++++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/src/window.py b/src/window.py index 4188e01c6..d73fd8460 100644 --- a/src/window.py +++ b/src/window.py @@ -55,34 +55,8 @@ def __init__(self, **kwargs): self.setup_monet_page() self.setup_plugins_page() - for group in settings_schema["groups"]: - pref_group = Adw.PreferencesGroup() - pref_group.set_name(group["name"]) - pref_group.set_title(group["title"]) - pref_group.set_description(group["description"]) - - for variable in group["variables"]: - pref_variable = AdwcustomizerOption(variable["name"], - variable["title"], - variable["adw_gtk3_support"], - variable.get("explanation")) - pref_group.add(pref_variable) - self.get_application().pref_variables[variable["name"]] = pref_variable - - self.content.add(pref_group) - - palette_pref_group = Adw.PreferencesGroup() - palette_pref_group.set_name("palette_colors") - palette_pref_group.set_title(_("Palette Colors")) - palette_pref_group.set_description(_("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) - for color in settings_schema["palette"]: - palette_shades = AdwcustomizerPaletteShades(color["prefix"], - color["title"], - color["n_shades"]) - palette_pref_group.add(palette_shades) - self.get_application().pref_palette_shades[color["prefix"]] = palette_shades - self.content.add(palette_pref_group) - + self.setup_colors_page() + self.settings = Gio.Settings( "com.github.AdwCustomizerTeam.AdwCustomizer") @@ -157,6 +131,35 @@ def setup_plugins_page(self): self.content_plugins.add(custom_css_group) self.get_application().custom_css_group = custom_css_group + def setup_colors_page(self): + for group in settings_schema["groups"]: + pref_group = Adw.PreferencesGroup() + pref_group.set_name(group["name"]) + pref_group.set_title(group["title"]) + pref_group.set_description(group["description"]) + + for variable in group["variables"]: + pref_variable = AdwcustomizerOption(variable["name"], + variable["title"], + variable["adw_gtk3_support"], + variable.get("explanation")) + pref_group.add(pref_variable) + self.get_application().pref_variables[variable["name"]] = pref_variable + + self.content.add(pref_group) + + palette_pref_group = Adw.PreferencesGroup() + palette_pref_group.set_name("palette_colors") + palette_pref_group.set_title(_("Palette Colors")) + palette_pref_group.set_description(_("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) + for color in settings_schema["palette"]: + palette_shades = AdwcustomizerPaletteShades(color["prefix"], + color["title"], + color["n_shades"]) + palette_pref_group.add(palette_shades) + self.get_application().pref_palette_shades[color["prefix"]] = palette_shades + self.content.add(palette_pref_group) + def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) From 8337eb32295097afc292b2f5ab80b4b02effaa71 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 17:24:40 +0200 Subject: [PATCH 033/149] add disk-unsaved-fill-symbolic --- src/adwcustomizer.gresource.xml | 4 ++++ ...tomizerTeam.AdwCustomizer-disk-unsaved-fill-symbolic.svg | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-fill-symbolic.svg diff --git a/src/adwcustomizer.gresource.xml b/src/adwcustomizer.gresource.xml index 691abdb8b..4eab7c0b0 100644 --- a/src/adwcustomizer.gresource.xml +++ b/src/adwcustomizer.gresource.xml @@ -44,5 +44,9 @@ preprocess="xml-stripblanks" alias="menu-symbolic.svg" >icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg + icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-fill-symbolic diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-fill-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-fill-symbolic.svg new file mode 100644 index 000000000..cb4f2ae5e --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-fill-symbolic.svg @@ -0,0 +1,6 @@ + + + + + + From 93f6d6dee312cb834912de04630bf36a424d7f39 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 17:25:54 +0200 Subject: [PATCH 034/149] add file extension --- src/adwcustomizer.gresource.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adwcustomizer.gresource.xml b/src/adwcustomizer.gresource.xml index 4eab7c0b0..dc6a30581 100644 --- a/src/adwcustomizer.gresource.xml +++ b/src/adwcustomizer.gresource.xml @@ -47,6 +47,6 @@ icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-fill-symbolic + >icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-fill-symbolic.svg From e31357fc2986df3216a32870de780aed213b5a63 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 17:32:38 +0200 Subject: [PATCH 035/149] rename plugin tab into advanced --- src/ui/window.blp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index f68e973f1..e9e6deb74 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -86,7 +86,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { Adw.ViewStackPage { name: "plugins"; - title: C_("Navigation", "Plugins"); + title: C_("Navigation", "Advanced"); icon-name: "settings-symbolic"; From c2354dd9276a21b663bb5c2356311241f765ef4c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 17:51:24 +0200 Subject: [PATCH 036/149] remove adw gtk3 warnings --- src/option.py | 14 +------------- src/ui/option.blp | 16 ---------------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/src/option.py b/src/option.py index d2803c8f6..2e3ec75b3 100644 --- a/src/option.py +++ b/src/option.py @@ -36,27 +36,15 @@ class AdwcustomizerOption(Adw.ActionRow): text_value = Gtk.Template.Child("text-value") value_stack = Gtk.Template.Child("value-stack") text_value_toggle = Gtk.Template.Child("text-value-toggle") - warning_button = Gtk.Template.Child("warning-button") - warning_label = Gtk.Template.Child("warning-label") explanation_button = Gtk.Template.Child("explanation-button") explanation_label = Gtk.Template.Child("explanation-label") - def __init__(self, name, title, adw_gtk3_support, explanation, **kwargs): + def __init__(self, name, title, explanation, **kwargs): super().__init__(**kwargs) self.set_name(name) self.set_title(title) self.set_subtitle("@" + name) - - if adw_gtk3_support == "yes": - self.warning_button.set_visible(False) - elif adw_gtk3_support == "partial": - self.warning_button.add_css_class("warning") - self.warning_label.set_label(_("This option is only partially supported by the adw-gtk3 theme.")) - elif adw_gtk3_support == "no": - self.warning_button.add_css_class("error") - self.warning_label.set_label(_("This option is not supported by the adw-gtk3 theme.")) - self.explanation_label.set_label(explanation or "") if explanation is None: self.explanation_button.set_visible(False) diff --git a/src/ui/option.blp b/src/ui/option.blp index 5679c571b..b71d4050e 100644 --- a/src/ui/option.blp +++ b/src/ui/option.blp @@ -2,14 +2,6 @@ using Gtk 4.0; using Adw 1; template AdwcustomizerOption : Adw.ActionRow { - [suffix] - MenuButton warning-button { - valign: center; - icon-name: "adw-gtk3-warning-symbolic"; - popover: warning-popover; - tooltip-text: _("GTK 3 Support Warning"); - } - [suffix] MenuButton explanation-button { valign: center; @@ -46,14 +38,6 @@ template AdwcustomizerOption : Adw.ActionRow { } } -Popover warning-popover { - Label warning-label { - max-width-chars: 50; - wrap: true; - justify: center; - } -} - Popover explanation-popover { Label explanation-label { max-width-chars: 50; From 139bfa8448f5ecfe107c3345ca4db2a0875917bb Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 17:51:34 +0200 Subject: [PATCH 037/149] remove adw gtk3 --- src/settings_schema.py | 73 +++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/src/settings_schema.py b/src/settings_schema.py index 4ed3dcff3..2a76e8373 100644 --- a/src/settings_schema.py +++ b/src/settings_schema.py @@ -9,17 +9,17 @@ "name": "accent_color", "title": _("Standalone Color"), "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + }, { "name": "accent_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + }, { "name": "accent_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + } ] }, @@ -32,17 +32,17 @@ "name": "destructive_color", "title": _("Standalone Color"), "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + }, { "name": "destructive_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + }, { "name": "destructive_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" + } ] }, @@ -55,17 +55,17 @@ "name": "success_color", "title": _("Standalone Color"), "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + }, { "name": "success_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + }, { "name": "success_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" + } ] }, @@ -78,17 +78,17 @@ "name": "warning_color", "title": _("Standalone Color"), "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + }, { "name": "warning_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + }, { "name": "warning_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" + } ] }, @@ -101,17 +101,17 @@ "name": "error_color", "title": _("Standalone Color"), "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + }, { "name": "error_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + }, { "name": "error_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" + } ] }, @@ -123,12 +123,12 @@ { "name": "window_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + }, { "name": "window_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + } ] }, @@ -140,12 +140,12 @@ { "name": "view_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + }, { "name": "view_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + } ] }, @@ -157,31 +157,29 @@ { "name": "headerbar_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + }, { "name": "headerbar_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + }, { "name": "headerbar_border_color", "title": _("Border Color"), "explanation": _("The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout."), - "adw_gtk3_support": "no" - }, + }, { "name": "headerbar_backdrop_color", "title": _("Backdrop Color"), "explanation": _("The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color."), - "adw_gtk3_support": "yes" + }, { "name": "headerbar_shade_color", "title": _("Shade Color"), "explanation": _("The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window."), - "adw_gtk3_support": "no" - } + } ] }, { @@ -192,19 +190,18 @@ { "name": "card_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + }, { "name": "card_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + }, { "name": "card_shade_color", "title": _("Shade Color"), "explanation": _("The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards."), - "adw_gtk3_support": "no" - } + } ] }, { @@ -215,13 +212,11 @@ { "name": "dialog_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "no" - }, + }, { "name": "dialog_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "no" - } + } ] }, { @@ -232,12 +227,12 @@ { "name": "popover_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + }, { "name": "popover_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + } ] }, @@ -250,14 +245,12 @@ "name": "shade_color", "title": _("Shade Color"), "explanation": _("The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders."), - "adw_gtk3_support": "no" - }, + }, { "name": "scrollbar_outline_color", "title": _("Scrollbar Outline Color"), "explanation": _("The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color."), - "adw_gtk3_support": "no" - } + } ] } ], From 188b810d3262f786d05e62ba18eb97fefdd0b574 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 17:51:43 +0200 Subject: [PATCH 038/149] remove adw gtk3 --- src/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index d73fd8460..31a04338e 100644 --- a/src/window.py +++ b/src/window.py @@ -56,7 +56,7 @@ def __init__(self, **kwargs): self.setup_monet_page() self.setup_plugins_page() self.setup_colors_page() - + self.settings = Gio.Settings( "com.github.AdwCustomizerTeam.AdwCustomizer") @@ -141,7 +141,6 @@ def setup_colors_page(self): for variable in group["variables"]: pref_variable = AdwcustomizerOption(variable["name"], variable["title"], - variable["adw_gtk3_support"], variable.get("explanation")) pref_group.add(pref_variable) self.get_application().pref_variables[variable["name"]] = pref_variable From 720c93c9f7578ccc5e3d16f06fe9bc490cd086ca Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 17:51:55 +0200 Subject: [PATCH 039/149] add plugin class --- src/main.py | 2 +- src/meson.build | 10 ++++++++++ src/plugin.py | 41 +++++++++++++++++++++++++++++++++++++++++ src/plugins/__init__.py | 0 src/plugins/gtk4.py | 4 ++++ src/plugins_list.py | 16 ++++++++++++++++ src/setting.py | 19 +++++++++++++++++++ 7 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 src/plugin.py create mode 100644 src/plugins/__init__.py create mode 100644 src/plugins/gtk4.py create mode 100644 src/plugins_list.py create mode 100644 src/setting.py diff --git a/src/main.py b/src/main.py index c862351dc..151af305c 100644 --- a/src/main.py +++ b/src/main.py @@ -43,7 +43,7 @@ from .option import AdwcustomizerOption from .app_type_dialog import AdwcustomizerAppTypeDialog from .custom_css_group import AdwcustomizerCustomCSSGroup - +from .plugins_list import AdwcustomizerPluginsList def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") diff --git a/src/meson.build b/src/meson.build index 62f39eefa..7f45b1d13 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,5 +1,6 @@ pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) moduledir = join_paths(pkgdatadir, 'adwcustomizer') +pluginsdir = join_paths(pkgdatadir, 'adwcustomizer', 'plugins') gnome = import('gnome') blueprints = custom_target('blueprints', @@ -45,10 +46,19 @@ adwcustomizer_sources = [ 'main.py', 'error.py', 'palette_shades.py', + 'plugin.py', + 'plugins_list.py', + 'setting.py', 'option.py', 'window.py', 'app_type_dialog.py', 'custom_css_group.py', ] +plugins_sources = [ + 'plugins/__init__.py', + 'plugins/gtk4.py' +] + install_data(adwcustomizer_sources, install_dir: moduledir) +install_data(plugins_sources, install_dir: pluginsdir) \ No newline at end of file diff --git a/src/plugin.py b/src/plugin.py new file mode 100644 index 000000000..e5a631177 --- /dev/null +++ b/src/plugin.py @@ -0,0 +1,41 @@ +from .setting import AdwcustomizerSetting + +class AdwcustomizerPlugin: + def __init__(self): + self.title = None + + self.colors = None + self.palette = None + + # Custom settings shown on a separate view + self.custom_settings = {} + # A dict to alias parameters to different names + # Key is the alias name, value is the parameter name + # Parameter can be any key in colors, palette or custom settings + self.alias_dict = {} + + def update_builtin_parameters(self, colors, palette): + self.colors = colors + self.palette = palette + + def load_custom_settings(self, settings): + for setting_key, setting in self.custom_settings: + self.custom_settings[setting_key].set_value(settings[setting_key]) + + def get_custom_settings_for_preset(self): + setting_dict = {} + for setting_key, setting in self.custom_settings: + setting_dict[setting_key] = setting.value + return setting_list + + def get_alias_values(self): + alias_values = {} + for key, value in self.alias_dict.items(): + alias_values[key] = self.colors.get(value, self.palette.get(value, self.custom_settings.get(value))) + return alias_values + + def validate(self): + pass + + def apply(self): + pass \ No newline at end of file diff --git a/src/plugins/__init__.py b/src/plugins/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/plugins/gtk4.py b/src/plugins/gtk4.py new file mode 100644 index 000000000..e6e28ad0b --- /dev/null +++ b/src/plugins/gtk4.py @@ -0,0 +1,4 @@ +from adwcustomizer.plugin import AdwcustomizerPlugin + +class AdwcustomizerGtk4Plugin(AdwcustomizerPlugin): + pass \ No newline at end of file diff --git a/src/plugins_list.py b/src/plugins_list.py new file mode 100644 index 000000000..db928f6c6 --- /dev/null +++ b/src/plugins_list.py @@ -0,0 +1,16 @@ +from .plugins.gtk4 import AdwcustomizerGtk4Plugin + +class AdwcustomizerPluginsList: + def __init__(self): + self.plugins = { + "gtk4": AdwcustomizerGtk4Plugin() + } + + def load_all_custom_settings(self, settings): + for plugin_id, plugin in self.plugins.items(): + plugin.load_custom_settings(settings[plugin_id]) + + def get_all_custom_settings_for_preset(self): + custom_settings = {} + for plugin_id, plugin in self.plugins.items(): + custom_settings[plugin_id] = plugin.get_custom_settings_for_preset() \ No newline at end of file diff --git a/src/setting.py b/src/setting.py new file mode 100644 index 000000000..476def53d --- /dev/null +++ b/src/setting.py @@ -0,0 +1,19 @@ +class AdwcustomizerSetting: + def __init__(self, name, title, value_type, explanation=None, default_value=None): + # TODO supported types: + # text + # integer + # float + # color only + # color shades + # color and text + # code field + self.name = name + self.title = title + self.value_type = value_type + self.explanation = explanation + self.value = default_value + + def set_value(self, new_value): + # TODO checks + self.value = new_value \ No newline at end of file From 5ec3a3d38696c1950ef6d712ba80d8c10d4b3aca Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 17:56:06 +0200 Subject: [PATCH 040/149] raise error if not implemented --- src/plugin.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugin.py b/src/plugin.py index e5a631177..cdc3004f6 100644 --- a/src/plugin.py +++ b/src/plugin.py @@ -25,8 +25,7 @@ def load_custom_settings(self, settings): def get_custom_settings_for_preset(self): setting_dict = {} for setting_key, setting in self.custom_settings: - setting_dict[setting_key] = setting.value - return setting_list + return setting_dict[setting_key] def get_alias_values(self): alias_values = {} @@ -35,7 +34,10 @@ def get_alias_values(self): return alias_values def validate(self): - pass + raise NotImplementedError() def apply(self): + raise NotImplementedError() + + def save(self): pass \ No newline at end of file From e2dc43a5f1b0528509d2ee27a99688aae1954f79 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 18:24:28 +0200 Subject: [PATCH 041/149] update plugins --- src/plugins/gtk4.py | 2 +- src/plugins_list.py | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/plugins/gtk4.py b/src/plugins/gtk4.py index e6e28ad0b..53cb50ba5 100644 --- a/src/plugins/gtk4.py +++ b/src/plugins/gtk4.py @@ -1,4 +1,4 @@ -from adwcustomizer.plugin import AdwcustomizerPlugin +from ..plugin import AdwcustomizerPlugin class AdwcustomizerGtk4Plugin(AdwcustomizerPlugin): pass \ No newline at end of file diff --git a/src/plugins_list.py b/src/plugins_list.py index db928f6c6..d4da556f6 100644 --- a/src/plugins_list.py +++ b/src/plugins_list.py @@ -1,10 +1,22 @@ from .plugins.gtk4 import AdwcustomizerGtk4Plugin - +import os +from pathlib import Path +import importlib class AdwcustomizerPluginsList: def __init__(self): - self.plugins = { + self.plugins = { # AdwCustomizerTeam plugins "gtk4": AdwcustomizerGtk4Plugin() } + self.add_user_plugins() + + def add_user_plugins(self): + self.user_plugin_dir = Path(os.environ.get("XDG_DATA_HOME", os.environ["HOME"])) / ".local" / "share" / "AdwCustomizer" / "plugins" + if self.user_plugin_dir.exists(): + for path, _, name in os.walk(self.user_plugin_dir): + print(name[0]) + else: + print("No plugins dir found") + def load_all_custom_settings(self, settings): for plugin_id, plugin in self.plugins.items(): From 8f6a7f8a4dfbd858966d27899dfc558a73bb05bf Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 19:00:23 +0200 Subject: [PATCH 042/149] add flatpak build --- .github/workflows/flatpak.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/flatpak.yml diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml new file mode 100644 index 000000000..f8a9f660e --- /dev/null +++ b/.github/workflows/flatpak.yml @@ -0,0 +1,19 @@ +on: + push: + branches: [main] + pull_request: +name: CI +jobs: + flatpak: + name: "Flatpak" + runs-on: ubuntu-latest + container: + image: bilelmoussaoui/flatpak-github-actions:gnome-40 + options: --privileged + steps: + - uses: actions/checkout@v2 + - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 + with: + bundle: palette.flatpak + manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.yml + cache-key: flatpak-builder-${{ github.sha }} \ No newline at end of file From 3361fea9adce6c2e3d5eb88cad36940999826ec2 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 19:02:21 +0200 Subject: [PATCH 043/149] add step name --- .github/workflows/flatpak.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index f8a9f660e..b95795a9e 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -11,9 +11,10 @@ jobs: image: bilelmoussaoui/flatpak-github-actions:gnome-40 options: --privileged steps: - - uses: actions/checkout@v2 - - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 - with: - bundle: palette.flatpak - manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.yml - cache-key: flatpak-builder-${{ github.sha }} \ No newline at end of file + - name: Checkout + uses: actions/checkout@v3.0.2 + - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 + with: + bundle: palette.flatpak + manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.yml + cache-key: flatpak-builder-${{ github.sha }} \ No newline at end of file From 39d427ac2d1e05742cff2fcf3b406b4917afc87f Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 19:02:42 +0200 Subject: [PATCH 044/149] Use json manifest --- .github/workflows/flatpak.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index b95795a9e..478cb4510 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -16,5 +16,5 @@ jobs: - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 with: bundle: palette.flatpak - manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.yml + manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.json cache-key: flatpak-builder-${{ github.sha }} \ No newline at end of file From 86f64335cb879abaf1e6827e21d46763909b7dde Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 19:03:02 +0200 Subject: [PATCH 045/149] fix syntax error --- .github/workflows/flatpak.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 478cb4510..8cdc1598e 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -12,7 +12,7 @@ jobs: options: --privileged steps: - name: Checkout - uses: actions/checkout@v3.0.2 + uses: actions/checkout@v3.0.2 - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 with: bundle: palette.flatpak From bfff3eb65d293cb2dedc34914fd310715c79b493 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 19:05:23 +0200 Subject: [PATCH 046/149] add name and use nightly --- .github/workflows/flatpak.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 8cdc1598e..d9b22503c 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -1,3 +1,4 @@ +name: Build flatpak on: push: branches: [main] @@ -8,7 +9,7 @@ jobs: name: "Flatpak" runs-on: ubuntu-latest container: - image: bilelmoussaoui/flatpak-github-actions:gnome-40 + image: bilelmoussaoui/flatpak-github-actions:gnome-nightly options: --privileged steps: - name: Checkout From 166c874a0c9c462ba700e93aea15d2ed1323fc22 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 19:05:43 +0200 Subject: [PATCH 047/149] remove duplicated entry --- .github/workflows/flatpak.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index d9b22503c..1648d8f99 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -3,7 +3,6 @@ on: push: branches: [main] pull_request: -name: CI jobs: flatpak: name: "Flatpak" From 40b797366e47d92947ee4a25962ba67b194df000 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 19:08:45 +0200 Subject: [PATCH 048/149] change bundle name --- .github/workflows/flatpak.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 1648d8f99..8d1b02d48 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -15,6 +15,6 @@ jobs: uses: actions/checkout@v3.0.2 - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 with: - bundle: palette.flatpak + bundle: com.github.AdwCustomizerTeam.AdwCustomizer.flatpak manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.json cache-key: flatpak-builder-${{ github.sha }} \ No newline at end of file From d645ce503e02af98810dbc6c4e0c2ec816e03d97 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 19:11:27 +0200 Subject: [PATCH 049/149] add ci for next branch --- .github/workflows/flatpak-nightly.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/flatpak-nightly.yml diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml new file mode 100644 index 000000000..665c6e5d5 --- /dev/null +++ b/.github/workflows/flatpak-nightly.yml @@ -0,0 +1,20 @@ +name: Build flatpak nightly +on: + push: + branches: [next] + pull_request: +jobs: + flatpak: + name: "Flatpak" + runs-on: ubuntu-latest + container: + image: bilelmoussaoui/flatpak-github-actions:gnome-nightly + options: --privileged + steps: + - name: Checkout + uses: actions/checkout@v3.0.2 + - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 + with: + bundle: com.github.AdwCustomizerTeam.AdwCustomizer.flatpak + manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.json + cache-key: flatpak-builder-${{ github.sha }} \ No newline at end of file From 62910bb17ae0922ece9f766e2bd09ac04c77ff25 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 19:16:20 +0200 Subject: [PATCH 050/149] add different cache key for nighlty build --- .github/workflows/flatpak-nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index 665c6e5d5..e05befe07 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -17,4 +17,4 @@ jobs: with: bundle: com.github.AdwCustomizerTeam.AdwCustomizer.flatpak manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.json - cache-key: flatpak-builder-${{ github.sha }} \ No newline at end of file + cache-key: flatpak-builder-${{ github.sha }}-nightly \ No newline at end of file From 93008f5f05b7917d651598a945129522a68ec895 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 19:23:10 +0200 Subject: [PATCH 051/149] fix #96 --- src/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 151af305c..e4f696e35 100644 --- a/src/main.py +++ b/src/main.py @@ -427,16 +427,17 @@ def reset_color_scheme(self, widget, response): if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "/gtk-3.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0/gtk.css") ) try: file.delete() except Exception: pass + if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "/gtk-3.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0/gtk.css") ) try: file.delete() From 3991f9562154d25f565d86a261941b71eb8448c7 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Wed, 10 Aug 2022 21:16:44 +0200 Subject: [PATCH 052/149] add adw-gtk3 wanrings and no support --- src/option.py | 14 +++++++- src/settings_schema.py | 73 +++++++++++++++++++++++------------------- src/ui/option.blp | 16 +++++++++ src/window.py | 3 +- 4 files changed, 71 insertions(+), 35 deletions(-) diff --git a/src/option.py b/src/option.py index 2e3ec75b3..6ef98da63 100644 --- a/src/option.py +++ b/src/option.py @@ -36,15 +36,27 @@ class AdwcustomizerOption(Adw.ActionRow): text_value = Gtk.Template.Child("text-value") value_stack = Gtk.Template.Child("value-stack") text_value_toggle = Gtk.Template.Child("text-value-toggle") + warning_button = Gtk.Template.Child("warning-button") + warning_label = Gtk.Template.Child("warning-label") explanation_button = Gtk.Template.Child("explanation-button") explanation_label = Gtk.Template.Child("explanation-label") - def __init__(self, name, title, explanation, **kwargs): + def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs): super().__init__(**kwargs) self.set_name(name) self.set_title(title) self.set_subtitle("@" + name) + + if adw_gtk3_support == "yes": + self.warning_button.set_visible(False) + elif adw_gtk3_support == "partial": + self.warning_button.add_css_class("warning") + self.warning_label.set_label(_("This option is only partially supported by the adw-gtk3 theme.")) + elif adw_gtk3_support == "no": + self.warning_button.add_css_class("error") + self.warning_label.set_label(_("This option is not supported by the adw-gtk3 theme.")) + self.explanation_label.set_label(explanation or "") if explanation is None: self.explanation_button.set_visible(False) diff --git a/src/settings_schema.py b/src/settings_schema.py index 2a76e8373..4ed3dcff3 100644 --- a/src/settings_schema.py +++ b/src/settings_schema.py @@ -9,17 +9,17 @@ "name": "accent_color", "title": _("Standalone Color"), "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - + "adw_gtk3_support": "yes" }, { "name": "accent_bg_color", "title": _("Background Color"), - + "adw_gtk3_support": "yes" }, { "name": "accent_fg_color", "title": _("Foreground Color"), - + "adw_gtk3_support": "yes" } ] }, @@ -32,17 +32,17 @@ "name": "destructive_color", "title": _("Standalone Color"), "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - + "adw_gtk3_support": "yes" }, { "name": "destructive_bg_color", "title": _("Background Color"), - + "adw_gtk3_support": "yes" }, { "name": "destructive_fg_color", "title": _("Foreground Color"), - + "adw_gtk3_support": "partial" } ] }, @@ -55,17 +55,17 @@ "name": "success_color", "title": _("Standalone Color"), "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - + "adw_gtk3_support": "yes" }, { "name": "success_bg_color", "title": _("Background Color"), - + "adw_gtk3_support": "yes" }, { "name": "success_fg_color", "title": _("Foreground Color"), - + "adw_gtk3_support": "partial" } ] }, @@ -78,17 +78,17 @@ "name": "warning_color", "title": _("Standalone Color"), "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - + "adw_gtk3_support": "yes" }, { "name": "warning_bg_color", "title": _("Background Color"), - + "adw_gtk3_support": "yes" }, { "name": "warning_fg_color", "title": _("Foreground Color"), - + "adw_gtk3_support": "partial" } ] }, @@ -101,17 +101,17 @@ "name": "error_color", "title": _("Standalone Color"), "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - + "adw_gtk3_support": "yes" }, { "name": "error_bg_color", "title": _("Background Color"), - + "adw_gtk3_support": "yes" }, { "name": "error_fg_color", "title": _("Foreground Color"), - + "adw_gtk3_support": "partial" } ] }, @@ -123,12 +123,12 @@ { "name": "window_bg_color", "title": _("Background Color"), - + "adw_gtk3_support": "yes" }, { "name": "window_fg_color", "title": _("Foreground Color"), - + "adw_gtk3_support": "yes" } ] }, @@ -140,12 +140,12 @@ { "name": "view_bg_color", "title": _("Background Color"), - + "adw_gtk3_support": "yes" }, { "name": "view_fg_color", "title": _("Foreground Color"), - + "adw_gtk3_support": "yes" } ] }, @@ -157,29 +157,31 @@ { "name": "headerbar_bg_color", "title": _("Background Color"), - + "adw_gtk3_support": "yes" }, { "name": "headerbar_fg_color", "title": _("Foreground Color"), - + "adw_gtk3_support": "yes" }, { "name": "headerbar_border_color", "title": _("Border Color"), "explanation": _("The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout."), - }, + "adw_gtk3_support": "no" + }, { "name": "headerbar_backdrop_color", "title": _("Backdrop Color"), "explanation": _("The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color."), - + "adw_gtk3_support": "yes" }, { "name": "headerbar_shade_color", "title": _("Shade Color"), "explanation": _("The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window."), - } + "adw_gtk3_support": "no" + } ] }, { @@ -190,18 +192,19 @@ { "name": "card_bg_color", "title": _("Background Color"), - + "adw_gtk3_support": "yes" }, { "name": "card_fg_color", "title": _("Foreground Color"), - + "adw_gtk3_support": "yes" }, { "name": "card_shade_color", "title": _("Shade Color"), "explanation": _("The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards."), - } + "adw_gtk3_support": "no" + } ] }, { @@ -212,11 +215,13 @@ { "name": "dialog_bg_color", "title": _("Background Color"), - }, + "adw_gtk3_support": "no" + }, { "name": "dialog_fg_color", "title": _("Foreground Color"), - } + "adw_gtk3_support": "no" + } ] }, { @@ -227,12 +232,12 @@ { "name": "popover_bg_color", "title": _("Background Color"), - + "adw_gtk3_support": "yes" }, { "name": "popover_fg_color", "title": _("Foreground Color"), - + "adw_gtk3_support": "yes" } ] }, @@ -245,12 +250,14 @@ "name": "shade_color", "title": _("Shade Color"), "explanation": _("The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders."), - }, + "adw_gtk3_support": "no" + }, { "name": "scrollbar_outline_color", "title": _("Scrollbar Outline Color"), "explanation": _("The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color."), - } + "adw_gtk3_support": "no" + } ] } ], diff --git a/src/ui/option.blp b/src/ui/option.blp index b71d4050e..5679c571b 100644 --- a/src/ui/option.blp +++ b/src/ui/option.blp @@ -2,6 +2,14 @@ using Gtk 4.0; using Adw 1; template AdwcustomizerOption : Adw.ActionRow { + [suffix] + MenuButton warning-button { + valign: center; + icon-name: "adw-gtk3-warning-symbolic"; + popover: warning-popover; + tooltip-text: _("GTK 3 Support Warning"); + } + [suffix] MenuButton explanation-button { valign: center; @@ -38,6 +46,14 @@ template AdwcustomizerOption : Adw.ActionRow { } } +Popover warning-popover { + Label warning-label { + max-width-chars: 50; + wrap: true; + justify: center; + } +} + Popover explanation-popover { Label explanation-label { max-width-chars: 50; diff --git a/src/window.py b/src/window.py index 31a04338e..ddb86fa88 100644 --- a/src/window.py +++ b/src/window.py @@ -141,7 +141,8 @@ def setup_colors_page(self): for variable in group["variables"]: pref_variable = AdwcustomizerOption(variable["name"], variable["title"], - variable.get("explanation")) + variable.get("explanation"), + variable["adw_gtk3_support"]) pref_group.add(pref_variable) self.get_application().pref_variables[variable["name"]] = pref_variable From 658aa68d178e09e68f7ba82ba339b3a4465dfd1c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 10:16:44 +0200 Subject: [PATCH 053/149] Change copyrights headers --- requirements.txt | 18 ++++++++++++++++++ src/adwcustomizer.in | 38 ++++++++++++++------------------------ src/app_type_dialog.py | 38 ++++++++++++++------------------------ src/custom_css_group.py | 38 ++++++++++++++------------------------ src/error.py | 38 ++++++++++++++------------------------ src/main.py | 38 ++++++++++++++------------------------ src/option.py | 38 ++++++++++++++------------------------ src/palette_shades.py | 38 ++++++++++++++------------------------ src/plugin.py | 18 ++++++++++++++++++ src/plugins/__init__.py | 17 +++++++++++++++++ src/plugins/gtk4.py | 18 ++++++++++++++++++ src/plugins_list.py | 18 ++++++++++++++++++ src/setting.py | 18 ++++++++++++++++++ src/settings_schema.py | 18 ++++++++++++++++++ src/style.css | 18 ++++++++++++++++++ 15 files changed, 241 insertions(+), 168 deletions(-) diff --git a/requirements.txt b/requirements.txt index ece31cd81..3138af401 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,21 @@ +# requirements.txt +# +# Change the look of Adwaita, with ease +# Copyright (C) 2022 Adwaita Manager Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + # After changing this file, download the flatpak pip generator script: # curl -O https://raw.githubusercontent.com/flatpak/flatpak-builder-tools/master/pip/flatpak-pip-generator # chmod +x flatpak-pip-generator diff --git a/src/adwcustomizer.in b/src/adwcustomizer.in index 7bca420bc..7f88fc5f5 100755 --- a/src/adwcustomizer.in +++ b/src/adwcustomizer.in @@ -2,31 +2,21 @@ # adwcustomizer.in # -# Copyright 2022 Adwaita Manager Team +# Change the look of Adwaita, with ease +# Copyright (C) 2022 Adwaita Manager Team # -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name(s) of the above copyright -# holders shall not be used in advertising or otherwise to promote the sale, -# use or other dealings in this Software without prior written -# authorization. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import os import sys diff --git a/src/app_type_dialog.py b/src/app_type_dialog.py index fd48494d6..be2707fe2 100644 --- a/src/app_type_dialog.py +++ b/src/app_type_dialog.py @@ -1,30 +1,20 @@ # window.py # -# Copyright 2022 Adwaita Manager Team +# Change the look of Adwaita, with ease +# Copyright (C) 2022 Adwaita Manager Team # -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name(s) of the above copyright -# holders shall not be used in advertising or otherwise to promote the sale, -# use or other dealings in this Software without prior written -# authorization. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . from gi.repository import Gtk, Adw diff --git a/src/custom_css_group.py b/src/custom_css_group.py index 84219c513..2e2d453bd 100644 --- a/src/custom_css_group.py +++ b/src/custom_css_group.py @@ -1,30 +1,20 @@ # custom_css_group.py # -# Copyright 2022 Adwaita Manager Team +# Change the look of Adwaita, with ease +# Copyright (C) 2022 Adwaita Manager Team # -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name(s) of the above copyright -# holders shall not be used in advertising or otherwise to promote the sale, -# use or other dealings in this Software without prior written -# authorization. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . from gi.repository import Gtk, Adw diff --git a/src/error.py b/src/error.py index db99a8f90..98fd3fdf1 100644 --- a/src/error.py +++ b/src/error.py @@ -1,30 +1,20 @@ # error.py # -# Copyright 2022 Adwaita Manager Team +# Change the look of Adwaita, with ease +# Copyright (C) 2022 Adwaita Manager Team # -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name(s) of the above copyright -# holders shall not be used in advertising or otherwise to promote the sale, -# use or other dealings in this Software without prior written -# authorization. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . from gi.repository import Gtk diff --git a/src/main.py b/src/main.py index e4f696e35..e94f41da8 100644 --- a/src/main.py +++ b/src/main.py @@ -1,30 +1,20 @@ # main.py # -# Copyright 2022 Adwaita Manager Team +# Change the look of Adwaita, with ease +# Copyright (C) 2022 Adwaita Manager Team # -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name(s) of the above copyright -# holders shall not be used in advertising or otherwise to promote the sale, -# use or other dealings in this Software without prior written -# authorization. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . import sys import json diff --git a/src/option.py b/src/option.py index 6ef98da63..ed98f2d12 100644 --- a/src/option.py +++ b/src/option.py @@ -1,30 +1,20 @@ # option.py # -# Copyright 2022 Adwaita Manager Team +# Change the look of Adwaita, with ease +# Copyright (C) 2022 Adwaita Manager Team # -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name(s) of the above copyright -# holders shall not be used in advertising or otherwise to promote the sale, -# use or other dealings in this Software without prior written -# authorization. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw diff --git a/src/palette_shades.py b/src/palette_shades.py index fff403494..f7eb9bf79 100644 --- a/src/palette_shades.py +++ b/src/palette_shades.py @@ -1,30 +1,20 @@ # palette_shades.py # -# Copyright 2022 Adwaita Manager Team +# Change the look of Adwaita, with ease +# Copyright (C) 2022 Adwaita Manager Team # -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY -# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name(s) of the above copyright -# holders shall not be used in advertising or otherwise to promote the sale, -# use or other dealings in this Software without prior written -# authorization. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw diff --git a/src/plugin.py b/src/plugin.py index cdc3004f6..16a234f24 100644 --- a/src/plugin.py +++ b/src/plugin.py @@ -1,3 +1,21 @@ +# plugin.py +# +# Change the look of Adwaita, with ease +# Copyright (C) 2022 Adwaita Manager Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + from .setting import AdwcustomizerSetting class AdwcustomizerPlugin: diff --git a/src/plugins/__init__.py b/src/plugins/__init__.py index e69de29bb..a66319289 100644 --- a/src/plugins/__init__.py +++ b/src/plugins/__init__.py @@ -0,0 +1,17 @@ +# plugins/__init__.py +# +# Change the look of Adwaita, with ease +# Copyright (C) 2022 Adwaita Manager Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . \ No newline at end of file diff --git a/src/plugins/gtk4.py b/src/plugins/gtk4.py index 53cb50ba5..b5a7d14f1 100644 --- a/src/plugins/gtk4.py +++ b/src/plugins/gtk4.py @@ -1,3 +1,21 @@ +# plugins/gtk4.py +# +# Change the look of Adwaita, with ease +# Copyright (C) 2022 Adwaita Manager Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + from ..plugin import AdwcustomizerPlugin class AdwcustomizerGtk4Plugin(AdwcustomizerPlugin): diff --git a/src/plugins_list.py b/src/plugins_list.py index d4da556f6..3c7c04b35 100644 --- a/src/plugins_list.py +++ b/src/plugins_list.py @@ -1,3 +1,21 @@ +# plugins_list.py +# +# Change the look of Adwaita, with ease +# Copyright (C) 2022 Adwaita Manager Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + from .plugins.gtk4 import AdwcustomizerGtk4Plugin import os from pathlib import Path diff --git a/src/setting.py b/src/setting.py index 476def53d..9a7492815 100644 --- a/src/setting.py +++ b/src/setting.py @@ -1,3 +1,21 @@ +# setting.py +# +# Change the look of Adwaita, with ease +# Copyright (C) 2022 Adwaita Manager Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + class AdwcustomizerSetting: def __init__(self, name, title, value_type, explanation=None, default_value=None): # TODO supported types: diff --git a/src/settings_schema.py b/src/settings_schema.py index 4ed3dcff3..ea9317441 100644 --- a/src/settings_schema.py +++ b/src/settings_schema.py @@ -1,3 +1,21 @@ +# settings_schema.py +# +# Change the look of Adwaita, with ease +# Copyright (C) 2022 Adwaita Manager Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + settings_schema = { "groups": [ { diff --git a/src/style.css b/src/style.css index b6badc1cd..f2f0cbb4f 100644 --- a/src/style.css +++ b/src/style.css @@ -1,3 +1,21 @@ +/* + * Change the look of Adwaita, with ease + * Copyright (C) 2022 Adwaita Manager Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +**/ + .custom-css-view { padding: 12px; } From 9ee8de434e2b72445539d585799573e08a3b4756 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 10:18:38 +0200 Subject: [PATCH 054/149] add meson ci --- .github/workflows/meson.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/meson.yml diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml new file mode 100644 index 000000000..d6077a219 --- /dev/null +++ b/.github/workflows/meson.yml @@ -0,0 +1,21 @@ +name: Build meson +on: + push: + branches: [main, next] + pull_request: +jobs: + meson: + name: "Meson" + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3.0.2 + - uses: BSFishy/meson-build@v1.0.3 + with: + action: test + directory: build + setup-options: -Db_coverage=true + options: --verbose + meson-version: 0.53.2 + ninja-version: 1.9.0.post1 + gcovr-version: 4.2 \ No newline at end of file From b54b3df9f2b888d26a24cc76996827c112d2fbdf Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 10:19:31 +0200 Subject: [PATCH 055/149] update ci meson --- .github/workflows/meson.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml index d6077a219..4c186c106 100644 --- a/.github/workflows/meson.yml +++ b/.github/workflows/meson.yml @@ -12,10 +12,6 @@ jobs: uses: actions/checkout@v3.0.2 - uses: BSFishy/meson-build@v1.0.3 with: - action: test + action: build directory: build - setup-options: -Db_coverage=true options: --verbose - meson-version: 0.53.2 - ninja-version: 1.9.0.post1 - gcovr-version: 4.2 \ No newline at end of file From 3898532f1cc2f6da42770fe5a115c2abf4f02ed5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 10:20:47 +0200 Subject: [PATCH 056/149] remove meson build --- .github/workflows/meson.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/workflows/meson.yml diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml deleted file mode 100644 index 4c186c106..000000000 --- a/.github/workflows/meson.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Build meson -on: - push: - branches: [main, next] - pull_request: -jobs: - meson: - name: "Meson" - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3.0.2 - - uses: BSFishy/meson-build@v1.0.3 - with: - action: build - directory: build - options: --verbose From 2dd272edd182702653cca1ae1bc99f3a85092cbb Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 11:17:00 +0200 Subject: [PATCH 057/149] test: adding material-color-utilities-python --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 16 +++++++++++++++- src/window.py | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index bccf7bf12..1e941a547 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -49,6 +49,20 @@ } ] }, + { + "name": "material-color-utilities-python", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"anyascii~=0.3\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "path": "../material-color-utilities-python/dist/material_color_utilities_python-0.1.0-py3-none-any.whl", + "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" + } + ] + }, { "name" : "adwcustomizer", "builddir" : true, @@ -57,7 +71,7 @@ { "type" : "git", "path" : ".", - "branch": "main" + "branch": "next" } ] } diff --git a/src/window.py b/src/window.py index ddb86fa88..4d867b171 100644 --- a/src/window.py +++ b/src/window.py @@ -86,6 +86,8 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() def setup_monet_page(self): + from material_color_utilities_python import * + monet_pref_group = Adw.PreferencesGroup() monet_pref_group.set_name("monet") monet_pref_group.set_title(_("Monet Engine")) From b191fc30762acedf0f7c9c18d4ebec23dea8cfe9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 11:17:40 +0200 Subject: [PATCH 058/149] update imports --- src/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 4d867b171..3a705f98a 100644 --- a/src/window.py +++ b/src/window.py @@ -33,6 +33,7 @@ from .option import AdwcustomizerOption from .app_type_dialog import AdwcustomizerAppTypeDialog from .custom_css_group import AdwcustomizerCustomCSSGroup +from material_color_utilities_python import * @Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') class AdwcustomizerMainWindow(Adw.ApplicationWindow): @@ -86,7 +87,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() def setup_monet_page(self): - from material_color_utilities_python import * + monet_pref_group = Adw.PreferencesGroup() monet_pref_group.set_name("monet") From d3df34ab043741b92d39672ac6ce59cc2094eb34 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 11:19:12 +0200 Subject: [PATCH 059/149] update --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index 1e941a547..d6700d40b 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -53,7 +53,7 @@ "name": "material-color-utilities-python", "buildsystem": "simple", "build-commands": [ - "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"anyascii~=0.3\" --no-build-isolation" + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"material_color_utilities_python~=0.1.0\" --no-build-isolation" ], "sources": [ { From eaf69d0680e33db59eb9d0d151edb967a28bb708 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 11:20:58 +0200 Subject: [PATCH 060/149] add pillow --- pypi-dependencies.json | 37 +++++++++++++++++++++++++++++-------- requirements.txt | 3 ++- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/pypi-dependencies.json b/pypi-dependencies.json index 55270718e..a60dd0d79 100644 --- a/pypi-dependencies.json +++ b/pypi-dependencies.json @@ -1,14 +1,35 @@ { - "name": "python3-anyascii", + "name": "pypi-dependencies", "buildsystem": "simple", - "build-commands": [ - "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"anyascii~=0.3\" --no-build-isolation" - ], - "sources": [ + "build-commands": [], + "modules": [ { - "type": "file", - "url": "https://files.pythonhosted.org/packages/39/f6/7c1e3a2a54f18b67c5bd092c25ac7327083d4b3b15731b98a9c193df2db9/anyascii-0.3.1-py3-none-any.whl", - "sha256": "8707d3185017435933360462a65e2c70a4818490745804f38a5ca55e59eb56a0" + "name": "python3-anyascii", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"anyascii~=0.3\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/39/f6/7c1e3a2a54f18b67c5bd092c25ac7327083d4b3b15731b98a9c193df2db9/anyascii-0.3.1-py3-none-any.whl", + "sha256": "8707d3185017435933360462a65e2c70a4818490745804f38a5ca55e59eb56a0" + } + ] + }, + { + "name": "python3-Pillow", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"Pillow>=9.2.0\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/8c/92/2975b464d9926dc667020ed1abfa6276e68c3571dcb77e43347e15ee9eed/Pillow-9.2.0.tar.gz", + "sha256": "75e636fd3e0fb872693f23ccb8a5ff2cd578801251f3a4f6854c6a5d437d3c04" + } + ] } ] } \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 3138af401..86e070269 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,4 +22,5 @@ # Then run: # ./flatpak-pip-generator --requirements-file=requirements.txt --output pypi-dependencies -anyascii~=0.3 \ No newline at end of file +anyascii~=0.3 +Pillow>=9.2.0 From 31b188b272e45c9e5b292529a4bf6b2383b561f8 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 11:24:21 +0200 Subject: [PATCH 061/149] add regex --- pypi-dependencies.json | 14 ++++++++++++++ requirements.txt | 1 + 2 files changed, 15 insertions(+) diff --git a/pypi-dependencies.json b/pypi-dependencies.json index a60dd0d79..04f5137ac 100644 --- a/pypi-dependencies.json +++ b/pypi-dependencies.json @@ -30,6 +30,20 @@ "sha256": "75e636fd3e0fb872693f23ccb8a5ff2cd578801251f3a4f6854c6a5d437d3c04" } ] + }, + { + "name": "python3-regex", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"regex\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/c6/5a/e266ef579433b9cbd3e704032bb3ffa66b89ff3f0b0874a8cbaa4d451427/regex-2022.7.25.tar.gz", + "sha256": "bd0883e86964cd61360ffc36dbebbc49b928e92a306f886eab02c11dfde5b7aa" + } + ] } ] } \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 86e070269..280847f0f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,3 +24,4 @@ anyascii~=0.3 Pillow>=9.2.0 +regex From fd01abb4a3e81a821d2bf212d856781387dbd536 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 11:27:53 +0200 Subject: [PATCH 062/149] use url --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index d6700d40b..29533cb5d 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -57,8 +57,8 @@ ], "sources": [ { - "type": "file", - "path": "../material-color-utilities-python/dist/material_color_utilities_python-0.1.0-py3-none-any.whl", + "type": "url", + "path": "https://github.com/AdwCustomizerTeam/material-color-utilities-python/releases/download/0.1.0/material_color_utilities_python-0.1.0-py3-none-any.whl", "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" } ] From ba2562d74c411cf0ab17eea1f70dd00f68f6c38a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 11:29:36 +0200 Subject: [PATCH 063/149] use local file --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- ...olor_utilities_python-0.1.0-py3-none-any.whl | Bin 0 -> 30258 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 monet/material_color_utilities_python-0.1.0-py3-none-any.whl diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index 29533cb5d..d162543b7 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -58,7 +58,7 @@ "sources": [ { "type": "url", - "path": "https://github.com/AdwCustomizerTeam/material-color-utilities-python/releases/download/0.1.0/material_color_utilities_python-0.1.0-py3-none-any.whl", + "path": "./monet/material_color_utilities_python-0.1.0-py3-none-any.whl", "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" } ] diff --git a/monet/material_color_utilities_python-0.1.0-py3-none-any.whl b/monet/material_color_utilities_python-0.1.0-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..d1d1e19d4530f2f73a465780bdf6915aa13f57cf GIT binary patch literal 30258 zcmbTebC4+Amn_=0?e5dIZQHhO+qP}nwr$(CdAd*cJu~;ty!qXTH}9KQ5xZjlwN@c3 zcSf$YOI`{X1O)&90OIfX1#pF4IK}XHX7qPZ{T((2&L)l)2G)8;cGh-|dM?fu))vkd zCQf?x9?s@=wsd-W7Pc17dU~|>9#T}3b1L&xG!xSlt5g%>GcqyYO{k1c(2r4)D9!DQ z@hHZpq@_nH^4f~Y8ELVlKmhXplKF2k0HA+6{XPEe3jV(`8(N##8vob)!2ef3r$ITX z9S{J3Rd@gZ+J7AI-^2dBn;o@1yDe4(-#I;palBLG)14QKxmerw~mCme! zJN@p*O8W@8|= zkG%K|Vw~z}=Idf;bcXqJ1S}dW`K923>n3&s<`#nZVJnI+a1RPuP&XuBdX@h@_^?AEoJH&nkhKuOVjfB8t1Yf<6i5_A7ftx%#j5vny%* zq8qdqCRuE~C`=Y2pz<+c@#dAFy-t~4?J!PN{AzUC}#R}Wjl!K7IaaZ}T)aa_iZ^rt6Kx@u`wg#Hkg2McGq&p zwcA{}3j_O^UvsbycRI8n(c_A=jx+z!IMhIz>ywntkt``UI&XKt>%kHdrZ(YoW=q*u z^Toya!oj{gsU&Hc##Tzm@C@vq2R5~0D6{Dx;&~9|6!1nECvD9r@%)$fHaSM%w7gPNV{4gOXNOH%)ua zL+veE0BE@{kl>TVld62pb8HH4Lh@L9jx?{Td5hmSAFwxM_f+4bcXl7Y4G#?{#(7i4 z2k^3DhqQR4kjaT63&F-9C&@>5WTktY87<^|aBJd*JD1EwWVh}JUex&Vz|XmomQ0mS zkOVO}ow?d^4%v!C9Xvig|Ckqo{dCS%OiXPSC5 z&7jF&zV@5{#(40)$=z${g}At!Wi0oDFq6*mX(ZfZlSxnX$;74?hoR15#UuruT9`eC zN{;C8#Pum6uOR$WW9h@PG$57n5#>C?mMp3kd%<}CzM+RxldYs~JXuTi2Im(Cw$OD!Cc&%3(HX)dq!T)^bz67Zb(Iz zeqEV!kp&xNr@}&vVj&q|$ff!HQQ$gEy_6j~52pNtiP|yc^oTl|?BcLHNMECn<*%gdXxrK(1{-$AH!c;vj_Wa#OvsGJDCxUVmg?4w?%mjG|`)GaYrg; z=^S?IcZX}Frd_+zNurHZ5l0cBaW^_5lYwpx!zXG(h!de*OQ`~swewHbOI$^pAu2I8 zii&2@vskDnMj(j*)K-jdg!)AS^3oL&ACXj(Vm7AqAH}8Nr>{RCtcP;T2voKS?Q`Nt zL;`*R^wF7IVO7vUxv%{$_*eeY(e*T z>F(`iUhWI#~n#)ZpeSY)>E`MgUY2~i~m|^CppG^6fb0_5&+sKeq@%# zPXQ+`;YM(HprHLGPKJ0u>(}Td=G@F_UjPPj(d^*2Od=Q|iAEu;hEoM0qfSVNw zbaH=m(<17(qI5^9Ujgvi3;7Eu>z!lN>;Z63&!BdL;unbpX}~i2|z; ze{0lCyD?;{nsB$4^{gPW0>;W?#;6DZ(~B5EjTYDu%S2G$ltd4TxIwbl*>oq1@ij4> zwC6u7lBxQgP=HUOFDFn@}NFU+ck3C{s|8HWOop5L!lF_4ZxyBj+?RE|D`-kb-$!bU{!A=(Yif)LK??UuUj}K zqH#T>h;ex=s5Wj({@o2Ywjxe|Rbq~5mR^XE3Z>TQzn_Q*jW42o3k}iEY!iOt_$!g% z#&pI1Pkqq#dgf*o%ZXhIA_Yir^!o}g$zEOs2mzvqBJU;wM&GFPJ(3VSdnQ;2;nPvr z6=JX##+_tq6!h0N(Fv#aO)5&8OmoZYt-AbjfjITTpp0{%g|Vc9CVvgPtfkfY>LyyI zDlC~v0UCD4u4;&+gHphrWlAsTG`znDzP&vFjx%810vr3>`ix8>$;nI%$)Pig;F;P6 zk6{~;t5^kK#VXvH_SGXY!G^Zh zU^V)#c_#?OVONy|7`#FlCID>UXFTn*SET^^0l)rvlRjbku7Q@8MOGX{IxYk&j=e#E z`}NWuTMI}WG6hYSSjOI{Z=&DG36S3sFmMb2l!oOGzV1vg&^=+?kR9j}aYj)sQ~H!~ zHtnsh6m7qv!>+XUz|&nxaFaPtg!rg!SBjj`r8GypKi$Lni2RG|*72|-`I-fAO{cSI z;?RHG@lx8`uh$%rlD335_KL>-Euh~_X)H%>|BMKQe4okX52mAsrF4Y5QM})!dlS?` z3(we_P9B1Ut6yjOZ!p7r1l%#F)2Ym&qacs(ovSP&GfN?^x1y z>*A{b7ev>celVVTyg@KnYX=9=es%R4)=|n4U^)cV2TOW?QN&uv)}WNNw`K%yv=A5g zkbMo5Ks+eWT;){p)eYaML7>Pud-I_vD&Z#i1*Ov&8@Ix#+JhR{?v_CO)n$1B>(1BQRTLx;N zfTN82IWGD4pRq!ta9k67ETKI_a)1xCnFslb{=X}?C}r$Bh)UjhFgDV*a3S6P@Xkr? zsH&WWh7#W8_dJY2N5hfF8k_%lMEDW+9Wjg~j5jx+rLHPnWn~w|p9I0V7Abn46`3h> zr%iml6^4?f=JZ*#nWDDVRw10ovBHQk$`~jgQ!bD+x;goEF5U7j>xNw$sS=@L&LMy6 zYQs)8_Kdo$>&n4_O)#om1&*PaXx#Q=$=@yFa^n$@^B85)3l3WVO)M| zo_dnlR;fRhWEX4NPNM0Ugl18*P%!8=kpOVu5yk1a5q5svv{DUDV`xYyu#eyo&NhOpuskXNEOS0iNG3cZNOO_ z8)B)6f!F-#rv>53kXmn6DEAN>peI*SJ4rtafrkMqzT-+Kf7&5Cdg-^TL=k3h^49N8 z!Iv8+1_>o^g;Yfs82?Z2rGnl?S>DL!(gMry^h{ceIs@kNVm7lE7*h0ev})kXo@5{! z7UhyoX~|GCJ?|8phRQGv%NmqtH0J!u+*eP}3L`a_!UZ3avIucAIkLLJ(%O_@9ih0| zm9n6&zRq*EXn@|!TREmWq9#nA?52-+W0#zfSlH_Vjdw=$6DHzXn7zM`o{!sx1J8$`vu*a;@lyB*oQh78# zN{+*U0~+Eg|G*(PQcdS-c!e?RhHCk->8uVhg&@|-veBq;&Mal%CAjUwM-ueMhWmj) zh(_~RP1qv3V|P(m?Xj0kSK@u)-b^sP@g|88*){(TtOM~{8Bt87Ti%FOT%;Ppc+x9!q90fpr)7>aBh-2<+#6PuOeV z9yGf94a?qqw{ohD`}SJ47c=v`mlSW+$Fy5R*0CxBdzGUpw(1E(-WSv7StarFjI-b0 z+ixViJij=iPP`kn)8FMTX~uJCz1=RAf%+$h-FWOS)PVfOza2TAB8o-*cY)?Ej-X@{ z^zibk!w|i28p>3sg6PS9K>k&qr$N`P@c*@E%y0n!DF30L{;Sdd%IO&mJ-01p6u-MN zgd-eTO>VZJ81Qp2jm+Ae3D((6z#|f|h7{rH)F5Iu=)7Dnl8sbrG74b0=Yp1!s?VQq z=ekc04n8ifkL-9RMnZ`M)Wq_fMQXCBM6=A~$S73II9;CKq195N<>C^JsUosOPux62 zQtnMSrDo684rp2EU5~Rk;Dy4Bl^KM|#@gNl(4}qBkcDg1@mK>{^NEx;8&@tB)MS~& z(iFY>m}_0>(YTli%1?pC)q(Pm5Hed`+s;2RJZBw{915wwqa$| zVJNXGVUr-Y&J#^%91`ULp@#CPDFWD}VkVA#^vlQJ!9{n)%&FDPNs1EBfx1(NJjT+| zfncT@4WoP)689VsOtOKsiq%&~Q}xwPuyr6xJ&Q>KkO>o+DkUSbuW;!%)y6$l9=wwn z^sjIfFwunIioH9G6AN}m61njR!>%5t&-qnJQk2b2fiNY>=5iD3jtq`r04SPAt|so+ zKgJ%Atxi579_(?_GR-Jib&5s2e#9LXB;kj@G7hpr{Y6VBYmJiLsp8y|I zuJjmv4I80UzW_AnBLOBl7WVEcIXj`og4jRl1m-a`in#~yfnh)@>gKK znGO61D+CA_rjE`g2+!%P1d$?abAN|=k3F$sxX+4hc|_X0N<1*M?<_QuW(<&wKAf6h z*4SjOO|_ODWa)B@nSpE-%!Q(+&j_J&pzwwE@!abrI4e2_+2JmUlS+WI4vPJgdMeOZ zy!6ep%$oCjyK!ux42`485ZcY`sXV>kQ!)xv`v^aYb4H4+#5#t@Q55KvE9pQTRV#l=#jn62Sx{_gcV?L7&k2h;C@~{9^gY}YHfc! zRq(7;UV4{>4I*$N(qg#XxLS%c*0ZeYnf^HjaDhEtGW)GizlAo1*prMytxa&0O1>00$1GJ=R-~4wI3$v7EhPXoMU2n^$VyJdjdtst`_1GV@NQv2_2Pcycu`s zfSgd8%mEm|&OvFT!73az>Y8qRZ4bsPVMah9^@b3dWr~prVbu_133K_&GUsNzh-^r7 z7bT2}{Wd0ue-Uf)y1$YVgV3t7J3(x1x-!+xg7XYlW5Aj+u#}Im@}Bgdaw8;(E1PQo zzZy_#&G&cDqc22VLzfkMq1HM^>~637u5cNa_)LDNWd;VVMaBh`r34eR3%{4$+gb2U z*y|sF&3h@vOuKD302AYe&4~!{Fbi*v4y>N6*+J!yhE-=gg?kZTkKvoRU;8dPEJGNk zd<>pqu3V8!PIn*N_gX;x3JOa?h60_%^0`_~ab-GVy(jU3D4F2qIOUikm)DJJjTQN) zfi-4u_V6&2YZ0xqW98FlINO|g@F-KM>hbgy5Scn@)gG8!bjo*42-Nq+*SH|Z54*o7 zsHNf@x3`^e4U^9jW-GI5NR>$~rcY^z$(cr#b(*?DY`kxjAjE#zdxJaPnu7sA^+~~0 z4zEj0AjRm2X9ZO`4i(#y_5R!ftWIBwmYuGk@K<%iC$nI_9ZB^+vyVH|Fd`USGsvNr z9(D9-Y5zKEE06<;3Ek@O>ZBAgRQC^IuH$Xy>EDA#Xr4wsehC`C?U#-XY_Jnn;Jbb9 zLeTo^4`eIFe;Qz)Z{( z+_HoTn~fiKLcNcw>Dn(CGbxXxQLf&o?b@kX7)>vSmo22Veg-#vcEgU(Tq*z~jt=Ys zI^(Y&TW*aBbCj&VaRJr2{irKQ1BM^YOg?Zk4bj_1(j46T9xcI_!ixQqzlc%CeMD5| z{E2n};DP$R+qL)5?ndiQ5tdMIx=V&}>&S@{*WiZ8TxXB|wI=&^9gQ_}d-GfNWQ7{; zecgA1XVt9L3b>|Sj$0bso*k>{H&T_Z=Pg6-_a0R7E5Gu^p9_b}n#jm1HRzrlCE@Rw zsDd&TXY}C&)`kuqxYqDZsc3~v!gwJkIGK*qbZ-Rod$er%*FBxrjZg8Ta5vzvWrYyU z)!<@9vV5sa!}463mM1a(t5ME3XU|8nf7Ky{NAN9R-~a%)NB{sF|4@gxT9~+5*qZ$< zAK4oJEgad|I{lR;IqEicSFL}&0X+eId{VDSLJC*i$eltBTP76ofWr1G9W`x`WMK_$ zV#ShT_Sw2UCvgqB)}>ll1St;gvjZnx2{N`$LxK60M(aT3v`y{}H_|H2tW=u0#|qJr ztwZ?&zk-scroQ^96Qn%riC(2@7Ve~)<;b+@z^2mE3Ulw#&pxGEb;9)NU`rEPkx?w2 zNXM~6Tr22FOF;atPWZc#jH8F7rVf1RUQVNT2bGK6`UUv%cu9Xs zLF3^(1KfU(Uo#LD0O#|WKs)mG?17txHR8}DOAX&j6y@v|Vig3N*WTC7@W&ACD>@kr zC0fm4NFCN0Hp9|oxTvHf03cNHbH`EBoVux9{yPoB;t5Q!y(oQ%ah1m*Q%Da)ab&x{ zk|{LlT5SAhL7XmSDHVr};)bK&TarYj$sdXGbhm`B%>2$fz-eVP#~FprI={QIKcBp| z@&^3f4E7l7{X7#TTjk_*i6*zrge{}Q68DKl#3beNGGrbX%se9Y#_(HgeO_DbKT7c% zVNpK&m$ir6;va4TbQ9xE6LG?osAS=XDS|HwN>#F$hCMt8nq}t$eKP2J z1-@NfE7R{{@;iAdz18S202gDjI@ej0!_8@lBp(J*fmR`~iip&CoJZ5s9A2=yu1V+N zU0=OhnWkrd`Qh;Rc>MW1`;jjD4j=z5{8UTq$ERE4BdVFB$R+9&dzPQytSaX96uqYW z6^FYymWqg#kTRs_vv<3K5u3~iZI8AgptqQv)j=Cq3(>PXoGAd$#vHVG%&y1jA^zu7m0YB|2Cv-Ys>nPFizWsR0n8TzU?1Bi(%N`~d zb~Je)drCM7iz8d-CO182(}@=R!0F6g+@RJZ3Nq2*N&0NAslNjnFynxFSscjWI5@z5 zh#aaKlaHK1qhRyqmbD;EJ%nfJm(RM9e(Yt5=1Rye4^A7?e zlm@w>W55Ol`z;8q^0(uiXy^iJT^tYs=Hr+%h&3y)CsanfA0lJH473 ztm+%sqP(jiU0Pp^5IBs8H&^T4x&)oEuBUx1cobWo38}l=erey;|1cV6bw|qTs<2g_f-(3tyI+ax(TeFO0*8ePE(BZMlV;(PUT`2cRgBy*D%%J^j!2 z2j+jUxY`?7n>ah0IQ@5(xct%Qi(o(i03Tog0QUb$Od~r-6TSbF;qQ7Kqc~u@MGw>S zNrhJ*l>{oAMJmuxz~6+oxgBZ9gB>liHflT(f86rtQ&Dl%b=LrqK!|Y9tN46PeW{3i zb22QZ7C-tW-ApDDzIffsHH0lw*`wRHzmZOT_Uv&4hbuL#|wOkAIku|F`8`ExbZm8kRel0j;tL5P6vfvhN2Y5N*)oPXTccw!t;+U~b-kg~v8;s>UwPc zZ&KGZXtRJ^-N%;`!pP!Uv!;l}OXiZNn`CzfC`7#m9xeTr-1?UY`1de3!>%-BJS{5L z4}6yv#M0#GZQ~7RBrR=tZ6NIP~nv(JDESW zuuI3tT8^q)zw|3r(ko$cRdp8x07<|xTnZSf=Y zT&ckvBTPVS^q|2wD2028YYKW&j!3H(nO8LbwR&kk-ZC^M8jrE?DdU-^&$8O=sLZs; zBQ-%i1lqi=fT$BCzb08>EAnd|#>U;$5{n+IRDVg>>UXH$qoV;}&$5CuW=0dr!+OG} zxa^a&%YfVL7U#I&3B~}l1T6RG>&~9)j&|8QDKsw@K=MlrrG_pjf2xVJ-tC?orBi{X(gJ=SAYYw z23>DruP_MYG7E-zoHvwjp+}I2t!VoezxA)hh)P@Nd|K3PL9x_|%?=0X&4`CehlD0f zWU%d&S4xOi3b+~s^3k~{xDgS19PB-tZwITBr^f;1T zjU3V*O7P|1raU!n{o@bf|d9w5d23w^!z8F7fV{K~knlHUWUvG0^ zSq1Y+kw3vTx;{)IPyl0jA1$pP^?o57>uHyB*ocG|p6G-1aatr@^j1H*LrU*vxzmL> zzO-ph#nFWfx~}M7w3$FQWGI5E&g-oW>Km-aw5SXTaE^l)l<5*UVcVagapj0O&6pu; zO)N7<^Q3;F%>N6xkB$4G7~0|XwF~`k+Z6lZDCT_oCxML=AX$UavmbaGQqis7rl&0G zmabBFN}mYmFM$+kHzX}QJ=?C+v5}6>4PLre=qZw-se{*VI5fMx?o=ZdqV14v|R zm&FQLl8Y`2=IaWfheB{Tn%Ks$Eof=u`H(z8sK^g{MAMSxD{_kmg$m+S+e;@VdIP|i z4+%r;#11&7NL6J+?pQ;R3N>VI=0r^#kzh`;lNRYFu61(?L7dPARZ3Gw~X@*Z#Z zjbZ4x-5C8zYXP*7Q!eWiE0)jL{|b6+vG%*FzX0v}OPt*Q6M+5) zQXTb-Osq`|E&dIj%3GG$0x&*rY7oB@)7{x@FN9!2+6$89VI(pS#|XVlw47Nl5_#Db*twg+ z{!Q;{I7TwSfU*ds1PA9UgV>EMMxq$owfc*Mfys+3xHMwqcIR~?n)jzp)n@ht=a5*Xo0o4G9>G`Ju2}&-^Who-slOS$4+&9A6jRvfF{xMZrIpj%j=>200ojgc< zCCfZ&%jY;sdfLU6^o(REvr6IE+I! zcT+#G#`fB7bEIin>aa7=iWxU0->6{f_vfyQz=^K=glw&b$CbPfL}9ht%t5DAkIy8@ z=D{d7D0@QP)SAw>#Qk>Swx$v_EKRJ0+T_V;@qLRd4c}wcr+4N>b5|#?6OYohbfUkE z+8^+n^ak`tkg}hswhr)f=;XeC{RpOgk#p|~pUKRYCv=GC955I0KS_EwmnbDFm=#P?V`tataTeE5rkW`an zzjnDlH!RL}09<$=v*g)k*?)L)0>TzN0z?)>LJ32$49w)l&Gr(@UUAtJQRehp)X%Ze z?p*|_zOsPwRcLP^)+2#~0mq=b*S$X= z*4@#8qQOd>d?7T5T3Om%8P8t=J=-SvS_{zHitlw@7P=%lf&*p>LbLi^(W5Yw6_&}a zG?dYaSV3@Et<~idso-1)jZ;C2l(gD#?5)f#E_72f3tSSl4Apa;Bef6M-F_g)TmZ2= zC_ajVy0I3H0EqUIZr^M&J#ln21(~B2=hkzLA0q=V|IDrC(q1btiV}ZWd5Aqy=F|qt zhGhj5yV*=OFAvOtmzlIGnzS)s?f7fsC$hOS{RmH83M*FiH&lyt6)nc|K+Pl@7FSOi zKd0W!$}=0qMV9Wp{U+OZ-(jUvF%!PcpFUo@zkGa@NZ4-u-GGdGHX%mWCh;m;mEtF5 z6|!BGnR(>0t*#N^DtBKPcy|A&d}z?)jyIatxNL!|Kn0OCmR!k zfA<7yG;HjSSdqSO^#+9avU^;NyL!;f=XI8^KtdKsvu=OeLW6_~NHotVBdH`#O8Nbn ziBFVPNW8J8A_$al_fZ zse5PJ`+e_a=HBK@pQOVpk~!%|AmL zF<}5yRC!iidN@_Ska?ZoMB2Bb-2kP!WI|TF_N^iWMo*s0fC9MRS`5X@IFVHNIJ4}F z&Qco(Iafpiv50^AkZ=rHA5@tze&&NoDtRPmMPG%6W5yK{mdI#i~6SN0Z zN_~86)FOE!5@@y^5-9CB>%!Xf!7-DGgH#Hcj2K?0&j=}6!UB!qxep2fs~rLI>t{xE zW4K>a>{avZ(vh*?F@q0G@RpQWIcdY16S{Qo`#uLTQ-4xgd~itF7^ZQE0dIVJNepaR zq@M{KE1>UVCvjdJszf|jK1P%xDj>FmkQRwj#v6ccX;PG-a3jExGUh6pGPfJ#xDP5P zSOf_wzaOT>9aAP_l7hXv1Tm~RfAbiS?OIN9szs8ZI*mb%S$bV$H1`Em+aL|>Hn1`Z z%S>PGy{0mZaXk$fD69s@3vBxj$c2a!gq-dnP{44MO90q091O?~Fgad7u9Qcy+2x>aypK=&?yFm{Y?3Q5-J^38Ys6ab(1J z4vFEUK5Z#JP&UD4U34VL0i8Wvt`yj$$7`Y>%82+}>`Ztu1cDy7t{;125Whk9dvX&` zIzuNC(=AShP+6>4El5`0c!tJ~=rEsb5U9+f`%iq)7ndbJHA6s>@`H*6))5GUDrNgm z-yP-Wx`J(;mt`+0-;#qIuZgf~)tuEdh934th}YY7dV`Fs>v0E&xFH$6)`dL9~(%)(Bp7IFL^Z`k-&X<(`J zz$dl+FSq=liMS_hj1|J<8FlYf=@f7$Pn(d)!Ytjk`TpgG|b z_LV1RVXPRo3qZC;AULicMQ6du0zFWh&at7CexDV+GB5ubTn#6B$WhD0fS1u zK~WcCZR;GH`T~K(Gr@^6mzE{(xIO?bUBIfscHsk-v=Vmtski0p`Yd{=AN6OqQYot& zrMHMmnx|s^z)Jo(y+kY0{8MnGVe>i+rDxo4J||9{KKTusWjCtGlm%`6Ojn;0)WL3y zNP{xe0}QuM=&hfiikn_~&lyAJv(bHP52;i5Urw>#`TJ0dMcp*gAdE z&}Yb{NYD4sEUv?E7n3SEn#(;$w;A*Y-56k+aR>44xKzRYZa48~e+qBzIXC4#9HiHU zDi-}x!c&fwW{u*pXzms9bJKxiQ}f<@tYk-e9#8L952GJh#=BvR9*7urWj>bbQjXkb z?^k*&9Glj``Fh_6aSC(~QI4Hy9Kva;-I{^CEKRe2TB1B&TBuI$24U?13#J9wfM1`F04E1KA^CgHPcd z?7>F?2OTw;(4vGbZSr8-N}CIlHP26TzZ+KUUQw*-hTwrlROGjsQcmf|<=c(Q>Tuoe z<4$AU)_bkk>9NFNt7IlYF-ms`-zTidkr)C_QB_z{;D;t3L+VOi^ko~^$s7Ks!tfr3 z?kZgY8}^rf{RRxGRBP9k!HK&rNI=+w6kZCi6xLjXyXnzS|^FQu(- zr2Y8ZB_saznj5I;Wk-uH+-CK#q_bdn}XXwHQF<9iJK~yK+-|yQ|~%WaAt7j6y%=I%H>h z{Qb9g1dNxs%$OBt`|IR%=JQi-?WbMvYf6po8-kcJE$OyxAkc)FT0Qfa|Emr#;A-RR za);>=*dupg-@_nTAyawe_OnliCuop>mLmC&8U1@~c20IbUARXQKhdA? z#Lk0a^$$>udhphKj&6BC_uM4dErn(s#bV;A1#e&zUz`$5Dpjk- z7bhUgP)ullk9%=nQ(r9LrY$55&x}5ehIn`9oTRHO#EoQu=|@z34Z`;s-JVRyZ?ho! z*Qe~Smd0V558$@_K-!5vJW}coes{;ry0OLI=dp8cM2)g*%oL9u-F z@JJ4Z_u;d~f&? z{RP|6Oj74VDD{$Y7oVzQBPyrH(-CHHSYYXSumr(r8yTs64LuS>=hemLVPv*FmC&Ap z=sTB|L+3f5E=##G=PYzbLDlu-nNekldP}F++1C~VgO(0C5YO8zGEgX?ZLudT$T;N7FqBfC4SQM(jPLw2r@0J)xZrYQznkWlsJ8<y6JE}UStcF} zcbEpggeyB0BsJfKK6w%B=#f9eVcCcpDi!6)ibOA_UjN(L9O+>ev!-$6x|;tx-=_*r z1uj+|lg^86N|ZRz+s>TifQF~1{-s0qtDBUbQ=TluOwm1zTsvuyN7%tu@tUZ={{!d# zJES=$y#pxIt&kh^#HCOh^u)Dr7InD;wPoTQSZeBP^VTLE()5$t7GI}DQ3l9dDWfVY zk0UYj!Qh1bZfLQo>G_(vhnHH1OKNR)@n&doc3~EQr#gB;vX)%2QN|n$O!xlvks1qKzUGz8S#g!if?bSA4hEH@9UG#SS5k@yY z%r1X^pL>OivhzObRM3=xuXAqy=>#q_oRITWqwAUO)j;s_rv#NLd&p4X9EVaB6=Mz)`L; zQqI;&>{`d-!gs1R@jh{VI&x|NW?6$B*Sdc)cka$qKh%miy;V{8tuxJm^=fwA<2&V|YmuU-+Up)t_8+Fqe!R58ekhY$(mgwpF;`e&&Lr z7$QSHnTJ8bt5-9dcQ9OBVJ|37_HfnJjIJCGwJQshy|Zc4LQs0_i78xTKPhDh1_GZZ3_ zTp%JIPQ%~?2KWXh)sh?u*+~FR)g#kPfHuP{${hVJNu%CyAxNIP$DP`^K2Xpr5sqt=dyE-0yE5jZ> zBN279iu%P6(Xq(quc+gFXW||KgmmnJx-)azNg_f~-YT0~X#0W+SK0wp?IKzu-AtyXu>-xqJcBf$WNsoR*it)~G0~3&&4`T`1yq$}@=ZmMyW+)ogo?0siI#B$HGX3^uwOQ& z(Y@=`IXp11D9K<q_tR^-UmleR(gaac`q&LM2g4vW%$nj3?4-d>S5Egmx&F zAnlce5p`E24kvk`X^$_$cq7AjW5aOusQFNm?ayg?mZ}vuYhA^T@e>-Y)^d}@c*YCn z(U|_{hcTRmiEk3`PtPB#>jgi14)eIOsjr46!_9>SB{qxM+|D^o>|KaUK6kgpYleD> zr7|k#MQ)w89el@7pdM1@q*A&0jbofho2cxviw+(xTaur2$S%5>W!kd0`?dM6J5Di*^ zHL-qYA$s!O2W3M+&SZV4wBdAcWqYZ`oZ(ciQtV}?!SAF}MbW1md{en4Ce27^VGrJ& zC-z+SJHzp=_sECto;rNkx20XPOb3TBz}sercoT2pz2J{L@ppz+MwWP;`__y{!oX)4 znBYk5{^R_P76}2zg}}fQFAy-r@=(4kW78L4*5mL4w7(YOPB`?Rq1XFZTWzaW-}D#c zKQSMozZDm={qRTO=c=5cJ$xS3^L~&1fZQLYo9-9X?Pn9J$T=W?vBidx=~_xR!)H*L zWpmi^QA?VuUNy6W;1|YN%9q?AbYKc+;)+%l*6=UL zxEjo7?w1arQ?AkSLBCMZ1>FoWzJB<*SgSD?odakW2?$-po^%6wkvV5}!>Bc)C(@*Y z#;=HK{b@n7Rb(*|9Qm! z9r&-JZ_&{C`=bREpSL=K&ae%EeBwVCnP{M$&ZGW?RY9CvQ}P(m(p#3)3IrFnBlADJ zlEvf^X=;V?!|)L^Ub6>1j4pAujmX?&7ZT#65~*q0$!inK0U{%WE98X;L=n&OgMSfU3aQQC)s}rqU@R zq(ar$@iVB%ED@t5(OCQJ&P4pP*@(Mg-AJgEHKW~lbeo+VnC56OxKgDlb1CvT3St)9 zX=bSuNxjCkb`2*(?}8)}_U8>b%KMRn{5}>v(i9Z=K{EDG>hX}3lPXL^q|_KpqPNxl2tx^N2gmHdXzCk@z?%-hfJ5f z{|PkHFZXEWm>>-rq6;+4Z68SyAE3m!W~pYJDhWh8P5^0s5va3PBzA_6a#d zF(ou7Gi>9(+r(1s)rq6}%3CW1N63sI&1D|~c|pZwwO4D;s4HMUyj06P!7v)o|37e?B*U;w+?4LG)*4`}xf z(jO zc)()4y{j&zr_R|Ygi*%Khrbh?7q1yql(ng>ijSMv7rzM15Uzy@Icu_%!*hkWk$q}j zL=oL(@EZ8uec|+@WOT^M6Du*YU`agblRQ!oUl(%i0I*&<;gv@VRTi-o^q;Mx~X*8~vWN zfTpWF*y*j2TGQ42563o=;G@v!kDeEYg==GcdUbBY{4NTlR)!V`AS<%1Y~{919S<4woLPVl&k&oVnfE!VgH+_VpS}$z<=w ze81Y-6?ELcvu*QeLXK$tScl?~Kv`aPeZT#sHOji5oY2!5x}9y|VHpd;E<0gwZ}5iqrcJAP;X}>#KE7%Ob|w_<*Y0 zg#rpGb++RVM5Wy25DzZB$GgdKm&;W?Zy$z>N5ENh!$l|V7NM^&yTi1I95lAexQz{1 zcx_I24`OOWkoc_@c+3;$=KKv)7fc)TJOdKUT(z!l{kQW+(z^~jWnSJ$_`SIc#!hhE z@5%73>H45&p196_9TvE*z-}MkVnS_4wE&e8b%6=9i6#S;g0T6?BNst;;PmkkDR(tO zcEHFZLaF$A0F~;mfC!_9YXQkvb%5yK;@A3iP(|1tHiBn=M18nV1_x`W?E|r-k)3 ziPQu-z)^4UAgJ{H*h&55)AkVZbrA6IU9OsMJ3qbQ9iPU?(~G-`f1me$M_tD8hYQqy z^K`h{&II;`00Q!T*3S7Ib(uc_|9E|#^xD+4eoT5k&y!wd@X&{ng+miDCPZ1hUFK5f znC3&@4o342^&t|uuN9lF=1=hyt0k0lwe*t-P&Bsg$Bs9-c&(^lQ2I5V7G(JI5>g58$>2f z`kI*#7@Ix>Pa0}LGS{=G3QD3ue4_C!ZZF(Y_!X&2F?IPqwV5#;8PvP>@=2#Y70@GdzrXgDW$O~VD|w|^$cYc(cy@y3XvELeL;m+ z8t?@$Fvtmj(opoTB9HZ2RQ0h+@a8G&&`NU|ak{Ze`2&Tb5;yg)*CiKIX_H#FJetDM zhUdK>@w4cTj#Kp5sczt%*xjl25_#=2Vt8%sb)cR|D2UsMzmm z>yumJXRvf6nS^wi;N;$y$okt@ZsMzlJ=jXWqO%-nx}&UDu|>Jet8a+D3yky?Lf-TTGFkQT9T5qyoeQ7N%DcFCM}mw34b z6XPdGar{nG%t}FAZB9l+-f?fiQ~~*r!BAvQB@Ds%i0(Py#J(+@dFpCP|dYVw5XwcB-{?}0N%PuzT!208siWp zmGH5(eZFt;6792Fe4kUxPU9h%$-t*mBwYK2Hugh=hd3!f$GV}p%!S7EE6@BR#!67(p?MX0Tq~TEjw0 zt7LJ;h){`HLeP?x`=*uxEx-hb)@M#$-xY(=x@>*HM0f_VUe5fjJ)(Yt1Wf&B1k8?J z%!=2#2f0fL>{s7Fxq1Sy3ntj+ayma`X}=+Nx|;LSB<2;w?iYz3<96Aj=2VIm{(m!Lzs)j(0dAaOIL*0zn;+*<_#)7(G6?r}9p4 z*gj1i+TBD(9xavs`_R~;ICDWXd@JEV;G7`FZS3JXJ$Er$VC^ea-&3=R z73EedKPoY8?xy!Bx!L3T#|i}o6xfxxuspWjT~?~eCa_<#Oy_v|)*Qb18XF}BIE#vR z8}J5xH)VQaZfkE%We`{$;UBZznXf_g8HhO5VbwykM zI9PE#cE3NmUAri$j)1vJA2MCDm^F>i7I7Z~`mGhV8S$jCz(buH%DGd`~FuAhHaM8C+TS1#g9>!=a%3fFmCAf(d1>`Ck5sbR0uf|8Ad3j|z1kpxhXKX!)VU!2g80+nC<}6^@cmMT z5p?cKfiB0im@qh}@L^E=)bjay${D$2n>TCT%utQx)MxH!b8TLoXhxw5^CeIwGtot4 zbmqdflnQ->gte2Ys&QelJ2FMIBU!8%F?-YZ;8=j7nmW9@KpE1kZFg|?lur-zVKQHW znKSI8UH6y+F$=HUWy+n#pB%u>6)P`X1@_Iw3 zp#N5Bcqy_sa}ZAlf#i{5I4Gs|tDvaE>*1`m)@HZG2F(m;3kp@lEY<2;2GWVB*{lX3 zuI{vpt`gSoMjX8hT;FyZ3X0_T$IUP?W$hgMBX%phsVFu2nt%GM%E29IRyJZ5N)R_X*`5XfDdM9B} z4m3^FH5WcRJpUbML_;H(WU07-yS^wM2i}9o{#CaxjRshOPnC&$1*B{Ekbb9b^{5YM zKCHwtMkqn;xL`S$oWOt+DT{=xa&BnynM?evX7)X(=& zGZBI8b)du#1kk{#?TCk*Zv&8wn(Ei2W~)AbK)gHywL9v}ZT0}E7bw^q3{*Vu%{-iE zD)(#?SZi zqkm}B5k482fcFH7k9vK2d(Z&paB;%B0ef=rLXX#4G;fK&ZmMns_NJj*srmxKJiK$a7Brzq(|a6~ z!{4)5nnjXsU7;yqP~k;H*0}3iGd8_8R!?3g9cJ^?w>EH!+S|bI6njg6g==#Hv=8%ut-Lk|Xd4V-YAY_W$L+wF?P_3jmZW|dx(*q@>Go)oZ-#qk7k2XcP6rNmOq2N7@6 zZ*j1*mKYEn&a2T&TQt`U%9tIIo<2PBp99;jZeQyYtNkE-C?$L0A;G%z$!G|B&6qdX z8+rk3c`IG^8Wa+)Q<1UB8vu#5A)UD|jaswcvh~=diDs$5DbwvI5+W-Hguao@RNZ^0 zR=>y?KgbjxnP9HaNTlAe`0)XyyMq-YR8CS1bLp!PQ8zHSb07w|GTImcDE|#{V#uo1 zF@JJ7I9z`v8z7jlq-Z@$G5Hn1v7?Q75(P{ZPA39Y^b;B(0Iq>9fS51^TNxuCZ*6l$ zYQQ+uQ9K80&0A0~v}#WM&Jx?TdMIB*Q)+*e_OmnxPpcPL;3IuaKMe zRfKn5iBN$TS%Iv=p>Bkn$*HIQgwR>6e6Y$-)EFt^F+$A7x#Bul zzB$3QGr`2!ifX>JUKv1*TW>F2Xnm-x)tFyncUVM6>nmN`h*7t;o`IBrKiQ6Qj3~w= z0Y*;(mIUJ8%XxwT9SI6_gAYZ`D{|my37x8}Ua<5e1$Q*O> zUKbJ=ennydC{Ffh2Y0z6k1`xs2v<8_wC%g+6^PUPL?yrs%DF&Or&v9o{RG0uk{aqN zWT7)jw=`a_L_a%z;H3E^SHf$>=(`VpzyLMx{FW?HJ(q8(xFQ&9t%*Wb*>#{y&^uTe zM%is3J$R;Z)f$$5E$M)ry_M>76bzwoz-~Yenc?DBkqOBf_xMU-GW{)KZBEot{XD0! z!H^FW7v*16FGPcA2dB-*L#D9m!uxTrYnE~iH(+DJrq!@ftkuIs;)9c6+s#*=3?5CyF%J#~nX$A} z)zjKK0i&T;Ao;z{8v|nL(ZsvL!05DVK-O{g zT=`joGp#H+E-a3N;y~82-cYh@^G1^d*k7ZW4hZQ?Qs+VvOP>4y25W6GRC%ccqa!@6 z#IR1Mjx;N=Qu9ny0Kb;p$$!wQZiL(9DyQpwF;#=@LXim}!oh#LEx@<`x-*fy)9pP1=Q>p8d@Mt^$$;XPJx}3TaP?alvG8;9;v1K$- zkaN`%@!`Tfr4l5 zqUns|6TIm^+b+z@E3>|<_g4d@chT!Rk>_|NvuDAR-`_o0*ch0Z{Gm?!WA~7tV)JI1 z5$S1F@2wHxfgol!oQ1zLjuRZQ4N8FQqc4&}oYj|@g^bNw6Ws6KW<1ccN&vc#IQ_RP zkDHguC3szDW`p_2pDH!>TA*0cp^)xnEI^mrieF>IOznN2H;EaFZ>NbE2xXhx?k)7# zCE10(@nA4;^-Oy*z#W_Pl|+V7Ie_Za050r%Wr57=BpBr*u$j8+L)c!RUPifqmtV|? zBU}7RyF$}zJN?eN90pX33NFhSN@?i>s{^Sq2wuC6x^d*#oGnA21^Uv$fe)ZV8)1YC zA<{z-F~0`Z=+&-zArun_Ubw$>RS%q8?G7S3t77a5&-FB90C>1BLn9;6Ti_&PJ+y)3 zK4B9_Jl{S-tP~*e({)#qPX1M?p6zrk*s4$|Ex!p9f3tRi(o^7X>y0HJ0iF58I#JN5 ztVW;uAG#aMND4Z1m2re<5FVAUZ(^9!`cmekYM#^+G~g7mi8h@p6H_j#w!~H>K#+F)eP?#$L`!^SWsaS;Q$rjcskY5krlNu73YH}v z8a<-kRs4*5p@UfmbChZ&WSKrKmJRBt;|XE`0E=tudrp6}?vfFeK7~a<;IePtLTvnD ze6r*s2NgHMdr`zYK_;0%kl9zVgrYrjqm)+Bv?^jktJd$Xe1}>bDHMP2|N!J!($cIFTLWSMlX1!hkanNvKAH z(egZzYEv&uMc1J*>kU)~0Zv$?RI9)vo`PUVgJEwH4+kwjkGv;HlfTG9Oe26 z7pqN+zOF&2ILMi zJbkq)o3bKI5Cgv@+T6=6PkuEbFy`wM9}}4C+o-2*py384HnL=0Fm(}aaz?8>Qnb<1 z+f~-cuX!L=YYlt<`;_$&Z;sD@m*vf6B!s8FC=ep|*L-NMUc_f!^y_q6@P#bxs~sw-bRa-W)Lm*KUjWy1wh< z3}in`j8p_%0sk$Gnq`i8+P3W?HB1Yt#*=gufr=W;S3>KDF|vlQn6XNgy&2*F9={Yh z(#jl9rMYw!(O}1Ul~>%|diE#ynxDoWm%yT!7@c|p*$Mb^-kKHdvI{9CPjaBYKIOGw zrOn-x-fTU%QAQUH>|iU9$;v#$8zSc$DtDkt&lO;%ev~e$<{0(ZauOSa5t@CPzR1Lq zm-Fs*e#Mx7p_(VeEu}@I;eeSEbWq<~u0W~)?hP%SgQpkO8{GPdP&%|ZxNkdMm!FZ4 z?WPPhvBCe*hBne_;sA(2UE@I<@v0Z4nLPgKoK*k;cRxn{DOFwrr*Z<0GzrRkD9a*+ zU)YGF?b?m$Ss$#T@9to+CIQvD7rg!ph}K)f67mIA%s)OU>h&MvmOr3<+SRXxbEj5*w&Jq=cBgi9a`>TV@kbATUTWSeE!(CEB0a|dg&P;^Cvhf|CB8Q-E{@k- z%`NZ_Ewy9KXt2GePljx>_8C+9RfDXcrx=~R3qHp0T-fzq(UYiI$R2h+(Xi%KJn zD~K~k@RJWCd>>v5zU~esjnWy5i=&tiIS6DR)>E8w>r$D$ku$fV{6c(5;Jotn8YKHu z>v!opyW`w`dkRIy8SxKh#UuG9zB)D=g+yMP{*AcUK%=An%Dx|0b1^W!@u|(j5~ld+ zm5GQB&eu}f596*h`+ZyxR#L^*=~AR9nwedFnK9s-qD32wR7In3 z`t8}+%+$m0>$;1SO@jx)EADvmx}>UvvM`V*2sBM3FYAc-6rmWBr`zu^rV zbELWK;y0Y7$YdEgVwx;w+xd0;@EG$Bw^ z`A*f~dq`J%WO)!V?0xViMNcqeW<}v7AZqYU&&cK;B{>%|YA>cYTq2#o^;c@oTAvi2 zP=ws`zrV2aXgm2Zqdwo$;=}!ujg`}n>)(I%_A*tQAENlr z!Yywd{e@wysTdwBn~|DFJ_jLKDAIoBA7RwiEU;lip^8>kts8xJx-ZceiwA1a02Cv$ z>NtKL=~}2or6Gt$=Rlu$1FfMTWwL&!Z({OlxQR*ob+NM7i7F3ehOJxY=MsidnEIW| zA>*c#uv&!_^;;9jU?f7qP1MK@SNcXnbLO&Ip#RWsuigqgUmQ&%9^T> zrs~lIl4PnN*CV`bgmi6FDCk(^N*jyg_au&hm)I|4R=WC<6{9vAIip~BYlhSbOqk~i z#+o7}S=e#;bM;7dth!-a_!Loyd(by84<0^O7$sXLt2@GjYdJ8Y7@G_Ybx2Vg+p%Nd z>6#P|0`x!ft6wC9O#yP?O1niozu0>L-MRK(go+s67JzC#$Da(xoPwwc06mC#-> z&nP3ZPmQMwNXfHN`Yya!Yw$6es`>Y_u;|S?atu^3jFgrhz3HW%V5}K`T_1$wcpMOQ>I3cWXga}H7Lg%(-c62p5Bk6#6Olwk5`4K3qMcU*>8f^||1 zM$=o#^OP9aT)jGqp$ErN?>RlCwXahl%@J&^+S1|T@i5+3KB>5ID>zHJfZ;lxyi<%e zOt4o9*>z)CO|a7%jNHl`x=k0dx9kx837g%@U}>OTs2mMF0&?Qv?dh^w7|!(T7Ka4@ z0wDT>9Q8=1E*{9<^a0P6oU{7AmB$6%b>RJ4NnYHJF*Q-mGw*c?8247a|%oa zw+XOgDV!N&cU@4LVP0u$pO2{*v{p4Sci5l2A}9&99Zo^sUW-^GhsJ#Fd!7aGIbol5 zR^g*frXg6hmmA{P+XCMKh|N@>573U?15=!VR3CotgM|oU#(+j zspPFy^CzebHSBr6G~!EGP~FFDwf+otO&yy=N&vT%ns~^!j3#++Y8aDs!=F;# zpL;+BYiI?-9!n%Xg_Nr;Kbz>Z7Ej!wc$(@~F& zjMqG`H!SN8Z$_o*q-X~jsud{*-q2Bf1p9EHVGq8&o3!VFaR?EQk-uY1u0a)#mQdjE zo~!_LRt4v9XL~pQfP6>A0r;;op#;K$P3Gfs1*@JzAb-Ob{XZ%xE2b~Qog=^Im7MJin4i|yP`8&5@K5oEY6DzIMk6M+LE1sY^+C$-;?WFnRRkJZZI7y!FK}dUS zW_V;L^~7oj7{HY#)|C&%h1JM-*f4>uGHrL=<1<2>Y-VoNq6 z=cR@H?{`xF@jw;DMBXThw#`Y#p@*dLtP0K3LtszqHr zmqln4OU8&_2cG-9M_|<50qkaC`2wdyAf~XM2nZx{kReF>H=&lN$Db6oy(M#|4{i~^ zx${zXAGPBMJ^WI19jZM%Kf%Tq-hq9V?$B})-W3~SklHllw_v?RPF`qkAX&+q!LYL! zQDoX<5Qz0!o-I6I@`lQAAeO0Q-A2N>)p-uR8I@%*rT#hrE>Cq_BKTaL+*u9XSE}7T zg1kkzZuQ|S423ov%4F>K-Y9-8V<1w})hw1y8Qi5T{GK?gnVw_` zCwmL95YP2sV6H3anUgf)h2N>=`^Gxa^=4NDvqv&UbP=DL>QTtXO}BakwY0H0%>*~r zwI?srO>|$0x|@N;jv8L11FGXIhGx*Hck+4XX=tN993A6pv`9xyj3$g!3u3~sfPyBG zjpCZtbNsK3a0393UgcvweTTwN!rwWgFIM7M{-sqD_PcEa3wO69Q{~E zz>l0tPf~nqg{BMR7D<`sTsqa=7(!MFe!k;mt(c<@;;}YWqxh{6b;~`^k;;5%3hCtA zgbQT?>8A}mVq?2TcnPUOMIq5Q^dSagcrg%`7G@P*TE^Ax5aPa<^nI1SULei+i2}&u zxR+&ZEHeD$XmQ-L>pblMx6sx;yGuw-vsJ7r5FDiCI30u_g--g$*7 zOGkm~;XPPp4e~b0atwvr;ege7$VCTzvL~oTIy?qUmiNPF@q9wsApc_3>uMy@MpZDz zNLsp zE=Q>atDvPI!Td`~v=t%d{xVWVZOJIVnl{x{w?O4;9dX*IyE^ew{#U1p=@8 zW_RjhVy4{D<>6eD2l>5Gl=L2?v=+BNC1=;06GrNb5HBLya#->H%?Ji^hu4xhOaTzb zzTi2p`&P(RhI)Xmzw=o&P0%5Cw||9~mj(tw1AX@7`9HE?J^$g40`U9s?e8*E{aa3~ zm%u;X{(R*8qx^6~`dI*e9?w7i9q@moym|@$GUe4T_~GA%|Cs>mCH4=jpH=^nCFW-V z_+33~Y5ZN)U*wE=3H~x?%r9_}=hOM`fd9-O^Ah=`c=j*kc;w$h{!>c(CGJZx%wM>8 z&-dQHQ{(?t8uKO157?hi{f9aHX94)R6aPKUzhs~OOP72p684K>^q(-ikPLg-j+cT} zzgP-M|3N!m%2&Ol`2qXCKd!@9e^2wTpu_+2xLzt8{c4B+`9EOzU-gb&w&tZ+%`dKX z%74K1vswQpUGtLZr6R~LrtRk}fPdGUe-iv#u;!ooATMcNDn|UGp?&tD{D08=(vNsa z^)le}7nS<+7WMx_^&|ZBCCd-gpZ)EJJN?fB@LL!9dzSxnu78RD(z*T@KC|#|uR(h{yXR|Tx4IuzjTrPRe7q{zYG7H9f1G6huwT5Scxi9=MX~k& sp!jKhc**ke5dMpW&Ger) Date: Thu, 11 Aug 2022 11:29:51 +0200 Subject: [PATCH 064/149] use local file --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index d162543b7..31be453cf 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -57,7 +57,7 @@ ], "sources": [ { - "type": "url", + "type": "file", "path": "./monet/material_color_utilities_python-0.1.0-py3-none-any.whl", "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" } From 4d74bc5cf92bbe1813f5b1e6e5e0e51a72558831 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 11:49:04 +0200 Subject: [PATCH 065/149] add tone row --- src/window.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 3a705f98a..11b6724fc 100644 --- a/src/window.py +++ b/src/window.py @@ -81,11 +81,16 @@ def on_file_picker_button_clicked(self, *args): def on_monet_file_chooser_response(self, widget, response): if response == Gtk.ResponseType.ACCEPT: - image_file = self.monet_file_chooser_dialog.get_file() - image_basename = image_file.get_basename() + self.monet_image_file = self.monet_file_chooser_dialog.get_file() + image_basename = self.monet_image_file.get_basename() self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() + self.monet_img = Image.open(self.monet_image_file) + self.monet_theme = themeFromImage(self.monet_img) + self.monet_palette = self.monet_theme["palette"] + self.get_application().update_theme_from_monet(self.monet_theme) + def setup_monet_page(self): @@ -126,6 +131,10 @@ def setup_monet_page(self): self.content_monet.add(monet_pref_group) + self.tone_row = Adw.ComboRow() + self.tone_row.set_title(_("Tone")) + print(dir(self.tone_row)) + def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() for app_type in settings_schema["custom_css_app_types"]: From aad88ff496f9aa86a198cc763b40fb002d9356aa Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:03:21 +0200 Subject: [PATCH 066/149] add tone row --- src/window.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 11b6724fc..19122fad4 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] - self.get_application().update_theme_from_monet(self.monet_theme) + #self.get_application().update_theme_from_monet(self.monet_theme, self.tone_row.get_selected_item()) def setup_monet_page(self): @@ -133,6 +133,22 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) + + store = Gtk.ListStore(str) + store_values = [ + "1", + "5", + "10", + "15", + "20", + "25", + "United Kingdom", + "United States of America", + "Uruguay", + ] + for v in store_values: + store.append([v]) + self.tone_row.set_list_factory(store) print(dir(self.tone_row)) def setup_plugins_page(self): From 07e22ed96ec3235362fe97b9eba18dc42d3e7607 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:04:09 +0200 Subject: [PATCH 067/149] update list factory --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 19122fad4..f84a5318a 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListStore(str) + store = Gtk.ListItemFactory(str) store_values = [ "1", "5", From e1ff0aa84875576437f24bf4eb582d27a9d37b03 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:04:34 +0200 Subject: [PATCH 068/149] fix bug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index f84a5318a..8353a828f 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListItemFactory(str) + store = Gtk.ListItemFactory() store_values = [ "1", "5", From ce2067fd00189e92983b24011ea4127c983e9300 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:05:14 +0200 Subject: [PATCH 069/149] add debug info --- src/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window.py b/src/window.py index 8353a828f..7bc102f3e 100644 --- a/src/window.py +++ b/src/window.py @@ -135,6 +135,7 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.ListItemFactory() + print(dir(store)) store_values = [ "1", "5", From 11448c487a8b9a63e843163b5332e1438e99268b Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:06:23 +0200 Subject: [PATCH 070/149] update tone row --- src/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 7bc102f3e..a99b42d00 100644 --- a/src/window.py +++ b/src/window.py @@ -147,8 +147,7 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - for v in store_values: - store.append([v]) + store.set_data(store_values) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From c81d7af57511aa01501975cab814d9d510c70e0d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:07:34 +0200 Subject: [PATCH 071/149] update tone row --- src/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index a99b42d00..0e61c581d 100644 --- a/src/window.py +++ b/src/window.py @@ -147,7 +147,8 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - store.set_data(store_values) + store.replace_qdata(store_values) + store.replace_data(store_values) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From 352ae0c33575f76f96b6c8371f7aa79153cafcef Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:09:18 +0200 Subject: [PATCH 072/149] use GtkStringList --- src/window.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/window.py b/src/window.py index 0e61c581d..b35550b53 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListItemFactory() + store = Gtk.StringList() print(dir(store)) store_values = [ "1", @@ -147,8 +147,8 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - store.replace_qdata(store_values) - store.replace_data(store_values) + for v in store_values: + store.append([v]) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From c50cb8d000238e685bab787f1ad7518763088934 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:09:42 +0200 Subject: [PATCH 073/149] fix error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b35550b53..b28bac1d1 100644 --- a/src/window.py +++ b/src/window.py @@ -148,7 +148,7 @@ def setup_monet_page(self): "Uruguay", ] for v in store_values: - store.append([v]) + store.append(v) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From 5744873bb80e64db6949e5ac5bff2e2f9a2df308 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:10:26 +0200 Subject: [PATCH 074/149] use set_model --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b28bac1d1..258025af3 100644 --- a/src/window.py +++ b/src/window.py @@ -149,7 +149,7 @@ def setup_monet_page(self): ] for v in store_values: store.append(v) - self.tone_row.set_list_factory(store) + self.tone_row.set_model(store) print(dir(self.tone_row)) def setup_plugins_page(self): From 35f78ffb9cfdbac53cd1468e2eb3ab99dc17db9c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:11:07 +0200 Subject: [PATCH 075/149] add tone row to the page --- src/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 258025af3..434c417a6 100644 --- a/src/window.py +++ b/src/window.py @@ -135,7 +135,6 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - print(dir(store)) store_values = [ "1", "5", @@ -150,7 +149,7 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - print(dir(self.tone_row)) + self.content_monet.add(self.tone_row) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From d3d5c3987e153922a51467b62499900a522b5895 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:11:47 +0200 Subject: [PATCH 076/149] update pref group --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 434c417a6..7ce2b1cf8 100644 --- a/src/window.py +++ b/src/window.py @@ -129,7 +129,6 @@ def setup_monet_page(self): self.palette_picker.add_suffix(picker) monet_pref_group.add(self.palette_picker) - self.content_monet.add(monet_pref_group) self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) @@ -149,7 +148,8 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - self.content_monet.add(self.tone_row) + monet_pref_group.add(self.tone_row) + self.content_monet.add(monet_pref_group) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From 7c50a5dc38c068761ecb9e509f6a62b7e301988e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:19:28 +0200 Subject: [PATCH 077/149] set colorpalette --- src/window.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/window.py b/src/window.py index 7ce2b1cf8..4ae21ec71 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,25 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] - #self.get_application().update_theme_from_monet(self.monet_theme, self.tone_row.get_selected_item()) + self.tone = self.tone_row.get_selected_item() + + i = 0 + """ + {'primary': , + 'secondary': , + 'tertiary': , + 'neutral': , + 'neutralVariant': , + 'error': } + """ + print(self.monet_palette) + print(self.monet_theme) + for color in self.monet_palette.values(): + i+=1 + color = color.tone(self.tone) + self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + + #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): @@ -119,7 +137,7 @@ def setup_monet_page(self): self.palette_picker.set_title(_("Monet Palette")) self.palette_picker self.palette_pickers = {} - for i in range(5): + for i in range(6): i = i+1 picker = Gtk.ColorButton() picker.set_name(str(i)) @@ -141,9 +159,7 @@ def setup_monet_page(self): "15", "20", "25", - "United Kingdom", - "United States of America", - "Uruguay", + "30" ] for v in store_values: store.append(v) From b2a5ddd77d5096076242d8cf9192f9079b8181ae Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:20:34 +0200 Subject: [PATCH 078/149] add debug --- src/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window.py b/src/window.py index 4ae21ec71..b554ae472 100644 --- a/src/window.py +++ b/src/window.py @@ -86,6 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() + dir(self.monet_img) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From 26a74fe18f7075f6733f52b76da136449ff534db Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:21:09 +0200 Subject: [PATCH 079/149] fix bug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b554ae472..fb291e46c 100644 --- a/src/window.py +++ b/src/window.py @@ -86,7 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - dir(self.monet_img) + dir(self.monet_image_file) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From f3755eb8a1dc1dc32a0820af5b3ae53cbba5a0da Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:21:48 +0200 Subject: [PATCH 080/149] print debug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index fb291e46c..de17ed356 100644 --- a/src/window.py +++ b/src/window.py @@ -86,7 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - dir(self.monet_image_file) + print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From dbff368414eb89e07e9d65a284aad21806b23ef0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:24:58 +0200 Subject: [PATCH 081/149] use path instead of g object --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index de17ed356..83dec7b83 100644 --- a/src/window.py +++ b/src/window.py @@ -87,7 +87,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() print(dir(self.monet_image_file)) - self.monet_img = Image.open(self.monet_image_file) + self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] self.tone = self.tone_row.get_selected_item() From 028bad472421942cd85ece601bfe80362dfccb8e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:25:47 +0200 Subject: [PATCH 082/149] fix typo error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 83dec7b83..4780fa299 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,7 @@ def on_monet_file_chooser_response(self, widget, response): print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) - self.monet_palette = self.monet_theme["palette"] + self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() i = 0 From d1aa1a93cd637ad3b5cdb7a573c21a5e2e459c29 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:27:07 +0200 Subject: [PATCH 083/149] convert into int --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 4780fa299..4f5d6a4c8 100644 --- a/src/window.py +++ b/src/window.py @@ -86,11 +86,11 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() + print(dir(self.tone)) i = 0 """ @@ -105,7 +105,7 @@ def on_monet_file_chooser_response(self, widget, response): print(self.monet_theme) for color in self.monet_palette.values(): i+=1 - color = color.tone(self.tone) + color = color.tone(int(self.tone)) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) From d08f4acba7bd2fa80014900ad50437f8b8b3df31 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:28:31 +0200 Subject: [PATCH 084/149] fix error --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 4f5d6a4c8..275917824 100644 --- a/src/window.py +++ b/src/window.py @@ -90,7 +90,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - print(dir(self.tone)) + print(dir(self.tone.get_string())) i = 0 """ @@ -105,7 +105,7 @@ def on_monet_file_chooser_response(self, widget, response): print(self.monet_theme) for color in self.monet_palette.values(): i+=1 - color = color.tone(int(self.tone)) + color = color.tone(int(self.tone.get_string())) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) From 20d21ba39cd6a7c521ba1004e13a1f550b1bd4f5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:29:49 +0200 Subject: [PATCH 085/149] print debug --- src/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 275917824..866929fe4 100644 --- a/src/window.py +++ b/src/window.py @@ -90,7 +90,6 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - print(dir(self.tone.get_string())) i = 0 """ @@ -106,8 +105,10 @@ def on_monet_file_chooser_response(self, widget, response): for color in self.monet_palette.values(): i+=1 color = color.tone(int(self.tone.get_string())) + print(color) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + self.palette_pickers["1"].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): From fd5e7ac4994d76520564c938527751523d7b26bb Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:38:57 +0200 Subject: [PATCH 086/149] add toast when reset --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index e94f41da8..3b2e0e9a2 100644 --- a/src/main.py +++ b/src/main.py @@ -433,6 +433,7 @@ def reset_color_scheme(self, widget, response): file.delete() except Exception: pass + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( From 071bcaf2145fbdd43adb394cd8083e9ebf43dfff Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:44:22 +0200 Subject: [PATCH 087/149] update palette --- src/window.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/window.py b/src/window.py index 866929fe4..0c2b77390 100644 --- a/src/window.py +++ b/src/window.py @@ -102,22 +102,33 @@ def on_monet_file_chooser_response(self, widget, response): """ print(self.monet_palette) print(self.monet_theme) + self.monet_pref_group.remove(self.palette_picker) + + self.palette_picker = Adw.ActionRow() + self.palette_picker.set_name("monet_palette") + self.palette_picker.set_title(_("Monet Palette")) + self.palette_picker + self.palette_pickers = {} + i = 0 for color in self.monet_palette.values(): - i+=1 + i = i+1 + picker = Gtk.ColorButton() + picker.set_name(str(i)) color = color.tone(int(self.tone.get_string())) - print(color) - self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) - - self.palette_pickers["1"].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + picker.set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + picker.set_valign(Gtk.Align.CENTER) + self.palette_pickers[str(i)] = picker + self.palette_picker.add_suffix(picker) + self.monet_pref_group.add(self.palette_picker) #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): - monet_pref_group = Adw.PreferencesGroup() - monet_pref_group.set_name("monet") - monet_pref_group.set_title(_("Monet Engine")) - monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + self.monet_pref_group = Adw.PreferencesGroup() + self.monet_pref_group.set_name("monet") + self.monet_pref_group.set_title(_("Monet Engine")) + self.monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -132,7 +143,7 @@ def setup_monet_page(self): self.monet_file_chooser_button.connect("clicked", self.on_file_picker_button_clicked ) self.monet_file_chooser_dialog.connect("response", self.on_monet_file_chooser_response ) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) - monet_pref_group.add(self.monet_file_chooser_row) + self.monet_pref_group.add(self.monet_file_chooser_row) self.palette_picker = Adw.ActionRow() self.palette_picker.set_name("monet_palette") @@ -147,7 +158,7 @@ def setup_monet_page(self): picker.set_valign(Gtk.Align.CENTER) self.palette_pickers[str(i)] = picker self.palette_picker.add_suffix(picker) - monet_pref_group.add(self.palette_picker) + self.monet_pref_group.add(self.palette_picker) self.tone_row = Adw.ComboRow() From 2257a5afeea8c505e8d005afa551eda5d0c3c41a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:45:10 +0200 Subject: [PATCH 088/149] fix bug --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 0c2b77390..07e160ed9 100644 --- a/src/window.py +++ b/src/window.py @@ -177,8 +177,8 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - monet_pref_group.add(self.tone_row) - self.content_monet.add(monet_pref_group) + self.monet_pref_group.add(self.tone_row) + self.content_monet.add(self.monet_pref_group) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From 160e46863ad81602915df718ee421f17772bca09 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:55:12 +0200 Subject: [PATCH 089/149] update tone generation --- src/main.py | 3 ++ src/window.py | 99 ++++++++++++++++----------------------------------- 2 files changed, 33 insertions(+), 69 deletions(-) diff --git a/src/main.py b/src/main.py index 3b2e0e9a2..cb961f23a 100644 --- a/src/main.py +++ b/src/main.py @@ -206,6 +206,9 @@ def load_preset_variables(self, preset): self.reload_variables() + def update_theme_from_monet(self, theme, tone): + pass + def generate_gtk_css(self, app_type): final_css = "" for key in self.variables.keys(): diff --git a/src/window.py b/src/window.py index 07e160ed9..394b64723 100644 --- a/src/window.py +++ b/src/window.py @@ -35,6 +35,7 @@ from .custom_css_group import AdwcustomizerCustomCSSGroup from material_color_utilities_python import * + @Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') class AdwcustomizerMainWindow(Adw.ApplicationWindow): __gtype_name__ = 'AdwcustomizerMainWindow' @@ -52,7 +53,8 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) - self.presets_dropdown.get_popover().connect("show", self.on_presets_dropdown_activate) + self.presets_dropdown.get_popover().connect( + "show", self.on_presets_dropdown_activate) self.setup_monet_page() self.setup_plugins_page() @@ -81,99 +83,54 @@ def on_file_picker_button_clicked(self, *args): def on_monet_file_chooser_response(self, widget, response): if response == Gtk.ResponseType.ACCEPT: - self.monet_image_file = self.monet_file_chooser_dialog.get_file() + self.monet_image_file = self.monet_file_chooser_dialog.get_file() image_basename = self.monet_image_file.get_basename() self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) - self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - - i = 0 - """ - {'primary': , - 'secondary': , - 'tertiary': , - 'neutral': , - 'neutralVariant': , - 'error': } - """ - print(self.monet_palette) - print(self.monet_theme) - self.monet_pref_group.remove(self.palette_picker) - - self.palette_picker = Adw.ActionRow() - self.palette_picker.set_name("monet_palette") - self.palette_picker.set_title(_("Monet Palette")) - self.palette_picker - self.palette_pickers = {} - i = 0 - for color in self.monet_palette.values(): - i = i+1 - picker = Gtk.ColorButton() - picker.set_name(str(i)) - color = color.tone(int(self.tone.get_string())) - picker.set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) - picker.set_valign(Gtk.Align.CENTER) - self.palette_pickers[str(i)] = picker - self.palette_picker.add_suffix(picker) - self.monet_pref_group.add(self.palette_picker) - #self.get_application().update_theme_from_monet(self.monet_theme) + self.get_application().update_theme_from_monet(self.monet_theme, self.tone) def setup_monet_page(self): - self.monet_pref_group = Adw.PreferencesGroup() self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) - self.monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + self.monet_pref_group.set_description( + _("Monet is an engine that generates Material Design 3 palette from backgrounds color")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) - + self.monet_file_chooser_dialog = Gtk.FileChooserNative() self.monet_file_chooser_dialog.set_transient_for(self) self.monet_file_chooser_button = Gtk.Button() self.monet_file_chooser_button.set_label(_("Choose a file")) - self.monet_file_chooser_button.set_icon_name("folder-pictures-symbolic") + self.monet_file_chooser_button.set_icon_name( + "folder-pictures-symbolic") - self.monet_file_chooser_button.connect("clicked", self.on_file_picker_button_clicked ) - self.monet_file_chooser_dialog.connect("response", self.on_monet_file_chooser_response ) + self.monet_file_chooser_button.connect( + "clicked", self.on_file_picker_button_clicked) + self.monet_file_chooser_dialog.connect( + "response", self.on_monet_file_chooser_response) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) self.monet_pref_group.add(self.monet_file_chooser_row) - self.palette_picker = Adw.ActionRow() - self.palette_picker.set_name("monet_palette") - self.palette_picker.set_title(_("Monet Palette")) - self.palette_picker - self.palette_pickers = {} - for i in range(6): - i = i+1 - picker = Gtk.ColorButton() - picker.set_name(str(i)) - picker.set_rgba(Gdk.RGBA(red=0, green=0, blue=0, alpha=0)) - picker.set_valign(Gtk.Align.CENTER) - self.palette_pickers[str(i)] = picker - self.palette_picker.add_suffix(picker) + self.monet_palette_shades = AdwcustomizerPaletteShades("monet", + "Monet Palette", + 6) self.monet_pref_group.add(self.palette_picker) - self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - store_values = [ - "1", - "5", - "10", - "15", - "20", - "25", - "30" - ] + store_values = ["1"] + for i in range(5, 100, 5): + store_values.append(str(i)) for v in store_values: store.append(v) self.tone_row.set_model(store) @@ -198,26 +155,29 @@ def setup_colors_page(self): for variable in group["variables"]: pref_variable = AdwcustomizerOption(variable["name"], variable["title"], - variable.get("explanation"), + variable.get( + "explanation"), variable["adw_gtk3_support"]) pref_group.add(pref_variable) - self.get_application().pref_variables[variable["name"]] = pref_variable + self.get_application( + ).pref_variables[variable["name"]] = pref_variable self.content.add(pref_group) palette_pref_group = Adw.PreferencesGroup() palette_pref_group.set_name("palette_colors") palette_pref_group.set_title(_("Palette Colors")) - palette_pref_group.set_description(_("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) + palette_pref_group.set_description( + _("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) for color in settings_schema["palette"]: palette_shades = AdwcustomizerPaletteShades(color["prefix"], color["title"], color["n_shades"]) palette_pref_group.add(palette_shades) - self.get_application().pref_palette_shades[color["prefix"]] = palette_shades + self.get_application( + ).pref_palette_shades[color["prefix"]] = palette_shades self.content.add(palette_pref_group) - def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) while child is not None: @@ -225,7 +185,8 @@ def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) self.errors_button.set_visible(len(errors) > 0) for error in errors: - self.errors_list.append(AdwcustomizerError(error["error"], error["element"], error["line"])) + self.errors_list.append(AdwcustomizerError( + error["error"], error["element"], error["line"])) def on_presets_dropdown_activate(self, *args): self.get_application().reload_user_defined_presets() From 5d6f4697e512f1016f194709edbd054e00694e87 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:55:49 +0200 Subject: [PATCH 090/149] fix error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 394b64723..67ca2771b 100644 --- a/src/window.py +++ b/src/window.py @@ -122,7 +122,7 @@ def setup_monet_page(self): self.monet_palette_shades = AdwcustomizerPaletteShades("monet", "Monet Palette", 6) - self.monet_pref_group.add(self.palette_picker) + self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) From 93f07e1ff673d3c187ddc776cc3fef445807cd58 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:57:29 +0200 Subject: [PATCH 091/149] add 0xMRTT as translator --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index cb961f23a..a8671c20e 100644 --- a/src/main.py +++ b/src/main.py @@ -449,8 +449,8 @@ def show_about_window(self, *_args): issue_url="https://github.com/AdwCustomizerTeam/AdwCustomizer/issues", developers=[ 'Artyom "ArtyIF" Fomin https://github.com/ArtyIF', - "Verantor https://github.com/Verantor", "0xMRTT https://github.com/0xMRTT", + "Verantor https://github.com/Verantor", ], artists=[ 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' @@ -466,6 +466,7 @@ def show_about_window(self, *_args): Renato Corrêa https://www.transifex.com/user/profile/renatocrrs/ Aggelos Tselios https://www.transifex.com/user/profile/AndroGR/ David "Daudix UFO" Lapshin https://github.com/daudix-UFO' + 0xMRTT https://github.com/0xMRTT Juanjo Cillero https://www.transifex.com/user/profile/renux918/ Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", From f390b01cda4ac7e39caccb1433dcca37a8dc9ec4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 13:02:13 +0200 Subject: [PATCH 092/149] remove PR --- .github/workflows/flatpak-nightly.yml | 1 - .github/workflows/flatpak.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index e05befe07..fa297f23a 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -2,7 +2,6 @@ name: Build flatpak nightly on: push: branches: [next] - pull_request: jobs: flatpak: name: "Flatpak" diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 8d1b02d48..69360a41c 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -2,7 +2,6 @@ name: Build flatpak on: push: branches: [main] - pull_request: jobs: flatpak: name: "Flatpak" From 9aae287cb07333be89d0374f74bed067f8a56366 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:22:08 +0200 Subject: [PATCH 093/149] use palette shades --- src/main.py | 11 ++++++++++- src/window.py | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a8671c20e..f4c360cdd 100644 --- a/src/main.py +++ b/src/main.py @@ -26,6 +26,7 @@ import gi from gi.repository import Gtk, Gdk, Gio, Adw, GLib, Xdp, XdpGtk4 +from material_color_utilities_python import * from .settings_schema import settings_schema from .window import AdwcustomizerMainWindow @@ -207,7 +208,15 @@ def load_preset_variables(self, preset): self.reload_variables() def update_theme_from_monet(self, theme, tone): - pass + palettes = theme["palettes"] + + palette = {} + i = 0 + for color in palettes.values(): + i += 1 + palette[str(i)] = hexFromArgb(color.tone(tone)) + + self.pref_palette_shades["monet"].update_shades() def generate_gtk_css(self, app_type): final_css = "" diff --git a/src/window.py b/src/window.py index 67ca2771b..b92e6eeed 100644 --- a/src/window.py +++ b/src/window.py @@ -122,6 +122,8 @@ def setup_monet_page(self): self.monet_palette_shades = AdwcustomizerPaletteShades("monet", "Monet Palette", 6) + self.get_application( + ).pref_palette_shades["monet"] = self.monet_palette_shades self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() From 91d7e5f7bb578df08e07bcb1e326e332b8a108bc Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:23:31 +0200 Subject: [PATCH 094/149] fix error --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index f4c360cdd..274dae147 100644 --- a/src/main.py +++ b/src/main.py @@ -214,7 +214,7 @@ def update_theme_from_monet(self, theme, tone): i = 0 for color in palettes.values(): i += 1 - palette[str(i)] = hexFromArgb(color.tone(tone)) + palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) self.pref_palette_shades["monet"].update_shades() From c98f8df6101f5fad3639dc9f3423073d85837eac Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:24:16 +0200 Subject: [PATCH 095/149] add missin arg --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 274dae147..fbaf678a4 100644 --- a/src/main.py +++ b/src/main.py @@ -216,7 +216,7 @@ def update_theme_from_monet(self, theme, tone): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) - self.pref_palette_shades["monet"].update_shades() + self.pref_palette_shades["monet"].update_shades(palette) def generate_gtk_css(self, app_type): final_css = "" From 3ad2ebc2586d394dcb40e421a4270512f7f36226 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:25:48 +0200 Subject: [PATCH 096/149] add debug --- src/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.py b/src/main.py index fbaf678a4..ff7dceddf 100644 --- a/src/main.py +++ b/src/main.py @@ -216,6 +216,8 @@ def update_theme_from_monet(self, theme, tone): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) + print(palette) + self.pref_palette_shades["monet"].update_shades(palette) def generate_gtk_css(self, app_type): From b26d9a8df76e83ad27f41280a857f60f40273644 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:45:45 +0200 Subject: [PATCH 097/149] remove tone 1 --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b92e6eeed..efc166bea 100644 --- a/src/window.py +++ b/src/window.py @@ -130,7 +130,7 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - store_values = ["1"] + store_values = [] for i in range(5, 100, 5): store_values.append(str(i)) for v in store_values: From d5bce25c1e699e947049bfa4af0c4e1159fa006d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:55:00 +0200 Subject: [PATCH 098/149] add theme row --- src/window.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/window.py b/src/window.py index efc166bea..5bfb54f19 100644 --- a/src/window.py +++ b/src/window.py @@ -137,6 +137,16 @@ def setup_monet_page(self): store.append(v) self.tone_row.set_model(store) self.monet_pref_group.add(self.tone_row) + + self.monet_theme_row = Adw.ComboRow() + self.monet_theme_row.set_title(_("Theme")) + + store = Gtk.StringList() + store.append("Dark") + store.append("Light") + self.monet_theme_row.set_model(store) + self.monet_pref_group.add(self.monet_theme_row) + self.content_monet.add(self.monet_pref_group) def setup_plugins_page(self): From e2c9b1717836ff21233cecb7e7b102fedc181f08 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:00:07 +0200 Subject: [PATCH 099/149] add monet theme selector --- src/main.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++- src/window.py | 3 ++- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index ff7dceddf..a37cd3993 100644 --- a/src/main.py +++ b/src/main.py @@ -207,9 +207,11 @@ def load_preset_variables(self, preset): self.reload_variables() - def update_theme_from_monet(self, theme, tone): + def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] + monet_theme = monet_theme.get_string() + palette = {} i = 0 for color in palettes.values(): @@ -220,6 +222,56 @@ def update_theme_from_monet(self, theme, tone): self.pref_palette_shades["monet"].update_shades(palette) + print(theme) + + self.variable = { + "accent_color": theme["schemes"]["light"]["primary"], + "accent_bg_color": theme["schemes"]["light"]["primaryContainer"], + "accent_fg_color": theme["schemes"]["light"]["onPrimaryContainer"], + + "destructive_color": theme["schemes"]["light"][""], + "destructive_bg_color": theme["schemes"]["light"][""], + "destructive_fg_color": theme["schemes"]["light"][""], + + "success_color": theme["schemes"]["light"][""], + "success_bg_color": theme["schemes"]["light"][""], + "success_fg_color": theme["schemes"]["light"][""], + + "warning_color": theme["schemes"]["light"][""], + "warning_bg_color": theme["schemes"]["light"][""], + "warning_fg_color": "rgba(0, 0, 0, 0.8)", + + "error_color": theme["schemes"]["light"][""], + "error_bg_color": theme["schemes"]["light"][""], + "error_fg_color": theme["schemes"]["light"][""], + + "window_bg_color": theme["schemes"]["light"][""], + "window_fg_color": theme["schemes"]["light"][""], + + "view_bg_color": theme["schemes"]["light"][""], + "view_fg_color": theme["schemes"]["light"][""], + + "headerbar_bg_color": theme["schemes"]["light"][""], + "headerbar_fg_color": "rgba(0, 0, 0, 0.8)", + "headerbar_border_color": "rgba(0, 0, 0, 0.8)", + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": "rgba(0, 0, 0, 0.07)", + + "card_bg_color": theme["schemes"]["light"][""], + "card_fg_color": "rgba(0, 0, 0, 0.8)", + "card_shade_color": "rgba(0, 0, 0, 0.07)", + + "dialog_bg_color": theme["schemes"]["light"][""], + "dialog_fg_color": "rgba(0, 0, 0, 0.8)", + + "popover_bg_color": theme["schemes"]["light"][""], + "popover_fg_color": "rgba(0, 0, 0, 0.8)", + + "shade_color": theme["schemes"]["light"][""], + "scrollbar_outline_color": theme["schemes"]["light"][""] + } + + def generate_gtk_css(self, app_type): final_css = "" for key in self.variables.keys(): diff --git a/src/window.py b/src/window.py index 5bfb54f19..d38272320 100644 --- a/src/window.py +++ b/src/window.py @@ -91,7 +91,8 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() - self.get_application().update_theme_from_monet(self.monet_theme, self.tone) + self.monet_theme = self.monet_theme_row.get_selected_item() + self.get_application().update_theme_from_monet(self.monet_theme, self.tone, self.monet_theme) def setup_monet_page(self): From d2bde49e06d23a38d29d181bd8d80c38e56e9f68 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:00:33 +0200 Subject: [PATCH 100/149] add debug info --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index a37cd3993..c0d609958 100644 --- a/src/main.py +++ b/src/main.py @@ -222,6 +222,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): self.pref_palette_shades["monet"].update_shades(palette) + print(monet_theme) print(theme) self.variable = { From 47c4218523062b457958d1a3048eca133d6084fa Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:03:57 +0200 Subject: [PATCH 101/149] fix duplicated name --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index d38272320..08e14604d 100644 --- a/src/window.py +++ b/src/window.py @@ -89,10 +89,10 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() self.monet_img = Image.open(self.monet_image_file.get_path()) - self.monet_theme = themeFromImage(self.monet_img) + self.theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.monet_theme, self.tone, self.monet_theme) + self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) def setup_monet_page(self): From f5f8580b2e1a5ba31ea2dc6079ff7dcc1a498705 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:39:31 +0200 Subject: [PATCH 102/149] add automatic theme generation. Need test --- src/main.py | 137 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 101 insertions(+), 36 deletions(-) diff --git a/src/main.py b/src/main.py index c0d609958..314d21aeb 100644 --- a/src/main.py +++ b/src/main.py @@ -207,10 +207,22 @@ def load_preset_variables(self, preset): self.reload_variables() + + def rgba_from_argb(self, argb, alpha = None) -> str: + base = "rgba({}, {}, {}, {})" + + red = redFromArgb(argb) + green = greenFromArgb(argb) + blue = blueFromArgb(argb) + if not alpha: + alpha = alphaFromArgb(argb) + + return base.format(red, green, blue, alpha) + def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] - monet_theme = monet_theme.get_string() + monet_theme = monet_theme.get_string().lower() # dark / light palette = {} i = 0 @@ -225,53 +237,106 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(monet_theme) print(theme) - self.variable = { - "accent_color": theme["schemes"]["light"]["primary"], - "accent_bg_color": theme["schemes"]["light"]["primaryContainer"], - "accent_fg_color": theme["schemes"]["light"]["onPrimaryContainer"], + if monet_theme == "dark": + dark_theme = theme["schemes"]["dark"].toJSON() + self.variable = { + "accent_color": dark_theme["primary"], + "accent_bg_color": dark_theme["primaryContainer"], + "accent_fg_color": dark_theme["onPrimaryContainer"], + + "destructive_color": dark_theme["error"], + "destructive_bg_color": dark_theme["errorContainer"], + "destructive_fg_color": dark_theme["onError"], + + "success_color": dark_theme["tertiary"], + "success_bg_color": dark_theme["onTertiary"], + "success_fg_color": dark_theme["tertiaryContainer"], + + "warning_color": dark_theme["secondaryContainer"], + "warning_bg_color": dark_theme["inversePrimary"], + "warning_fg_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + + "error_color": dark_theme["error"], + "error_bg_color": dark_theme["errorContainer"], + "error_fg_color": dark_theme["onError"], + + "window_bg_color": dark_theme["surface"], + "window_fg_color": dark_theme["onSurface"], - "destructive_color": theme["schemes"]["light"][""], - "destructive_bg_color": theme["schemes"]["light"][""], - "destructive_fg_color": theme["schemes"]["light"][""], + "view_bg_color": dark_theme["surface"], + "view_fg_color": dark_theme["onSurface"], - "success_color": theme["schemes"]["light"][""], - "success_bg_color": theme["schemes"]["light"][""], - "success_fg_color": theme["schemes"]["light"][""], + "headerbar_bg_color": dark_theme["surface"], + "headerbar_fg_color": dark_theme["onSurface"], + "headerbar_border_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": dark_theme["shadow"], - "warning_color": theme["schemes"]["light"][""], - "warning_bg_color": theme["schemes"]["light"][""], - "warning_fg_color": "rgba(0, 0, 0, 0.8)", + "card_bg_color": self.rgba_from_argb(dark_theme["primary"], "0.05"), + "card_fg_color": dark_theme["surfaceVariant"], + "card_shade_color": dark_theme["shadow"], - "error_color": theme["schemes"]["light"][""], - "error_bg_color": theme["schemes"]["light"][""], - "error_fg_color": theme["schemes"]["light"][""], + "dialog_bg_color": dark_theme["secondaryContainer"], + "dialog_fg_color": dark_theme["onSecondaryContainer"], - "window_bg_color": theme["schemes"]["light"][""], - "window_fg_color": theme["schemes"]["light"][""], + "popover_bg_color": dark_theme["secondaryContainer"], + "popover_fg_color": dark_theme["onSecondaryContainer"], - "view_bg_color": theme["schemes"]["light"][""], - "view_fg_color": theme["schemes"]["light"][""], + "shade_color": dark_theme["shadow"], + "scrollbar_outline_color": dark_theme["outline"] + } + else: # light + light_theme = theme["schemes"]["light"].toJSON() + self.variable = { + "accent_color": light_theme["primary"], + "accent_bg_color": light_theme["primaryContainer"], + "accent_fg_color": light_theme["onPrimaryContainer"], - "headerbar_bg_color": theme["schemes"]["light"][""], - "headerbar_fg_color": "rgba(0, 0, 0, 0.8)", - "headerbar_border_color": "rgba(0, 0, 0, 0.8)", - "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": "rgba(0, 0, 0, 0.07)", + "destructive_color": light_theme["error"], + "destructive_bg_color": light_theme["errorContainer"], + "destructive_fg_color": light_theme["onError"], - "card_bg_color": theme["schemes"]["light"][""], - "card_fg_color": "rgba(0, 0, 0, 0.8)", - "card_shade_color": "rgba(0, 0, 0, 0.07)", + "success_color": light_theme["tertiary"], + "success_bg_color": light_theme["onTertiary"], + "success_fg_color": light_theme["tertiaryContainer"], - "dialog_bg_color": theme["schemes"]["light"][""], - "dialog_fg_color": "rgba(0, 0, 0, 0.8)", + "warning_color": light_theme["secondaryContainer"], + "warning_bg_color": light_theme["inversePrimary"], + "warning_fg_color": self.rgba_from_argb(light_theme["primary"], "0.8"), - "popover_bg_color": theme["schemes"]["light"][""], - "popover_fg_color": "rgba(0, 0, 0, 0.8)", + "error_color": light_theme["error"], + "error_bg_color": light_theme["errorContainer"], + "error_fg_color": light_theme["onError"], - "shade_color": theme["schemes"]["light"][""], - "scrollbar_outline_color": theme["schemes"]["light"][""] - } + "window_bg_color": light_theme["surface"], + "window_fg_color": light_theme["onSurface"], + "view_bg_color": light_theme["surface"], + "view_fg_color": light_theme["onSurface"], + + "headerbar_bg_color": light_theme["surface"], + "headerbar_fg_color": light_theme["onSurface"], + "headerbar_border_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": light_theme["shadow"], + + "card_bg_color": self.rgba_from_argb(light_theme["primary"], "0.05"), + "card_fg_color": light_theme["surfaceVariant"], + "card_shade_color": light_theme["shadow"], + + "dialog_bg_color": light_theme["secondaryContainer"], + "dialog_fg_color": light_theme["onSecondaryContainer"], + + "popover_bg_color": light_theme["secondaryContainer"], + "popover_fg_color": light_theme["onSecondaryContainer"], + + "shade_color": light_theme["shadow"], + "scrollbar_outline_color": light_theme["outline"] + } + + for key in self.variables.keys(): + if key in self.pref_variables: + self.pref_variables[key].update_value(self.variables[key]) def generate_gtk_css(self, app_type): final_css = "" From eb52f52fbb6c7fe4dc92771af839a39776c0e840 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:41:46 +0200 Subject: [PATCH 103/149] fix error --- src/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 314d21aeb..9e08e3b0d 100644 --- a/src/main.py +++ b/src/main.py @@ -239,7 +239,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"].toJSON() - self.variable = { + variable = { "accent_color": dark_theme["primary"], "accent_bg_color": dark_theme["primaryContainer"], "accent_fg_color": dark_theme["onPrimaryContainer"], @@ -287,7 +287,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): } else: # light light_theme = theme["schemes"]["light"].toJSON() - self.variable = { + variable = { "accent_color": light_theme["primary"], "accent_bg_color": light_theme["primaryContainer"], "accent_fg_color": light_theme["onPrimaryContainer"], @@ -334,9 +334,9 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "scrollbar_outline_color": light_theme["outline"] } - for key in self.variables.keys(): + for key in variables.keys(): if key in self.pref_variables: - self.pref_variables[key].update_value(self.variables[key]) + self.pref_variables[key].update_value(variables[key]) def generate_gtk_css(self, app_type): final_css = "" From 8c25c94e9545968462508b63e50772cff267050c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:44:12 +0200 Subject: [PATCH 104/149] add reload --- src/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.py b/src/main.py index 9e08e3b0d..0dab116bd 100644 --- a/src/main.py +++ b/src/main.py @@ -337,6 +337,8 @@ def update_theme_from_monet(self, theme, tone, monet_theme): for key in variables.keys(): if key in self.pref_variables: self.pref_variables[key].update_value(variables[key]) + + self.reload_variables() def generate_gtk_css(self, app_type): final_css = "" From aada5ae201fd69e6ec9a7e8458eda551b912f6f0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:46:00 +0200 Subject: [PATCH 105/149] add conditon --- src/window.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/window.py b/src/window.py index 08e14604d..205942adc 100644 --- a/src/window.py +++ b/src/window.py @@ -88,11 +88,12 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - self.monet_img = Image.open(self.monet_image_file.get_path()) - self.theme = themeFromImage(self.monet_img) - self.tone = self.tone_row.get_selected_item() - self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) + if response == Gtk.ResponseType.ACCEPT: + self.monet_img = Image.open(self.monet_image_file.get_path()) + self.theme = themeFromImage(self.monet_img) + self.tone = self.tone_row.get_selected_item() + self.monet_theme = self.monet_theme_row.get_selected_item() + self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) def setup_monet_page(self): From df673661572dccafe6ee7d0aad165b7e7905d29c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:57:41 +0200 Subject: [PATCH 106/149] fix error --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 0dab116bd..4089c2bb2 100644 --- a/src/main.py +++ b/src/main.py @@ -240,7 +240,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"].toJSON() variable = { - "accent_color": dark_theme["primary"], + "accent_color": dark_theme.primary, "accent_bg_color": dark_theme["primaryContainer"], "accent_fg_color": dark_theme["onPrimaryContainer"], @@ -334,9 +334,9 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "scrollbar_outline_color": light_theme["outline"] } - for key in variables.keys(): + for key in variable.keys(): if key in self.pref_variables: - self.pref_variables[key].update_value(variables[key]) + self.pref_variables[key].update_value(variable[key]) self.reload_variables() From 686035177b84911702658937f9e43bcbee7e2173 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:58:53 +0200 Subject: [PATCH 107/149] fix bug --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 4089c2bb2..a8870f66b 100644 --- a/src/main.py +++ b/src/main.py @@ -238,11 +238,11 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(theme) if monet_theme == "dark": - dark_theme = theme["schemes"]["dark"].toJSON() + dark_theme = theme["schemes"]["dark"] variable = { "accent_color": dark_theme.primary, - "accent_bg_color": dark_theme["primaryContainer"], - "accent_fg_color": dark_theme["onPrimaryContainer"], + "accent_bg_color": dark_theme.primaryContainer, + "accent_fg_color": dark_theme.onPrimaryContainer, "destructive_color": dark_theme["error"], "destructive_bg_color": dark_theme["errorContainer"], From a4f48a11b44b4d988423015097f967923932c390 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:03:34 +0200 Subject: [PATCH 108/149] update dark sheme --- src/main.py | 60 ++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/main.py b/src/main.py index a8870f66b..143e5d934 100644 --- a/src/main.py +++ b/src/main.py @@ -244,49 +244,49 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_bg_color": dark_theme.primaryContainer, "accent_fg_color": dark_theme.onPrimaryContainer, - "destructive_color": dark_theme["error"], - "destructive_bg_color": dark_theme["errorContainer"], - "destructive_fg_color": dark_theme["onError"], + "destructive_color": dark_theme.error, + "destructive_bg_color": dark_theme.errorContainer, + "destructive_fg_color": dark_theme.onError, - "success_color": dark_theme["tertiary"], - "success_bg_color": dark_theme["onTertiary"], - "success_fg_color": dark_theme["tertiaryContainer"], + "success_color": dark_theme.tertiary, + "success_bg_color": dark_theme.onTertiary, + "success_fg_color": dark_theme.tertiaryContainer, - "warning_color": dark_theme["secondaryContainer"], - "warning_bg_color": dark_theme["inversePrimary"], - "warning_fg_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "warning_color": dark_theme.secondaryContainer, + "warning_bg_color": dark_theme.inversePrimary, + "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": dark_theme["error"], - "error_bg_color": dark_theme["errorContainer"], - "error_fg_color": dark_theme["onError"], + "error_color": dark_theme.error, + "error_bg_color": dark_theme.errorContainer, + "error_fg_color": dark_theme.onError, - "window_bg_color": dark_theme["surface"], - "window_fg_color": dark_theme["onSurface"], + "window_bg_color": dark_theme.surface, + "window_fg_color": dark_theme.onSurface, - "view_bg_color": dark_theme["surface"], - "view_fg_color": dark_theme["onSurface"], + "view_bg_color": dark_theme.surface, + "view_fg_color": dark_theme.onSurface, - "headerbar_bg_color": dark_theme["surface"], - "headerbar_fg_color": dark_theme["onSurface"], - "headerbar_border_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "headerbar_bg_color": dark_theme.surface, + "headerbar_fg_color": dark_theme.onSurface, + "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": dark_theme["shadow"], + "headerbar_shade_color": dark_theme.shadow, - "card_bg_color": self.rgba_from_argb(dark_theme["primary"], "0.05"), - "card_fg_color": dark_theme["surfaceVariant"], - "card_shade_color": dark_theme["shadow"], + "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), + "card_fg_color": dark_theme.surfaceVariant, + "card_shade_color": dark_theme.shadow, - "dialog_bg_color": dark_theme["secondaryContainer"], - "dialog_fg_color": dark_theme["onSecondaryContainer"], + "dialog_bg_color": dark_theme.secondaryContainer, + "dialog_fg_color": dark_theme.onSecondaryContainer, - "popover_bg_color": dark_theme["secondaryContainer"], - "popover_fg_color": dark_theme["onSecondaryContainer"], + "popover_bg_color": dark_theme.secondaryContainer, + "popover_fg_color": dark_theme.onSecondaryContainer, - "shade_color": dark_theme["shadow"], - "scrollbar_outline_color": dark_theme["outline"] + "shade_color": dark_theme.shadow, + "scrollbar_outline_color": dark_theme.outline } else: # light - light_theme = theme["schemes"]["light"].toJSON() + light_theme = theme["schemes"]["light"] variable = { "accent_color": light_theme["primary"], "accent_bg_color": light_theme["primaryContainer"], From 2382062177dc2b6be2ec8508a9adac34753d51c0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:06:55 +0200 Subject: [PATCH 109/149] convert to rgba --- src/main.py | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/main.py b/src/main.py index 143e5d934..c7231e161 100644 --- a/src/main.py +++ b/src/main.py @@ -240,50 +240,50 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"] variable = { - "accent_color": dark_theme.primary, - "accent_bg_color": dark_theme.primaryContainer, - "accent_fg_color": dark_theme.onPrimaryContainer, + "accent_color": self.rgba_from_argb(dark_theme.primary), + "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), + "accent_fg_color": self.rgba_from_argb(dark_theme.onPrimaryContainer), - "destructive_color": dark_theme.error, - "destructive_bg_color": dark_theme.errorContainer, - "destructive_fg_color": dark_theme.onError, + "destructive_color": self.rgba_from_argb(dark_theme.error), + "destructive_bg_color": self.rgba_from_argb(dark_theme.errorContainer), + "destructive_fg_color": self.rgba_from_argb(dark_theme.onError), - "success_color": dark_theme.tertiary, - "success_bg_color": dark_theme.onTertiary, - "success_fg_color": dark_theme.tertiaryContainer, + "success_color": self.rgba_from_argb(dark_theme.tertiary), + "success_bg_color": self.rgba_from_argb(dark_theme.onTertiary), + "success_fg_color": self.rgba_from_argb(dark_theme.tertiaryContainer), - "warning_color": dark_theme.secondaryContainer, - "warning_bg_color": dark_theme.inversePrimary, + "warning_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "warning_bg_color": self.rgba_from_argb(dark_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": dark_theme.error, - "error_bg_color": dark_theme.errorContainer, - "error_fg_color": dark_theme.onError, + "error_color": self.rgba_from_argb(dark_theme.error), + "error_bg_color": self.rgba_from_argb(dark_theme.errorContainer), + "error_fg_color": self.rgba_from_argb(dark_theme.onError), - "window_bg_color": dark_theme.surface, - "window_fg_color": dark_theme.onSurface, + "window_bg_color": self.rgba_from_argb(dark_theme.surface), + "window_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "view_bg_color": dark_theme.surface, - "view_fg_color": dark_theme.onSurface, + "view_bg_color": self.rgba_from_argb(dark_theme.surface), + "view_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_bg_color": dark_theme.surface, - "headerbar_fg_color": dark_theme.onSurface, + "headerbar_bg_color": self.rgba_from_argb(dark_theme.surface), + "headerbar_fg_color": self.rgba_from_argb(dark_theme.onSurface), "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": dark_theme.shadow, + "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), - "card_fg_color": dark_theme.surfaceVariant, - "card_shade_color": dark_theme.shadow, + "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), + "card_shade_color": self.rgba_from_argb(dark_theme.shadow), - "dialog_bg_color": dark_theme.secondaryContainer, - "dialog_fg_color": dark_theme.onSecondaryContainer, + "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "popover_bg_color": dark_theme.secondaryContainer, - "popover_fg_color": dark_theme.onSecondaryContainer, + "popover_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "popover_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "shade_color": dark_theme.shadow, - "scrollbar_outline_color": dark_theme.outline + "shade_color": self.rgba_from_argb(dark_theme.shadow), + "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) } else: # light light_theme = theme["schemes"]["light"] From 1b12e486244c38b0a0d14f59cd01be66825e4cd0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:17:35 +0200 Subject: [PATCH 110/149] update tones --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 205942adc..e5f413426 100644 --- a/src/window.py +++ b/src/window.py @@ -101,7 +101,7 @@ def setup_monet_page(self): self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) self.monet_pref_group.set_description( - _("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + _("Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -133,7 +133,7 @@ def setup_monet_page(self): store = Gtk.StringList() store_values = [] - for i in range(5, 100, 5): + for i in range(20, 80, 5): store_values.append(str(i)) for v in store_values: store.append(v) From 0324b9575947bacabbf1099c2107cd3e5491dc08 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:22:34 +0200 Subject: [PATCH 111/149] add automatic preset load --- src/main.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index c7231e161..92fa90dd4 100644 --- a/src/main.py +++ b/src/main.py @@ -96,9 +96,17 @@ def do_activate(self): self.create_action("about", self.show_about_window) self.reload_user_defined_presets() - self.load_preset_from_resource( - "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita.json" - ) + + self.style_manager = Adw.StyleManager.get_default() + + if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: + self.load_preset_from_resource( + "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" + ) + else: + self.load_preset_from_resource( + "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita.json" + ) self.win.present() From f996aeeaccec757a7cca2cadf3826a373f770b92 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:23:08 +0200 Subject: [PATCH 112/149] add debug --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index 92fa90dd4..3a430c01d 100644 --- a/src/main.py +++ b/src/main.py @@ -99,6 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() + print(self.style_manager.get_color_scheme()) if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From 7bf5edf685f16b39bc8870924be508fca5278e34 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:24:40 +0200 Subject: [PATCH 113/149] add more debug --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 3a430c01d..661823e7f 100644 --- a/src/main.py +++ b/src/main.py @@ -98,8 +98,9 @@ def do_activate(self): self.reload_user_defined_presets() self.style_manager = Adw.StyleManager.get_default() - + print(dir(self.style_manager)) print(self.style_manager.get_color_scheme()) + print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From e939dcdd1722e8790964544e8665721ec61e793d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:25:41 +0200 Subject: [PATCH 114/149] fix bug --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 661823e7f..8a2c5bc14 100644 --- a/src/main.py +++ b/src/main.py @@ -99,9 +99,10 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) + print(self.style_manager.get_default()) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) - if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: + if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" ) From 004bf83923814f8d75d30179de80a9f2b12d76b5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:26:48 +0200 Subject: [PATCH 115/149] add debug --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 8a2c5bc14..e7c33d578 100644 --- a/src/main.py +++ b/src/main.py @@ -99,7 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) - print(self.style_manager.get_default()) + print(dir(self.style_manager.get_default())) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: From 3339808f0a28dd33710138e43516508069c986d0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:28:27 +0200 Subject: [PATCH 116/149] add debug --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index e7c33d578..4eceea150 100644 --- a/src/main.py +++ b/src/main.py @@ -100,6 +100,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) print(dir(self.style_manager.get_default())) + print(self.style_manager.get_default().get_color_scheme()) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: From aff7cf44f647e3d2fd89dfeabaf543c03f5f4198 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:33:27 +0200 Subject: [PATCH 117/149] fix style manager --- src/main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 4eceea150..e19935439 100644 --- a/src/main.py +++ b/src/main.py @@ -99,10 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) - print(dir(self.style_manager.get_default())) - print(self.style_manager.get_default().get_color_scheme()) - print(self.style_manager.get_color_scheme()) - print(dir(self.style_manager.get_color_scheme())) + print(self.style_manager.get_dark()) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From 8f2b40d01fe75f1ef4b3c412829d396d1f4e7568 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:34:28 +0200 Subject: [PATCH 118/149] add automatic preset choice if dark or ligjt --- src/main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index e19935439..a6578d3e4 100644 --- a/src/main.py +++ b/src/main.py @@ -98,9 +98,7 @@ def do_activate(self): self.reload_user_defined_presets() self.style_manager = Adw.StyleManager.get_default() - print(dir(self.style_manager)) - print(self.style_manager.get_dark()) - if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: + if self.style_manager.get_dark(): self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" ) From 9f222bd06e2a5db7cec0593cf79bef2e4957d300 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:37:03 +0200 Subject: [PATCH 119/149] add automatic color choice for monet --- src/main.py | 7 ++++++- src/window.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a6578d3e4..4868c1575 100644 --- a/src/main.py +++ b/src/main.py @@ -243,7 +243,12 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(monet_theme) print(theme) - + if monet_theme == "automatic": + if self.style_manager.get_dark(): + monet_theme = "dark" + else: + monet_theme = "light" + if monet_theme == "dark": dark_theme = theme["schemes"]["dark"] variable = { diff --git a/src/window.py b/src/window.py index e5f413426..1f10d3f0a 100644 --- a/src/window.py +++ b/src/window.py @@ -144,6 +144,7 @@ def setup_monet_page(self): self.monet_theme_row.set_title(_("Theme")) store = Gtk.StringList() + store.append("Automatic") store.append("Dark") store.append("Light") self.monet_theme_row.set_model(store) From 28e6218038ed4f67c50b67d3bc350d704a748c76 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:39:34 +0200 Subject: [PATCH 120/149] update light theme scheme --- src/main.py | 64 ++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/main.py b/src/main.py index 4868c1575..6aa3b4843 100644 --- a/src/main.py +++ b/src/main.py @@ -300,50 +300,50 @@ def update_theme_from_monet(self, theme, tone, monet_theme): else: # light light_theme = theme["schemes"]["light"] variable = { - "accent_color": light_theme["primary"], - "accent_bg_color": light_theme["primaryContainer"], - "accent_fg_color": light_theme["onPrimaryContainer"], + "accent_color": self.rgba_from_argb(light_theme.primary), + "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), + "accent_fg_color": self.rgba_from_argb(light_theme.onPrimaryContainer), - "destructive_color": light_theme["error"], - "destructive_bg_color": light_theme["errorContainer"], - "destructive_fg_color": light_theme["onError"], + "destructive_color": self.rgba_from_argb(light_theme.error), + "destructive_bg_color": self.rgba_from_argb(light_theme.errorContainer), + "destructive_fg_color": self.rgba_from_argb(light_theme.onError), - "success_color": light_theme["tertiary"], - "success_bg_color": light_theme["onTertiary"], - "success_fg_color": light_theme["tertiaryContainer"], + "success_color": self.rgba_from_argb(light_theme.tertiary), + "success_bg_color": self.rgba_from_argb(light_theme.onTertiary), + "success_fg_color": self.rgba_from_argb(light_theme.tertiaryContainer), - "warning_color": light_theme["secondaryContainer"], - "warning_bg_color": light_theme["inversePrimary"], - "warning_fg_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "warning_color": self.rgba_from_argb(light_theme.secondaryContainer), + "warning_bg_color": self.rgba_from_argb(light_theme.inversePrimary), + "warning_fg_color": self.rgba_from_argb(light_theme.primary, "0.8"), - "error_color": light_theme["error"], - "error_bg_color": light_theme["errorContainer"], - "error_fg_color": light_theme["onError"], + "error_color": self.rgba_from_argb(light_theme.error), + "error_bg_color": self.rgba_from_argb(light_theme.errorContainer), + "error_fg_color": self.rgba_from_argb(light_theme.onError), - "window_bg_color": light_theme["surface"], - "window_fg_color": light_theme["onSurface"], + "window_bg_color": self.rgba_from_argb(light_theme.surface), + "window_fg_color": self.rgba_from_argb(light_theme.onSurface), - "view_bg_color": light_theme["surface"], - "view_fg_color": light_theme["onSurface"], + "view_bg_color": self.rgba_from_argb(light_theme.surface), + "view_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_bg_color": light_theme["surface"], - "headerbar_fg_color": light_theme["onSurface"], - "headerbar_border_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "headerbar_bg_color": self.rgba_from_argb(light_theme.surface), + "headerbar_fg_color": self.rgba_from_argb(light_theme.onSurface), + "headerbar_border_color": self.rgba_from_argb(light_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": light_theme["shadow"], + "headerbar_shade_color": self.rgba_from_argb(light_theme.shadow), - "card_bg_color": self.rgba_from_argb(light_theme["primary"], "0.05"), - "card_fg_color": light_theme["surfaceVariant"], - "card_shade_color": light_theme["shadow"], + "card_bg_color": self.rgba_from_argb(light_theme.primary, "0.05"), + "card_fg_color": self.rgba_from_argb(light_theme.surfaceVariant), + "card_shade_color": self.rgba_from_argb(light_theme.shadow), - "dialog_bg_color": light_theme["secondaryContainer"], - "dialog_fg_color": light_theme["onSecondaryContainer"], + "dialog_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), + "dialog_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - "popover_bg_color": light_theme["secondaryContainer"], - "popover_fg_color": light_theme["onSecondaryContainer"], + "popover_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), + "popover_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - "shade_color": light_theme["shadow"], - "scrollbar_outline_color": light_theme["outline"] + "shade_color": self.rgba_from_argb(light_theme.shadow), + "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline) } for key in variable.keys(): From 8e51c880acbddaf88d0f68b1940931835a57e6b2 Mon Sep 17 00:00:00 2001 From: David Lapshin Date: Thu, 11 Aug 2022 17:48:22 +0300 Subject: [PATCH 121/149] Fix missing settings-symbolic & open-menu-symbolic --- src/adwcustomizer.gresource.xml | 8 ++++++-- ...thub.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg | 2 -- ...AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg | 8 ++++++++ ....AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg | 2 ++ src/ui/window.blp | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) delete mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg diff --git a/src/adwcustomizer.gresource.xml b/src/adwcustomizer.gresource.xml index dc6a30581..fa71a5932 100644 --- a/src/adwcustomizer.gresource.xml +++ b/src/adwcustomizer.gresource.xml @@ -42,11 +42,15 @@ >icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg + alias="open-menu-symbolic.svg" + >icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-fill-symbolic.svg + icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg deleted file mode 100644 index 50b8a3c4d..000000000 --- a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg new file mode 100644 index 000000000..7f4474335 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg new file mode 100644 index 000000000..408d7e5d4 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/src/ui/window.blp b/src/ui/window.blp index e9e6deb74..3b3abc816 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -47,7 +47,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { [end] Gtk.MenuButton { - icon-name: "menu-symbolic"; + icon-name: "open-menu-symbolic"; menu-model: main-menu; } From 84dda5f78d499801a49c20ed7163bfec4854f006 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:53:41 +0200 Subject: [PATCH 122/149] add switch to select dark or light apply --- src/main.py | 72 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/src/main.py b/src/main.py index 6aa3b4843..819f4dd10 100644 --- a/src/main.py +++ b/src/main.py @@ -443,7 +443,13 @@ def show_apply_color_scheme_dialog(self, *_args): Adw.ResponseAppearance.SUGGESTED, transient_for=self.props.active_window, ) - dialog.connect("response", self.apply_color_scheme) + + switch = Gtk.Switch() + print(dir(switch)) + + dialog.set_extra_child(switch) + + dialog.connect("response", self.apply_color_scheme, switch) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -534,28 +540,50 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response): + def apply_color_scheme(self, widget, response, switch): if response == "apply": - if widget.get_app_types()["gtk4"]: - gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") - if not os.path.exists(gtk4_dir): - os.makedirs(gtk4_dir) - gtk4_css = self.generate_gtk_css("gtk4") - with open( - os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8" - ) as file: - file.write(gtk4_css) - if widget.get_app_types()["gtk3"]: - gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") - if not os.path.exists(gtk3_dir): - os.makedirs(gtk3_dir) - gtk3_css = self.generate_gtk_css("gtk3") - with open( - os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" - ) as file: - file.write(gtk3_css) + if switch.get_active(): + if widget.get_app_types()["gtk4"]: + gtk4_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + if not os.path.exists(gtk4_dir): + os.makedirs(gtk4_dir) + gtk4_css = self.generate_gtk_css("gtk4") + with open( + os.path.join(gtk4_dir, "gtk-dark.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk4_css) + if widget.get_app_types()["gtk3"]: + gtk3_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + if not os.path.exists(gtk3_dir): + os.makedirs(gtk3_dir) + gtk3_css = self.generate_gtk_css("gtk3") + with open( + os.path.join(gtk3_dir, "gtk-dark.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk3_css) + else: + if widget.get_app_types()["gtk4"]: + gtk4_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + if not os.path.exists(gtk4_dir): + os.makedirs(gtk4_dir) + gtk4_css = self.generate_gtk_css("gtk4") + with open( + os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk4_css) + if widget.get_app_types()["gtk3"]: + gtk3_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + if not os.path.exists(gtk3_dir): + os.makedirs(gtk3_dir) + gtk3_css = self.generate_gtk_css("gtk3") + with open( + os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk3_css) self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): From 5e96066b9c4b1578a159c564f9931efeacbd0c19 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 17:57:02 +0200 Subject: [PATCH 123/149] change license Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 819f4dd10..a8e7e471a 100644 --- a/src/main.py +++ b/src/main.py @@ -641,7 +641,7 @@ def show_about_window(self, *_args): Juanjo Cillero https://www.transifex.com/user/profile/renux918/ Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", - license_type=Gtk.License.MIT_X11, + license_type=Gtk.License.GPL_3_0, ) about.present() From f054988887d13b1517b79cba8f9a69957d671ad4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:21:13 +0200 Subject: [PATCH 124/149] rework apply --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a8e7e471a..fc68884de 100644 --- a/src/main.py +++ b/src/main.py @@ -444,7 +444,7 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - switch = Gtk.Switch() + switch = Adw.ActionRow() print(dir(switch)) dialog.set_extra_child(switch) From 7639f5313c1e8a1d031adcbb3bed350edb153cf9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:24:37 +0200 Subject: [PATCH 125/149] update comborow --- src/main.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index fc68884de..04ac224e6 100644 --- a/src/main.py +++ b/src/main.py @@ -444,12 +444,18 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - switch = Adw.ActionRow() - print(dir(switch)) + comborow = Adw.ComboRow() + comborow.set_title(_("Apply as dark theme")) - dialog.set_extra_child(switch) + store = Gtk.StringList() + store.append("Dark") + store.append("Light") + comborow.set_model(store) + print(dir(comborow)) - dialog.connect("response", self.apply_color_scheme, switch) + dialog.set_extra_child(comborow) + + dialog.connect("response", self.apply_color_scheme, comborow) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -540,9 +546,9 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response, switch): + def apply_color_scheme(self, widget, response, comborow): if response == "apply": - if switch.get_active(): + if comborow.get_string().lower() == "dark": if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") From ac53e2e876add0dad2e4871bd7b3a66ea0ab0df7 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:31:44 +0200 Subject: [PATCH 126/149] use switch instead --- src/main.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main.py b/src/main.py index 04ac224e6..f76002025 100644 --- a/src/main.py +++ b/src/main.py @@ -444,18 +444,18 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - comborow = Adw.ComboRow() - comborow.set_title(_("Apply as dark theme")) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - store = Gtk.StringList() - store.append("Dark") - store.append("Light") - comborow.set_model(store) - print(dir(comborow)) + label = Gtk.Label(text="Export as Dark theme") + switch = Gtk.Switch() - dialog.set_extra_child(comborow) + box.append(label) + box.append(switch) + print(dir(switch)) - dialog.connect("response", self.apply_color_scheme, comborow) + dialog.set_extra_child(box) + + dialog.connect("response", self.apply_color_scheme, switch) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -546,9 +546,9 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response, comborow): + def apply_color_scheme(self, widget, response, switch): if response == "apply": - if comborow.get_string().lower() == "dark": + if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") From 4278e213228f94e38423a59aa46942ed2b00b4db Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:32:46 +0200 Subject: [PATCH 127/149] fix bug --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index f76002025..b681a0398 100644 --- a/src/main.py +++ b/src/main.py @@ -446,7 +446,7 @@ def show_apply_color_scheme_dialog(self, *_args): box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - label = Gtk.Label(text="Export as Dark theme") + label = Gtk.Label(label="Export as Dark theme") switch = Gtk.Switch() box.append(label) From 18bb8725ee3e5420d4b5d249e344699b7c1ea30a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:35:23 +0200 Subject: [PATCH 128/149] increase spacing --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index b681a0398..959b83397 100644 --- a/src/main.py +++ b/src/main.py @@ -444,7 +444,7 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=30) label = Gtk.Label(label="Export as Dark theme") switch = Gtk.Switch() From b6105f6302a28c6ad4f2f6b9b033b6e2e8ca59cf Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:38:00 +0200 Subject: [PATCH 129/149] update label --- src/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 959b83397..8595303d5 100644 --- a/src/main.py +++ b/src/main.py @@ -444,9 +444,9 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=30) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - label = Gtk.Label(label="Export as Dark theme") + label = Gtk.Label(label="Apply as Dark theme") switch = Gtk.Switch() box.append(label) From b7c6be25e731b205bf7a8c7ecb45bee60a10b014 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:39:24 +0200 Subject: [PATCH 130/149] format --- src/main.py | 72 +++++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/main.py b/src/main.py index 8595303d5..4d4d6f45a 100644 --- a/src/main.py +++ b/src/main.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -36,6 +36,7 @@ from .custom_css_group import AdwcustomizerCustomCSSGroup from .plugins_list import AdwcustomizerPluginsList + def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -114,7 +115,7 @@ def reload_user_defined_presets(self): self.props.active_window.presets_menu.remove(1) preset_directory = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets") if not os.path.exists(preset_directory): os.makedirs(preset_directory) @@ -141,7 +142,8 @@ def reload_user_defined_presets(self): "line": traceback.format_exc().strip(), } ) - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Failed to load preset"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Failed to load preset"))) self.props.active_window.update_errors(self.global_errors) @@ -174,7 +176,8 @@ def open_dir_callback(_, result): self.portal.open_uri( parent, - "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets"), + "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets"), Xdp.OpenUriFlags.NONE, None, open_dir_callback, @@ -214,8 +217,7 @@ def load_preset_variables(self, preset): self.reload_variables() - - def rgba_from_argb(self, argb, alpha = None) -> str: + def rgba_from_argb(self, argb, alpha=None) -> str: base = "rgba({}, {}, {}, {})" red = redFromArgb(argb) @@ -229,28 +231,22 @@ def rgba_from_argb(self, argb, alpha = None) -> str: def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] - monet_theme = monet_theme.get_string().lower() # dark / light + monet_theme = monet_theme.get_string().lower() # dark / light palette = {} i = 0 for color in palettes.values(): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) - - print(palette) - self.pref_palette_shades["monet"].update_shades(palette) - - print(monet_theme) - print(theme) if monet_theme == "automatic": if self.style_manager.get_dark(): monet_theme = "dark" else: monet_theme = "light" - + if monet_theme == "dark": - dark_theme = theme["schemes"]["dark"] + dark_theme = theme["schemes"]["dark"] variable = { "accent_color": self.rgba_from_argb(dark_theme.primary), "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), @@ -297,8 +293,8 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "shade_color": self.rgba_from_argb(dark_theme.shadow), "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) } - else: # light - light_theme = theme["schemes"]["light"] + else: # light + light_theme = theme["schemes"]["light"] variable = { "accent_color": self.rgba_from_argb(light_theme.primary), "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), @@ -349,7 +345,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): for key in variable.keys(): if key in self.pref_variables: self.pref_variables[key].update_value(variable[key]) - + self.reload_variables() def generate_gtk_css(self, app_type): @@ -419,7 +415,8 @@ def load_preset_action(self, _unused, *args): if args[0].get_string().startswith("custom-"): self.load_preset_from_file( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", args[0].get_string().replace("custom-", "", 1) + ".json", ) @@ -451,7 +448,6 @@ def show_apply_color_scheme_dialog(self, *_args): box.append(label) box.append(switch) - print(dir(switch)) dialog.set_extra_child(box) @@ -478,7 +474,8 @@ def show_save_preset_dialog(self, *_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(self.preset_name) + ".json", ) @@ -501,7 +498,7 @@ def on_preset_entry_change(*_args): dialog.set_body( _( "Saving preset to {0}. If that preset already exists, it will be overwritten!" - ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets")) + ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets")) ) dialog.set_response_enabled("save", False) else: @@ -510,7 +507,8 @@ def on_preset_entry_change(*_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(preset_entry.get_text()) + ".json", ) @@ -529,7 +527,8 @@ def save_preset(self, _unused, response, entry): if response == "save": with open( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(entry.get_text()) + ".json", ), @@ -544,14 +543,15 @@ def save_preset(self, _unused, response, entry): } file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Scheme successfully saved!"))) def apply_color_scheme(self, widget, response, switch): if response == "apply": if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -561,7 +561,7 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -572,7 +572,7 @@ def apply_color_scheme(self, widget, response, switch): else: if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -582,7 +582,7 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -590,30 +590,32 @@ def apply_color_scheme(self, widget, response, switch): os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" ) as file: file.write(gtk3_css) - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): if response == "reset": if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0/gtk.css") ) try: file.delete() except Exception: pass - + if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0/gtk.css") ) try: file.delete() except Exception: pass - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( From 1ee3b7c0bf0d349004c57742ef8498cb4b501df5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:39:52 +0200 Subject: [PATCH 131/149] format --- src/app_type_dialog.py | 23 +++- src/custom_css_group.py | 24 ++-- src/error.py | 9 +- src/main.py | 157 +++++++++++++------------ src/option.py | 27 +++-- src/palette_shades.py | 25 ++-- src/plugin.py | 11 +- src/plugins/__init__.py | 6 +- src/plugins/gtk4.py | 7 +- src/plugins_list.py | 21 ++-- src/setting.py | 7 +- src/settings_schema.py | 251 ++++++++++++++++++++-------------------- src/window.py | 70 ++++++----- 13 files changed, 355 insertions(+), 283 deletions(-) diff --git a/src/app_type_dialog.py b/src/app_type_dialog.py index be2707fe2..f7f88133d 100644 --- a/src/app_type_dialog.py +++ b/src/app_type_dialog.py @@ -7,25 +7,36 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/app_type_dialog.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/app_type_dialog.ui" +) class AdwcustomizerAppTypeDialog(Adw.MessageDialog): - __gtype_name__ = 'AdwcustomizerAppTypeDialog' + __gtype_name__ = "AdwcustomizerAppTypeDialog" gtk4_app_type = Gtk.Template.Child("gtk4-app-type") gtk3_app_type = Gtk.Template.Child("gtk3-app-type") - def __init__(self, heading, body, ok_response_name, ok_response_label, ok_response_appearance, **kwargs): + def __init__( + self, + heading, + body, + ok_response_name, + ok_response_label, + ok_response_appearance, + **kwargs + ): super().__init__(**kwargs) self.set_heading(heading) self.set_body(body) @@ -39,5 +50,5 @@ def __init__(self, heading, body, ok_response_name, ok_response_label, ok_respon def get_app_types(self): return { "gtk4": self.gtk4_app_type.get_active(), - "gtk3": self.gtk3_app_type.get_active() + "gtk3": self.gtk3_app_type.get_active(), } diff --git a/src/custom_css_group.py b/src/custom_css_group.py index 2e2d453bd..1f98ab800 100644 --- a/src/custom_css_group.py +++ b/src/custom_css_group.py @@ -7,20 +7,23 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/custom_css_group.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/custom_css_group.ui" +) class AdwcustomizerCustomCSSGroup(Adw.PreferencesGroup): - __gtype_name__ = 'AdwcustomizerCustomCSSGroup' + __gtype_name__ = "AdwcustomizerCustomCSSGroup" app_type_dropdown = Gtk.Template.Child("app-type-dropdown") custom_css_text_view = Gtk.Template.Child("custom-css-text-view") @@ -31,14 +34,21 @@ def __init__(self, **kwargs): def load_custom_css(self, custom_css): self.custom_css = custom_css - self.custom_css_text_view.get_buffer().set_text(list(self.custom_css.values())[self.app_type_dropdown.get_selected()]) + self.custom_css_text_view.get_buffer().set_text( + list(self.custom_css.values())[self.app_type_dropdown.get_selected()] + ) @Gtk.Template.Callback() def on_custom_css_changed(self, buffer): Gtk.Application.get_default().mark_as_dirty() - Gtk.Application.get_default().update_custom_css_text(list(self.custom_css.keys())[self.app_type_dropdown.get_selected()], buffer.props.text) + Gtk.Application.get_default().update_custom_css_text( + list(self.custom_css.keys())[self.app_type_dropdown.get_selected()], + buffer.props.text, + ) @Gtk.Template.Callback() def on_dropdown_notify(self, _unused, pspec): if pspec.name == "selected": - self.custom_css_text_view.get_buffer().set_text(list(self.custom_css.values())[self.app_type_dropdown.get_selected()]) + self.custom_css_text_view.get_buffer().set_text( + list(self.custom_css.values())[self.app_type_dropdown.get_selected()] + ) diff --git a/src/error.py b/src/error.py index 98fd3fdf1..2760bd544 100644 --- a/src/error.py +++ b/src/error.py @@ -7,20 +7,21 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/error.ui') + +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/error.ui") class AdwcustomizerError(Gtk.ListBoxRow): - __gtype_name__ = 'AdwcustomizerError' + __gtype_name__ = "AdwcustomizerError" error_label = Gtk.Template.Child("error-label") element_label = Gtk.Template.Child("element-label") diff --git a/src/main.py b/src/main.py index 4d4d6f45a..042eaf87b 100644 --- a/src/main.py +++ b/src/main.py @@ -89,10 +89,8 @@ def do_activate(self): GLib.Variant("s", "adwaita"), self.load_preset_action, ) - self.create_action("apply_color_scheme", - self.show_apply_color_scheme_dialog) - self.create_action("reset_color_scheme", - self.show_reset_color_scheme_dialog) + self.create_action("apply_color_scheme", self.show_apply_color_scheme_dialog) + self.create_action("reset_color_scheme", self.show_reset_color_scheme_dialog) self.create_action("save_preset", self.show_save_preset_dialog) self.create_action("about", self.show_about_window) @@ -115,7 +113,9 @@ def reload_user_defined_presets(self): self.props.active_window.presets_menu.remove(1) preset_directory = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), + "presets", + ) if not os.path.exists(preset_directory): os.makedirs(preset_directory) @@ -132,8 +132,7 @@ def reload_user_defined_presets(self): raise KeyError("variables") if preset.get("palette") is None: raise KeyError("palette") - self.custom_presets[file_name.replace( - ".json", "")] = preset["name"] + self.custom_presets[file_name.replace(".json", "")] = preset["name"] except Exception: self.global_errors.append( { @@ -143,7 +142,8 @@ def reload_user_defined_presets(self): } ) self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Failed to load preset"))) + Adw.Toast(title=_("Failed to load preset")) + ) self.props.active_window.update_errors(self.global_errors) @@ -176,8 +176,11 @@ def open_dir_callback(_, result): self.portal.open_uri( parent, - "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), "presets"), + "file://" + + os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), + "presets", + ), Xdp.OpenUriFlags.NONE, None, open_dir_callback, @@ -190,8 +193,7 @@ def load_preset_from_file(self, preset_path): self.load_preset_variables(json.loads(preset_text)) def load_preset_from_resource(self, preset_path): - preset_text = Gio.resources_lookup_data( - preset_path, 0).get_data().decode() + preset_text = Gio.resources_lookup_data(preset_path, 0).get_data().decode() self.load_preset_variables(json.loads(preset_text)) def load_preset_variables(self, preset): @@ -251,47 +253,40 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_color": self.rgba_from_argb(dark_theme.primary), "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), "accent_fg_color": self.rgba_from_argb(dark_theme.onPrimaryContainer), - "destructive_color": self.rgba_from_argb(dark_theme.error), "destructive_bg_color": self.rgba_from_argb(dark_theme.errorContainer), "destructive_fg_color": self.rgba_from_argb(dark_theme.onError), - "success_color": self.rgba_from_argb(dark_theme.tertiary), "success_bg_color": self.rgba_from_argb(dark_theme.onTertiary), "success_fg_color": self.rgba_from_argb(dark_theme.tertiaryContainer), - "warning_color": self.rgba_from_argb(dark_theme.secondaryContainer), "warning_bg_color": self.rgba_from_argb(dark_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": self.rgba_from_argb(dark_theme.error), "error_bg_color": self.rgba_from_argb(dark_theme.errorContainer), "error_fg_color": self.rgba_from_argb(dark_theme.onError), - "window_bg_color": self.rgba_from_argb(dark_theme.surface), "window_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "view_bg_color": self.rgba_from_argb(dark_theme.surface), "view_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_bg_color": self.rgba_from_argb(dark_theme.surface), "headerbar_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), + "headerbar_border_color": self.rgba_from_argb( + dark_theme.primary, "0.8" + ), "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), - "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), "card_shade_color": self.rgba_from_argb(dark_theme.shadow), - "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "popover_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), - "popover_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - + "popover_fg_color": self.rgba_from_argb( + dark_theme.onSecondaryContainer + ), "shade_color": self.rgba_from_argb(dark_theme.shadow), - "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) + "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline), } else: # light light_theme = theme["schemes"]["light"] @@ -299,47 +294,42 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_color": self.rgba_from_argb(light_theme.primary), "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), "accent_fg_color": self.rgba_from_argb(light_theme.onPrimaryContainer), - "destructive_color": self.rgba_from_argb(light_theme.error), "destructive_bg_color": self.rgba_from_argb(light_theme.errorContainer), "destructive_fg_color": self.rgba_from_argb(light_theme.onError), - "success_color": self.rgba_from_argb(light_theme.tertiary), "success_bg_color": self.rgba_from_argb(light_theme.onTertiary), "success_fg_color": self.rgba_from_argb(light_theme.tertiaryContainer), - "warning_color": self.rgba_from_argb(light_theme.secondaryContainer), "warning_bg_color": self.rgba_from_argb(light_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(light_theme.primary, "0.8"), - "error_color": self.rgba_from_argb(light_theme.error), "error_bg_color": self.rgba_from_argb(light_theme.errorContainer), "error_fg_color": self.rgba_from_argb(light_theme.onError), - "window_bg_color": self.rgba_from_argb(light_theme.surface), "window_fg_color": self.rgba_from_argb(light_theme.onSurface), - "view_bg_color": self.rgba_from_argb(light_theme.surface), "view_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_bg_color": self.rgba_from_argb(light_theme.surface), "headerbar_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_border_color": self.rgba_from_argb(light_theme.primary, "0.8"), + "headerbar_border_color": self.rgba_from_argb( + light_theme.primary, "0.8" + ), "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(light_theme.shadow), - "card_bg_color": self.rgba_from_argb(light_theme.primary, "0.05"), "card_fg_color": self.rgba_from_argb(light_theme.surfaceVariant), "card_shade_color": self.rgba_from_argb(light_theme.shadow), - "dialog_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), - "dialog_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - + "dialog_fg_color": self.rgba_from_argb( + light_theme.onSecondaryContainer + ), "popover_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), - "popover_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - + "popover_fg_color": self.rgba_from_argb( + light_theme.onSecondaryContainer + ), "shade_color": self.rgba_from_argb(light_theme.shadow), - "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline) + "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline), } for key in variable.keys(): @@ -395,8 +385,7 @@ def on_error(_, section, error): css_provider.connect("parsing-error", on_error) css_provider.load_from_data(gtk_css.encode()) - self.props.active_window.update_errors( - self.global_errors + parsing_errors) + self.props.active_window.update_errors(self.global_errors + parsing_errors) # loading with the priority above user to override the applied config if self.current_css_provider is not None: Gtk.StyleContext.remove_provider_for_display( @@ -415,8 +404,7 @@ def load_preset_action(self, _unused, *args): if args[0].get_string().startswith("custom-"): self.load_preset_from_file( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", args[0].get_string().replace("custom-", "", 1) + ".json", ) @@ -474,8 +462,7 @@ def show_save_preset_dialog(self, *_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", to_slug_case(self.preset_name) + ".json", ) @@ -485,8 +472,7 @@ def show_save_preset_dialog(self, *_args): dialog.add_response("cancel", _("Cancel")) dialog.add_response("save", _("Save")) - dialog.set_response_appearance( - "save", Adw.ResponseAppearance.SUGGESTED) + dialog.set_response_appearance("save", Adw.ResponseAppearance.SUGGESTED) dialog.set_default_response("cancel") dialog.set_close_response("cancel") @@ -498,7 +484,14 @@ def on_preset_entry_change(*_args): dialog.set_body( _( "Saving preset to {0}. If that preset already exists, it will be overwritten!" - ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets")) + ).format( + os.path.join( + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "presets", + ) + ) ) dialog.set_response_enabled("save", False) else: @@ -507,8 +500,9 @@ def on_preset_entry_change(*_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), "presets", to_slug_case(preset_entry.get_text()) + ".json", ) @@ -527,8 +521,7 @@ def save_preset(self, _unused, response, entry): if response == "save": with open( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", to_slug_case(entry.get_text()) + ".json", ), @@ -544,14 +537,19 @@ def save_preset(self, _unused, response, entry): file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Scheme successfully saved!"))) + Adw.Toast(title=_("Scheme successfully saved!")) + ) def apply_color_scheme(self, widget, response, switch): if response == "apply": if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0", + ) if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -561,7 +559,11 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0", + ) if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -572,7 +574,11 @@ def apply_color_scheme(self, widget, response, switch): else: if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0", + ) if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -582,7 +588,11 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0", + ) if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -591,14 +601,19 @@ def apply_color_scheme(self, widget, response, switch): ) as file: file.write(gtk3_css) self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Scheme set successfully!"))) + Adw.Toast(title=_("Scheme set successfully!")) + ) def reset_color_scheme(self, widget, response): if response == "reset": if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0/gtk.css") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0/gtk.css", + ) ) try: file.delete() @@ -608,14 +623,17 @@ def reset_color_scheme(self, widget, response): if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0/gtk.css") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0/gtk.css", + ) ) try: file.delete() except Exception: pass - self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Reset successfully!"))) + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( @@ -631,12 +649,8 @@ def show_about_window(self, *_args): "0xMRTT https://github.com/0xMRTT", "Verantor https://github.com/Verantor", ], - artists=[ - 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' - ], - designers=[ - 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' - ], + artists=['David "Daudix UFO" Lapshin https://github.com/daudix-UFO'], + designers=['David "Daudix UFO" Lapshin https://github.com/daudix-UFO'], # Translators: This is a place to put your credits (formats: "Name https://example.com" or "Name ", no quotes) and is not meant to be translated literally. translator_credits="""Maxime V https://www.transifex.com/user/profile/Adaoh/ FineFindus https://github.com/FineFindus @@ -676,8 +690,7 @@ def create_stateful_action( self, name, parameter_type, initial_state, callback, shortcuts=None ): """Add a stateful application action.""" - action = Gio.SimpleAction.new_stateful( - name, parameter_type, initial_state) + action = Gio.SimpleAction.new_stateful(name, parameter_type, initial_state) action.connect("activate", callback) self.add_action(action) if shortcuts: diff --git a/src/option.py b/src/option.py index ed98f2d12..885339f22 100644 --- a/src/option.py +++ b/src/option.py @@ -7,20 +7,21 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/option.ui') + +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/option.ui") class AdwcustomizerOption(Adw.ActionRow): - __gtype_name__ = 'AdwcustomizerOption' + __gtype_name__ = "AdwcustomizerOption" color_value = Gtk.Template.Child("color-value") text_value = Gtk.Template.Child("text-value") @@ -42,10 +43,14 @@ def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs): self.warning_button.set_visible(False) elif adw_gtk3_support == "partial": self.warning_button.add_css_class("warning") - self.warning_label.set_label(_("This option is only partially supported by the adw-gtk3 theme.")) + self.warning_label.set_label( + _("This option is only partially supported by the adw-gtk3 theme.") + ) elif adw_gtk3_support == "no": self.warning_button.add_css_class("error") - self.warning_label.set_label(_("This option is not supported by the adw-gtk3 theme.")) + self.warning_label.set_label( + _("This option is not supported by the adw-gtk3 theme.") + ) self.explanation_label.set_label(explanation or "") if explanation is None: @@ -53,7 +58,9 @@ def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs): @Gtk.Template.Callback() def on_color_value_changed(self, *_args): - self.update_value(self.color_value.get_rgba().to_string(), update_from="color_value") + self.update_value( + self.color_value.get_rgba().to_string(), update_from="color_value" + ) @Gtk.Template.Callback() def on_text_value_changed(self, *_args): @@ -86,7 +93,11 @@ def update_value(self, new_value, **kwargs): self.color_value.set_rgba(rgba) self.color_value.set_tooltip_text(_("Not a color, see text value")) - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "text_value" and new_value != "": + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "text_value" + and new_value != "" + ): Gtk.Application.get_default().variables[self.get_name()] = new_value Gtk.Application.get_default().mark_as_dirty() Gtk.Application.get_default().reload_variables() diff --git a/src/palette_shades.py b/src/palette_shades.py index f7eb9bf79..dcb0cc63d 100644 --- a/src/palette_shades.py +++ b/src/palette_shades.py @@ -7,20 +7,23 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/palette_shades.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/palette_shades.ui" +) class AdwcustomizerPaletteShades(Adw.ActionRow): - __gtype_name__ = 'AdwcustomizerPaletteShades' + __gtype_name__ = "AdwcustomizerPaletteShades" def __init__(self, prefix, color_title, n_shades, **kwargs): super().__init__(**kwargs) @@ -52,9 +55,17 @@ def update_shades(self, shades, **kwargs): if new_rgba.parse(shades[str(i)]): self.color_pickers[str(i)].set_rgba(new_rgba) self.color_pickers[str(i)].set_tooltip_text(shades[str(i)]) - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "color_value": - Gtk.Application.get_default().palette[self.prefix][str(i)] = shades[str(i)] + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "color_value" + ): + Gtk.Application.get_default().palette[self.prefix][str(i)] = shades[ + str(i) + ] - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "color_value": + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "color_value" + ): Gtk.Application.get_default().mark_as_dirty() Gtk.Application.get_default().reload_variables() diff --git a/src/plugin.py b/src/plugin.py index 16a234f24..cceb7e014 100644 --- a/src/plugin.py +++ b/src/plugin.py @@ -7,17 +7,18 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from .setting import AdwcustomizerSetting + class AdwcustomizerPlugin: def __init__(self): self.title = None @@ -48,7 +49,9 @@ def get_custom_settings_for_preset(self): def get_alias_values(self): alias_values = {} for key, value in self.alias_dict.items(): - alias_values[key] = self.colors.get(value, self.palette.get(value, self.custom_settings.get(value))) + alias_values[key] = self.colors.get( + value, self.palette.get(value, self.custom_settings.get(value)) + ) return alias_values def validate(self): @@ -58,4 +61,4 @@ def apply(self): raise NotImplementedError() def save(self): - pass \ No newline at end of file + pass diff --git a/src/plugins/__init__.py b/src/plugins/__init__.py index a66319289..f93ffe537 100644 --- a/src/plugins/__init__.py +++ b/src/plugins/__init__.py @@ -7,11 +7,11 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with this program. If not, see . \ No newline at end of file +# along with this program. If not, see . diff --git a/src/plugins/gtk4.py b/src/plugins/gtk4.py index b5a7d14f1..dd5fe68e9 100644 --- a/src/plugins/gtk4.py +++ b/src/plugins/gtk4.py @@ -7,16 +7,17 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from ..plugin import AdwcustomizerPlugin + class AdwcustomizerGtk4Plugin(AdwcustomizerPlugin): - pass \ No newline at end of file + pass diff --git a/src/plugins_list.py b/src/plugins_list.py index 3c7c04b35..d2c14499e 100644 --- a/src/plugins_list.py +++ b/src/plugins_list.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -20,22 +20,27 @@ import os from pathlib import Path import importlib + + class AdwcustomizerPluginsList: def __init__(self): - self.plugins = { # AdwCustomizerTeam plugins - "gtk4": AdwcustomizerGtk4Plugin() - } + self.plugins = {"gtk4": AdwcustomizerGtk4Plugin()} # AdwCustomizerTeam plugins self.add_user_plugins() def add_user_plugins(self): - self.user_plugin_dir = Path(os.environ.get("XDG_DATA_HOME", os.environ["HOME"])) / ".local" / "share" / "AdwCustomizer" / "plugins" + self.user_plugin_dir = ( + Path(os.environ.get("XDG_DATA_HOME", os.environ["HOME"])) + / ".local" + / "share" + / "AdwCustomizer" + / "plugins" + ) if self.user_plugin_dir.exists(): for path, _, name in os.walk(self.user_plugin_dir): print(name[0]) else: print("No plugins dir found") - def load_all_custom_settings(self, settings): for plugin_id, plugin in self.plugins.items(): plugin.load_custom_settings(settings[plugin_id]) @@ -43,4 +48,4 @@ def load_all_custom_settings(self, settings): def get_all_custom_settings_for_preset(self): custom_settings = {} for plugin_id, plugin in self.plugins.items(): - custom_settings[plugin_id] = plugin.get_custom_settings_for_preset() \ No newline at end of file + custom_settings[plugin_id] = plugin.get_custom_settings_for_preset() diff --git a/src/setting.py b/src/setting.py index 9a7492815..a2d3479b5 100644 --- a/src/setting.py +++ b/src/setting.py @@ -7,15 +7,16 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . + class AdwcustomizerSetting: def __init__(self, name, title, value_type, explanation=None, default_value=None): # TODO supported types: @@ -34,4 +35,4 @@ def __init__(self, name, title, value_type, explanation=None, default_value=None def set_value(self, new_value): # TODO checks - self.value = new_value \ No newline at end of file + self.value = new_value diff --git a/src/settings_schema.py b/src/settings_schema.py index ea9317441..ea22ce840 100644 --- a/src/settings_schema.py +++ b/src/settings_schema.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -21,117 +21,137 @@ { "name": "accent_colors", "title": _("Accent Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, and entries, to indicate that a widget is important, interactive, or currently active."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, and entries, to indicate that a widget is important, interactive, or currently active." + ), "variables": [ { "name": "accent_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "accent_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "accent_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "destructive_colors", "title": _("Destructive Colors"), - "description": _("These colors are used for buttons to indicate a dangerous action, such as deleting a file."), + "description": _( + "These colors are used for buttons to indicate a dangerous action, such as deleting a file." + ), "variables": [ { "name": "destructive_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "destructive_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "destructive_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "success_colors", "title": _("Success Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a success or a high level."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a success or a high level." + ), "variables": [ { "name": "success_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "success_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "success_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "warning_colors", "title": _("Warning Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a warning or a low level."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a warning or a low level." + ), "variables": [ { "name": "warning_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "warning_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "warning_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "error_colors", "title": _("Error Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, and entries, to indicate a failure."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, and entries, to indicate a failure." + ), "variables": [ { "name": "error_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "error_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "error_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "window_colors", @@ -141,66 +161,76 @@ { "name": "window_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "window_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "view_colors", "title": _("View Colors"), - "description": _("These colors are used in a variety of widgets, such as text views and entries."), + "description": _( + "These colors are used in a variety of widgets, such as text views and entries." + ), "variables": [ { "name": "view_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "view_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "headerbar_colors", "title": _("Header Bar Colors"), - "description": _("These colors are used for header bars, as well as widgets that are meant to be visually attached to it, such as search bars or tab bars."), + "description": _( + "These colors are used for header bars, as well as widgets that are meant to be visually attached to it, such as search bars or tab bars." + ), "variables": [ { "name": "headerbar_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "headerbar_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "headerbar_border_color", "title": _("Border Color"), - "explanation": _("The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout."), - "adw_gtk3_support": "no" + "explanation": _( + "The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout." + ), + "adw_gtk3_support": "no", }, { "name": "headerbar_backdrop_color", "title": _("Backdrop Color"), - "explanation": _("The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color."), - "adw_gtk3_support": "yes" + "explanation": _( + "The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color." + ), + "adw_gtk3_support": "yes", }, { "name": "headerbar_shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window."), - "adw_gtk3_support": "no" - } - ] + "explanation": _( + "The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window." + ), + "adw_gtk3_support": "no", + }, + ], }, { "name": "card_colors", @@ -210,20 +240,22 @@ { "name": "card_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "card_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "card_shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards."), - "adw_gtk3_support": "no" - } - ] + "explanation": _( + "The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards." + ), + "adw_gtk3_support": "no", + }, + ], }, { "name": "dialog_colors", @@ -233,14 +265,14 @@ { "name": "dialog_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "no" + "adw_gtk3_support": "no", }, { "name": "dialog_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "no" - } - ] + "adw_gtk3_support": "no", + }, + ], }, { "name": "popover_colors", @@ -250,14 +282,14 @@ { "name": "popover_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "popover_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "misc_colors", @@ -267,67 +299,32 @@ { "name": "shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders."), - "adw_gtk3_support": "no" + "explanation": _( + "The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders." + ), + "adw_gtk3_support": "no", }, { "name": "scrollbar_outline_color", "title": _("Scrollbar Outline Color"), - "explanation": _("The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color."), - "adw_gtk3_support": "no" - } - ] - } + "explanation": _( + "The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color." + ), + "adw_gtk3_support": "no", + }, + ], + }, ], "palette": [ - { - "prefix": "blue_", - "title": _("Blue"), - "n_shades": 5 - }, - { - "prefix": "green_", - "title": _("Green"), - "n_shades": 5 - }, - { - "prefix": "yellow_", - "title": _("Yellow"), - "n_shades": 5 - }, - { - "prefix": "orange_", - "title": _("Orange"), - "n_shades": 5 - }, - { - "prefix": "red_", - "title": _("Red"), - "n_shades": 5 - }, - { - "prefix": "purple_", - "title": _("Purple"), - "n_shades": 5 - }, - { - "prefix": "brown_", - "title": _("Brown"), - "n_shades": 5 - }, - { - "prefix": "light_", - "title": _("Light"), - "n_shades": 5 - }, - { - "prefix": "dark_", - "title": _("Dark"), - "n_shades": 5 - } + {"prefix": "blue_", "title": _("Blue"), "n_shades": 5}, + {"prefix": "green_", "title": _("Green"), "n_shades": 5}, + {"prefix": "yellow_", "title": _("Yellow"), "n_shades": 5}, + {"prefix": "orange_", "title": _("Orange"), "n_shades": 5}, + {"prefix": "red_", "title": _("Red"), "n_shades": 5}, + {"prefix": "purple_", "title": _("Purple"), "n_shades": 5}, + {"prefix": "brown_", "title": _("Brown"), "n_shades": 5}, + {"prefix": "light_", "title": _("Light"), "n_shades": 5}, + {"prefix": "dark_", "title": _("Dark"), "n_shades": 5}, ], - "custom_css_app_types": [ - "gtk4", - "gtk3" - ] + "custom_css_app_types": ["gtk4", "gtk3"], } diff --git a/src/window.py b/src/window.py index 1f10d3f0a..25d03cc83 100644 --- a/src/window.py +++ b/src/window.py @@ -36,9 +36,9 @@ from material_color_utilities_python import * -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui") class AdwcustomizerMainWindow(Adw.ApplicationWindow): - __gtype_name__ = 'AdwcustomizerMainWindow' + __gtype_name__ = "AdwcustomizerMainWindow" content = Gtk.Template.Child() toast_overlay = Gtk.Template.Child() @@ -54,14 +54,14 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) self.presets_dropdown.get_popover().connect( - "show", self.on_presets_dropdown_activate) + "show", self.on_presets_dropdown_activate + ) self.setup_monet_page() self.setup_plugins_page() self.setup_colors_page() - self.settings = Gio.Settings( - "com.github.AdwCustomizerTeam.AdwCustomizer") + self.settings = Gio.Settings("com.github.AdwCustomizerTeam.AdwCustomizer") self.settings.bind( "window-width", self, "default-width", Gio.SettingsBindFlags.DEFAULT @@ -93,7 +93,9 @@ def on_monet_file_chooser_response(self, widget, response): self.theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) + self.get_application().update_theme_from_monet( + self.theme, self.tone, self.monet_theme + ) def setup_monet_page(self): @@ -101,7 +103,10 @@ def setup_monet_page(self): self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) self.monet_pref_group.set_description( - _("Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow")) + _( + "Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow" + ) + ) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -111,21 +116,21 @@ def setup_monet_page(self): self.monet_file_chooser_button = Gtk.Button() self.monet_file_chooser_button.set_label(_("Choose a file")) - self.monet_file_chooser_button.set_icon_name( - "folder-pictures-symbolic") + self.monet_file_chooser_button.set_icon_name("folder-pictures-symbolic") self.monet_file_chooser_button.connect( - "clicked", self.on_file_picker_button_clicked) + "clicked", self.on_file_picker_button_clicked + ) self.monet_file_chooser_dialog.connect( - "response", self.on_monet_file_chooser_response) + "response", self.on_monet_file_chooser_response + ) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) self.monet_pref_group.add(self.monet_file_chooser_row) - self.monet_palette_shades = AdwcustomizerPaletteShades("monet", - "Monet Palette", - 6) - self.get_application( - ).pref_palette_shades["monet"] = self.monet_palette_shades + self.monet_palette_shades = AdwcustomizerPaletteShades( + "monet", "Monet Palette", 6 + ) + self.get_application().pref_palette_shades["monet"] = self.monet_palette_shades self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() @@ -168,14 +173,14 @@ def setup_colors_page(self): pref_group.set_description(group["description"]) for variable in group["variables"]: - pref_variable = AdwcustomizerOption(variable["name"], - variable["title"], - variable.get( - "explanation"), - variable["adw_gtk3_support"]) + pref_variable = AdwcustomizerOption( + variable["name"], + variable["title"], + variable.get("explanation"), + variable["adw_gtk3_support"], + ) pref_group.add(pref_variable) - self.get_application( - ).pref_variables[variable["name"]] = pref_variable + self.get_application().pref_variables[variable["name"]] = pref_variable self.content.add(pref_group) @@ -183,14 +188,16 @@ def setup_colors_page(self): palette_pref_group.set_name("palette_colors") palette_pref_group.set_title(_("Palette Colors")) palette_pref_group.set_description( - _("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) + _( + 'Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.' + ) + ) for color in settings_schema["palette"]: - palette_shades = AdwcustomizerPaletteShades(color["prefix"], - color["title"], - color["n_shades"]) + palette_shades = AdwcustomizerPaletteShades( + color["prefix"], color["title"], color["n_shades"] + ) palette_pref_group.add(palette_shades) - self.get_application( - ).pref_palette_shades[color["prefix"]] = palette_shades + self.get_application().pref_palette_shades[color["prefix"]] = palette_shades self.content.add(palette_pref_group) def update_errors(self, errors): @@ -200,8 +207,9 @@ def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) self.errors_button.set_visible(len(errors) > 0) for error in errors: - self.errors_list.append(AdwcustomizerError( - error["error"], error["element"], error["line"])) + self.errors_list.append( + AdwcustomizerError(error["error"], error["element"], error["line"]) + ) def on_presets_dropdown_activate(self, *args): self.get_application().reload_user_defined_presets() From f84080832408da0368c8ff33b488993b9e538235 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:44:51 +0200 Subject: [PATCH 132/149] add version --- meson.build | 6 +++++- src/info.py.in | 2 ++ src/main.py | 3 ++- src/meson.build | 11 +++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/info.py.in diff --git a/meson.build b/meson.build index 36f2ff2f4..e22a4fc1e 100644 --- a/meson.build +++ b/meson.build @@ -1,11 +1,15 @@ project('adwcustomizer', - version: 'git', + version: '0.1.0', meson_version: '>= 0.59.0', default_options: [ 'warning_level=2', 'werror=false', ], ) +dependency('glib-2.0') +dependency('pygobject-3.0') +dependency('libadwaita-1') + i18n = import('i18n') gnome = import('gnome') diff --git a/src/info.py.in b/src/info.py.in new file mode 100644 index 000000000..20fc34949 --- /dev/null +++ b/src/info.py.in @@ -0,0 +1,2 @@ +version = '@version@' +build_type = '@build_type@' \ No newline at end of file diff --git a/src/main.py b/src/main.py index 042eaf87b..142524a33 100644 --- a/src/main.py +++ b/src/main.py @@ -35,7 +35,7 @@ from .app_type_dialog import AdwcustomizerAppTypeDialog from .custom_css_group import AdwcustomizerCustomCSSGroup from .plugins_list import AdwcustomizerPluginsList - +from . import info def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -664,6 +664,7 @@ def show_about_window(self, *_args): Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, + version=f"{info.version}" ) about.present() diff --git a/src/meson.build b/src/meson.build index 7f45b1d13..b395392b1 100644 --- a/src/meson.build +++ b/src/meson.build @@ -40,6 +40,17 @@ configure_file( install_dir: get_option('bindir') ) +configure_file( + input: 'info.py.in', + output: '@BASENAME@', + install: true, + install_dir: python.get_install_dir() / 'adwcustomizer', + configuration: configuration_data({ + 'version': meson.project_version(), + 'build_type': get_option('buildtype'), + }), +) + adwcustomizer_sources = [ '__init__.py', 'settings_schema.py', From c775f93492d60738f4453c7f7323af2b82efabd9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:46:03 +0200 Subject: [PATCH 133/149] update meson build --- src/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index b395392b1..d3e13293a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -44,7 +44,7 @@ configure_file( input: 'info.py.in', output: '@BASENAME@', install: true, - install_dir: python.get_install_dir() / 'adwcustomizer', + install_dir: moduledir, configuration: configuration_data({ 'version': meson.project_version(), 'build_type': get_option('buildtype'), From 30ac48c58b3685a52a4b27b44d61fe2b90477094 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:47:30 +0200 Subject: [PATCH 134/149] format --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 142524a33..4849549f9 100644 --- a/src/main.py +++ b/src/main.py @@ -37,6 +37,7 @@ from .plugins_list import AdwcustomizerPluginsList from . import info + def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -664,7 +665,7 @@ def show_about_window(self, *_args): Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, - version=f"{info.version}" + version=f"{info.version}", ) about.present() From 63d59ffd66ece733b449f914eba171e4c2560345 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:51:30 +0200 Subject: [PATCH 135/149] udpate appstream metadata #77 --- ...github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index 9547dad90..86def6ddf 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -2,8 +2,11 @@ com.github.AdwCustomizerTeam.AdwCustomizer.desktop CC0-1.0 - MIT + GPL-3.0 - Change the look of Adwaita, with ease + Change the look of Adwaita, with ease - + https://github.com/AdwCustomizerTeam/AdwCustomizer/issues + https://github.com/AdwCustomizerTeam/AdwCustomizer + https://www.transifex.com/adwcustomizerteam/adwcustomizer/ + \ No newline at end of file From 6b64caccd48484c845c1c96e1f230fef629360f7 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 19:27:47 +0200 Subject: [PATCH 136/149] move menu button next to close button --- src/ui/window.blp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index 3b3abc816..da2d16a8c 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -45,11 +45,6 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } } - [end] - Gtk.MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } [end] MenuButton errors-button { @@ -58,6 +53,13 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { popover: errors-popover; } + + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + } Gtk.Box { From 2d7e04e3b7e0914df7a2bde1e2c9ffefdcafa9a5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 19:27:57 +0200 Subject: [PATCH 137/149] update appstream metadata --- data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index 86def6ddf..b6b00b08c 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -3,6 +3,8 @@ com.github.AdwCustomizerTeam.AdwCustomizer.desktop CC0-1.0 GPL-3.0 + Adwaita Manager + Change the look of Adwaita, with ease Change the look of Adwaita, with ease From 8d2facab423a51c45a07fd5debeca2b53703528f Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 20:12:34 +0200 Subject: [PATCH 138/149] switch back to main Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index 31be453cf..2bb34ef9d 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -71,7 +71,7 @@ { "type" : "git", "path" : ".", - "branch": "next" + "branch": "main" } ] } From 6405f813075861d95168c8018dba123736d029ed Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 20:13:21 +0200 Subject: [PATCH 139/149] auto instead of automatic Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 25d03cc83..2e35d7f4b 100644 --- a/src/window.py +++ b/src/window.py @@ -149,7 +149,7 @@ def setup_monet_page(self): self.monet_theme_row.set_title(_("Theme")) store = Gtk.StringList() - store.append("Automatic") + store.append("Auto") store.append("Dark") store.append("Light") self.monet_theme_row.set_model(store) From 405ad1d079e59ceaa645b28072ae6ccdd21d1f58 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:25:05 +0200 Subject: [PATCH 140/149] Update POT --- po/AdwCustomizer.pot | 229 +++++++++++++++++++++++++------------------ 1 file changed, 134 insertions(+), 95 deletions(-) diff --git a/po/AdwCustomizer.pot b/po/AdwCustomizer.pot index c45e60352..1d707805a 100644 --- a/po/AdwCustomizer.pot +++ b/po/AdwCustomizer.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-09 22:21+0300\n" +"POT-Creation-Date: 2022-08-12 11:24+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,11 +18,13 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: data/com.github.AdwCustomizerTeam.AdwCustomizer.desktop.in:3 -#: src/ui/window.blp:5 src/main.py:332 +#: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:6 +#: src/ui/window.blp:5 src/main.py:642 msgid "Adwaita Manager" msgstr "" #: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:7 +#: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:9 msgid "Change the look of Adwaita, with ease" msgstr "" @@ -70,225 +72,236 @@ msgstr "" msgid "Toggle Text Value" msgstr "" -#: src/ui/window.blp:13 src/main.py:245 +#: src/ui/window.blp:23 src/main.py:428 msgid "Apply" msgstr "" -#: src/ui/window.blp:20 -msgid "Save Preset" +#: src/ui/window.blp:35 +msgid "Presets" msgstr "" -#: src/ui/window.blp:36 -msgid "Presets" +#: src/ui/window.blp:42 +msgid "Save Preset" msgstr "" -#: src/ui/window.blp:58 +#: src/ui/window.blp:112 msgid "Built-in Presets" msgstr "" -#: src/ui/window.blp:73 +#: src/ui/window.blp:134 +msgid "Release Notes" +msgstr "" + +#: src/ui/window.blp:138 msgid "Reset Applied Color Scheme" msgstr "" -#: src/ui/window.blp:74 +#: src/ui/window.blp:142 msgid "About Adwaita Manager" msgstr "" -#: src/app_type_dialog.py:43 src/main.py:264 +#: src/app_type_dialog.py:44 src/main.py:474 msgid "Cancel" msgstr "" -#: src/main.py:123 +#: src/main.py:140 src/main.py:146 msgid "Failed to load preset" msgstr "" -#: src/main.py:139 +#: src/main.py:163 msgid "Open in File Manager" msgstr "" -#: src/main.py:142 +#: src/main.py:169 msgid "User Defined Presets" msgstr "" -#: src/main.py:203 +#: src/main.py:358 msgid "Unsaved changes" msgstr "" -#: src/main.py:243 +#: src/main.py:423 msgid "Apply this color scheme?" msgstr "" -#: src/main.py:244 +#: src/main.py:425 msgid "" "Warning: any custom CSS files for those app types will be irreversibly " "overwritten!" msgstr "" -#: src/main.py:251 +#: src/main.py:448 msgid "Reset applied color scheme?" msgstr "" -#: src/main.py:252 +#: src/main.py:449 msgid "Make sure you have the current settings saved as a preset." msgstr "" -#: src/main.py:253 +#: src/main.py:451 msgid "Reset" msgstr "" -#: src/main.py:260 +#: src/main.py:461 msgid "Save preset as..." msgstr "" -#: src/main.py:261 src/main.py:274 src/main.py:277 +#: src/main.py:463 src/main.py:487 src/main.py:501 #, python-brace-format msgid "" "Saving preset to {0}. If that preset already exists, it will be " "overwritten!" msgstr "" -#: src/main.py:265 +#: src/main.py:475 msgid "Save" msgstr "" -#: src/main.py:334 -msgid "Adwaita Manager Team" +#: src/main.py:541 +msgid "Scheme successfully saved!" msgstr "" -#. Translators: This is a place to put your credits (formats: "Name https://example.com" or "Name ", no quotes) and is not meant to be translated literally. -#: src/main.py:338 -msgid "translator-credits" +#: src/main.py:605 +msgid "Scheme set successfully!" msgstr "" -#: src/option.py:55 +#: src/main.py:637 +msgid "Reset successfully!" +msgstr "" + +#: src/main.py:644 +msgid "Adwaita Manager Team" +msgstr "" + +#: src/option.py:47 msgid "This option is only partially supported by the adw-gtk3 theme." msgstr "" -#: src/option.py:58 +#: src/option.py:52 msgid "This option is not supported by the adw-gtk3 theme." msgstr "" -#: src/option.py:97 +#: src/option.py:94 msgid "Not a color, see text value" msgstr "" -#: src/settings_schema.py:5 +#: src/settings_schema.py:23 msgid "Accent Colors" msgstr "" -#: src/settings_schema.py:6 +#: src/settings_schema.py:25 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, and entries, to indicate that a widget is important, interactive, or " "currently active." msgstr "" -#: src/settings_schema.py:10 src/settings_schema.py:33 -#: src/settings_schema.py:56 src/settings_schema.py:79 -#: src/settings_schema.py:102 +#: src/settings_schema.py:30 src/settings_schema.py:57 +#: src/settings_schema.py:84 src/settings_schema.py:111 +#: src/settings_schema.py:138 msgid "Standalone Color" msgstr "" -#: src/settings_schema.py:11 src/settings_schema.py:34 -#: src/settings_schema.py:57 src/settings_schema.py:80 -#: src/settings_schema.py:103 +#: src/settings_schema.py:32 src/settings_schema.py:59 +#: src/settings_schema.py:86 src/settings_schema.py:113 +#: src/settings_schema.py:140 msgid "" "The standalone colors are similar to the background ones, but provide better " "contrast when used as foreground color on top of a neutral background - for " "example, colorful text in a window." msgstr "" -#: src/settings_schema.py:16 src/settings_schema.py:39 -#: src/settings_schema.py:62 src/settings_schema.py:85 -#: src/settings_schema.py:108 src/settings_schema.py:125 -#: src/settings_schema.py:142 src/settings_schema.py:159 -#: src/settings_schema.py:194 src/settings_schema.py:217 -#: src/settings_schema.py:234 +#: src/settings_schema.py:38 src/settings_schema.py:65 +#: src/settings_schema.py:92 src/settings_schema.py:119 +#: src/settings_schema.py:146 src/settings_schema.py:163 +#: src/settings_schema.py:182 src/settings_schema.py:201 +#: src/settings_schema.py:242 src/settings_schema.py:267 +#: src/settings_schema.py:284 msgid "Background Color" msgstr "" -#: src/settings_schema.py:21 src/settings_schema.py:44 -#: src/settings_schema.py:67 src/settings_schema.py:90 -#: src/settings_schema.py:113 src/settings_schema.py:130 -#: src/settings_schema.py:147 src/settings_schema.py:164 -#: src/settings_schema.py:199 src/settings_schema.py:222 -#: src/settings_schema.py:239 +#: src/settings_schema.py:43 src/settings_schema.py:70 +#: src/settings_schema.py:97 src/settings_schema.py:124 +#: src/settings_schema.py:151 src/settings_schema.py:168 +#: src/settings_schema.py:187 src/settings_schema.py:206 +#: src/settings_schema.py:247 src/settings_schema.py:272 +#: src/settings_schema.py:289 msgid "Foreground Color" msgstr "" -#: src/settings_schema.py:28 +#: src/settings_schema.py:50 msgid "Destructive Colors" msgstr "" -#: src/settings_schema.py:29 +#: src/settings_schema.py:52 msgid "" "These colors are used for buttons to indicate a dangerous action, such as " "deleting a file." msgstr "" -#: src/settings_schema.py:51 +#: src/settings_schema.py:77 msgid "Success Colors" msgstr "" -#: src/settings_schema.py:52 +#: src/settings_schema.py:79 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, entries, and level bars, to indicate a success or a high level." msgstr "" -#: src/settings_schema.py:74 +#: src/settings_schema.py:104 msgid "Warning Colors" msgstr "" -#: src/settings_schema.py:75 +#: src/settings_schema.py:106 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, entries, and level bars, to indicate a warning or a low level." msgstr "" -#: src/settings_schema.py:97 +#: src/settings_schema.py:131 msgid "Error Colors" msgstr "" -#: src/settings_schema.py:98 +#: src/settings_schema.py:133 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, and entries, to indicate a failure." msgstr "" -#: src/settings_schema.py:120 +#: src/settings_schema.py:158 msgid "Window Colors" msgstr "" -#: src/settings_schema.py:121 +#: src/settings_schema.py:159 msgid "These colors are used primarily for windows." msgstr "" -#: src/settings_schema.py:137 +#: src/settings_schema.py:175 msgid "View Colors" msgstr "" -#: src/settings_schema.py:138 +#: src/settings_schema.py:177 msgid "" "These colors are used in a variety of widgets, such as text views and " "entries." msgstr "" -#: src/settings_schema.py:154 +#: src/settings_schema.py:194 msgid "Header Bar Colors" msgstr "" -#: src/settings_schema.py:155 +#: src/settings_schema.py:196 msgid "" "These colors are used for header bars, as well as widgets that are meant to " "be visually attached to it, such as search bars or tab bars." msgstr "" -#: src/settings_schema.py:169 +#: src/settings_schema.py:211 msgid "Border Color" msgstr "" -#: src/settings_schema.py:170 +#: src/settings_schema.py:213 msgid "" "The border color has the same default value as a foreground color, but " "doesn't change along with it. This can be useful if a light window has a " @@ -297,11 +310,11 @@ msgid "" "example, separators between the two header bars in a split header bar layout." msgstr "" -#: src/settings_schema.py:175 +#: src/settings_schema.py:219 msgid "Backdrop Color" msgstr "" -#: src/settings_schema.py:176 +#: src/settings_schema.py:221 msgid "" "The backdrop color is used instead of the background color when the window " "is not focused. By default it's an alias of the window's background color " @@ -309,113 +322,139 @@ msgid "" "it to a value matching your header bar background color." msgstr "" -#: src/settings_schema.py:181 src/settings_schema.py:204 -#: src/settings_schema.py:251 +#: src/settings_schema.py:227 src/settings_schema.py:252 +#: src/settings_schema.py:301 msgid "Shade Color" msgstr "" -#: src/settings_schema.py:182 +#: src/settings_schema.py:229 msgid "" "The shade color is used to provide a dark border for header bars and similar " "widgets that separates them from the main window." msgstr "" -#: src/settings_schema.py:189 +#: src/settings_schema.py:237 msgid "Card Colors" msgstr "" -#: src/settings_schema.py:190 +#: src/settings_schema.py:238 msgid "These colors are used for cards and boxed lists." msgstr "" -#: src/settings_schema.py:205 +#: src/settings_schema.py:254 msgid "" "The shade color is used for shadows that are used by cards to separate " "themselves from the window background, as well as for row dividers in the " "cards." msgstr "" -#: src/settings_schema.py:212 +#: src/settings_schema.py:262 msgid "Dialog Colors" msgstr "" -#: src/settings_schema.py:213 +#: src/settings_schema.py:263 msgid "These colors are used for message dialogs." msgstr "" -#: src/settings_schema.py:229 +#: src/settings_schema.py:279 msgid "Popover Colors" msgstr "" -#: src/settings_schema.py:230 +#: src/settings_schema.py:280 msgid "These colors are used for popovers." msgstr "" -#: src/settings_schema.py:246 +#: src/settings_schema.py:296 msgid "Miscalleneous Colors" msgstr "" -#: src/settings_schema.py:247 +#: src/settings_schema.py:297 msgid "Colors that don't fit in any particular group." msgstr "" -#: src/settings_schema.py:252 +#: src/settings_schema.py:303 msgid "" "The shade color is used by inline tab bars, as well as the transitions in " "leaflets and flaps, and info bar borders." msgstr "" -#: src/settings_schema.py:257 +#: src/settings_schema.py:309 msgid "Scrollbar Outline Color" msgstr "" -#: src/settings_schema.py:258 +#: src/settings_schema.py:311 msgid "" "The scrollbar outline color is used by scrollbars to ensure that overlay " "scrollbars are visible regardless of the content color." msgstr "" -#: src/settings_schema.py:267 +#: src/settings_schema.py:319 msgid "Blue" msgstr "" -#: src/settings_schema.py:272 +#: src/settings_schema.py:320 msgid "Green" msgstr "" -#: src/settings_schema.py:277 +#: src/settings_schema.py:321 msgid "Yellow" msgstr "" -#: src/settings_schema.py:282 +#: src/settings_schema.py:322 msgid "Orange" msgstr "" -#: src/settings_schema.py:287 +#: src/settings_schema.py:323 msgid "Red" msgstr "" -#: src/settings_schema.py:292 +#: src/settings_schema.py:324 msgid "Purple" msgstr "" -#: src/settings_schema.py:297 +#: src/settings_schema.py:325 msgid "Brown" msgstr "" -#: src/settings_schema.py:302 +#: src/settings_schema.py:326 msgid "Light" msgstr "" -#: src/settings_schema.py:307 +#: src/settings_schema.py:327 msgid "Dark" msgstr "" -#: src/window.py:70 +#: src/window.py:104 +msgid "Monet Engine" +msgstr "" + +#: src/window.py:107 +msgid "" +"Monet is an engine that generates Material Design 3 palette from backgrounds " +"color. The generation can be slow" +msgstr "" + +#: src/window.py:112 +msgid "Background Image" +msgstr "" + +#: src/window.py:118 +msgid "Choose a file" +msgstr "" + +#: src/window.py:137 +msgid "Tone" +msgstr "" + +#: src/window.py:149 +msgid "Theme" +msgstr "" + +#: src/window.py:189 msgid "Palette Colors" msgstr "" -#: src/window.py:71 +#: src/window.py:192 msgid "" "Named palette colors used by some applications. Default colors follow the GNOME Human " From deb7a6f40df1acb07f1d291f3c471dc81fa71cd5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:27:19 +0200 Subject: [PATCH 141/149] add devel flatpak --- .github/workflows/flatpak-nightly.yml | 4 +- ...AdwCustomizerTeam.AdwCustomizer.Devel.json | 82 +++++++++++++++++++ 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index fa297f23a..613457218 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -14,6 +14,6 @@ jobs: uses: actions/checkout@v3.0.2 - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 with: - bundle: com.github.AdwCustomizerTeam.AdwCustomizer.flatpak - manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.json + bundle: com.github.AdwCustomizerTeam.AdwCustomizer.Devel.flatpak + manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json cache-key: flatpak-builder-${{ github.sha }}-nightly \ No newline at end of file diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json b/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json new file mode 100644 index 000000000..31be453cf --- /dev/null +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json @@ -0,0 +1,82 @@ +{ + "app-id" : "com.github.AdwCustomizerTeam.AdwCustomizer", + "runtime" : "org.gnome.Platform", + "runtime-version" : "master", + "sdk" : "org.gnome.Sdk", + "command" : "adwcustomizer", + "finish-args" : [ + "--share=network", + "--share=ipc", + "--socket=fallback-x11", + "--device=dri", + "--socket=wayland", + "--filesystem=xdg-config/gtk-3.0", + "--filesystem=xdg-config/gtk-4.0" + ], + "cleanup" : [ + "/include", + "/lib/pkgconfig", + "/man", + "/share/doc", + "/share/gtk-doc", + "/share/man", + "/share/pkgconfig", + "*.la", + "*.a" + ], + "modules" : [ + "pypi-dependencies.json", + { + "name" : "blueprint-compiler", + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "url" : "https://gitlab.gnome.org/jwestman/blueprint-compiler", + "branch" : "main" + } + ] + }, + { + "name": "libportal", + "buildsystem": "meson", + "config-opts": ["-Ddocs=false", "-Dvapi=false", "-Dbackends=gtk4"], + "sources": [ + { + "type": "git", + "url": "https://github.com/flatpak/libportal", + "branch": "main" + } + ] + }, + { + "name": "material-color-utilities-python", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"material_color_utilities_python~=0.1.0\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "path": "./monet/material_color_utilities_python-0.1.0-py3-none-any.whl", + "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" + } + ] + }, + { + "name" : "adwcustomizer", + "builddir" : true, + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "path" : ".", + "branch": "next" + } + ] + } + ], + "build-options" : { + "env" : { } + } +} From e13af9f723333ad3b2311b4cf9393f2d2a9d37d8 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:28:57 +0200 Subject: [PATCH 142/149] update license --- po/AdwCustomizer.pot | 2 +- po/update_potfile.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/po/AdwCustomizer.pot b/po/AdwCustomizer.pot index 1d707805a..13f7a243a 100644 --- a/po/AdwCustomizer.pot +++ b/po/AdwCustomizer.pot @@ -1,6 +1,6 @@ # Adwaita Manager POT file # Copyright (C) 2022 Adwaita Manager Team -# This file is distributed under the MIT/X11 license. +# This file is distributed under the GNU GPLv3 license. # Adwaita Manager Team, 2022. # #, fuzzy diff --git a/po/update_potfile.sh b/po/update_potfile.sh index b20cc2c9e..8c9c7f35f 100755 --- a/po/update_potfile.sh +++ b/po/update_potfile.sh @@ -3,7 +3,7 @@ po_dir=$(dirname "$(realpath "$0")") xgettext -f "$po_dir"/POTFILES -o "$po_dir"/AdwCustomizer.pot --add-comments=Translators --keyword=_ --keyword=C_1c,2 --from-code=UTF-8 sed -i "s/SOME DESCRIPTIVE TITLE./Adwaita Manager POT file/" "$po_dir"/AdwCustomizer.pot sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/$(date +%Y) Adwaita Manager Team/" "$po_dir"/AdwCustomizer.pot -sed -i "s@same license as the PACKAGE package.@MIT/X11 license.@" "$po_dir"/AdwCustomizer.pot +sed -i "s@same license as the PACKAGE package.@GNU GPLv3 license.@" "$po_dir"/AdwCustomizer.pot sed -i "s/FIRST AUTHOR , YEAR./Adwaita Manager Team, $(date +%Y)./" "$po_dir"/AdwCustomizer.pot regex="$po_dir/([a-zA-Z_]*).po" From a9fe0b768dc3df47b20f63c3697a1b0e79e8efa4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:30:51 +0200 Subject: [PATCH 143/149] reverse button order --- src/ui/window.blp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index da2d16a8c..ba11eeb97 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -29,6 +29,12 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { stack: view_stack; } + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + [end] MenuButton presets-dropdown { menu-model: presets-menu; @@ -54,11 +60,6 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } - [end] - Gtk.MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } } From b23768a060e4f8cdae68493158d5342a0c17eaa4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:38:35 +0200 Subject: [PATCH 144/149] change card fg color --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 4849549f9..50f452655 100644 --- a/src/main.py +++ b/src/main.py @@ -278,7 +278,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), - "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), + "card_fg_color": self.rgba_from_argb(dark_theme.onSurface), "card_shade_color": self.rgba_from_argb(dark_theme.shadow), "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), From 36ec03fe62cfd1a38580200a8c55bdd2404a7939 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:49:29 +0200 Subject: [PATCH 145/149] update releases notes --- ...ustomizerTeam.AdwCustomizer.appdata.xml.in | 16 +++++++++ src/main.py | 34 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index b431f38a0..f75d2b327 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -104,6 +104,22 @@ First release of Adwaita Manager. + + Add AdwViewSwitcher in the header bar. + Move CSS to the "Advanced" tab + Move the rest to the "Colours" tab + Add Monet tab which generates a theme from a background + Add disk saved and disk unsaved icon in the header bar + Update about dialog + Change license to GNU GPLv3 + Begin plugin support + Move preset selector to a drop-down called palette (icon palette) + Add ability to apply the theme onlyfor dark theme or oy for light theme + Automaticly use Adwaita-dark preset if the user prefered scheme is dark. + Added Flatpak CI build + Added issue template for bug and feature request + `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch + diff --git a/src/main.py b/src/main.py index 50f452655..bed21e1f7 100644 --- a/src/main.py +++ b/src/main.py @@ -666,6 +666,40 @@ def show_about_window(self, *_args): copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, version=f"{info.version}", + release_notes=""" + + + Add AdwViewSwitcher in the header bar. + Move CSS to the "Advanced" tab + Move the rest to the "Colours" tab + Add Monet tab which generates a theme from a background + Add disk saved and disk unsaved icon in the header bar + Update about dialog + Change license to GNU GPLv3 + Begin plugin support + Move preset selector to a drop-down called palette (icon palette) + Add ability to apply the theme onlyfor dark theme or oy for light theme + Automaticly use Adwaita-dark preset if the user prefered scheme is dark. + Added Flatpak CI build + Added issue template for bug and feature request + `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch + + + """, + comments=""" + + Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. + + With Adwaita Manager you can: + + Change any color of Adwaita theme + Apply Material 3 colors from wallaper + Use other users presets + Change advanced options with CSS + Extend functionality using plugins + + This app is written in Python and uses GTK 4 and libadwaita. + """ ) about.present() From 262a690da3ab80eb3ca9bed8fff6b358ee981864 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:54:45 +0200 Subject: [PATCH 146/149] remove markup --- src/main.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index bed21e1f7..1f93c3fb5 100644 --- a/src/main.py +++ b/src/main.py @@ -667,7 +667,6 @@ def show_about_window(self, *_args): license_type=Gtk.License.GPL_3_0, version=f"{info.version}", release_notes=""" - Add AdwViewSwitcher in the header bar. Move CSS to the "Advanced" tab @@ -684,13 +683,11 @@ def show_about_window(self, *_args): Added issue template for bug and feature request `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch - """, comments=""" - + Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. - - With Adwaita Manager you can: +With Adwaita Manager you can: Change any color of Adwaita theme Apply Material 3 colors from wallaper @@ -698,7 +695,7 @@ def show_about_window(self, *_args): Change advanced options with CSS Extend functionality using plugins - This app is written in Python and uses GTK 4 and libadwaita. + This app is written in Python and uses GTK 4 and libadwaita. """ ) about.present() From 0afaf852d61223ed36bbf8c4eb322dbc4e3c9397 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:55:46 +0200 Subject: [PATCH 147/149] update markups --- src/main.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main.py b/src/main.py index 1f93c3fb5..027696cd3 100644 --- a/src/main.py +++ b/src/main.py @@ -685,16 +685,15 @@ def show_about_window(self, *_args): """, comments=""" - Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. With Adwaita Manager you can: - - Change any color of Adwaita theme - Apply Material 3 colors from wallaper - Use other users presets - Change advanced options with CSS - Extend functionality using plugins - + + Change any color of Adwaita theme + Apply Material 3 colors from wallaper + Use other users presets + Change advanced options with CSS + Extend functionality using plugins + This app is written in Python and uses GTK 4 and libadwaita. """ ) From 9530bbaa83a49692b2f135661095690c17c748bd Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:56:35 +0200 Subject: [PATCH 148/149] update comments --- src/main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.py b/src/main.py index 027696cd3..e4b37a242 100644 --- a/src/main.py +++ b/src/main.py @@ -685,16 +685,16 @@ def show_about_window(self, *_args): """, comments=""" - Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. +Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. With Adwaita Manager you can: - Change any color of Adwaita theme - Apply Material 3 colors from wallaper - Use other users presets - Change advanced options with CSS - Extend functionality using plugins + - Change any color of Adwaita theme + - Apply Material 3 colors from wallaper + - Use other users presets + - Change advanced options with CSS + - Extend functionality using plugins - This app is written in Python and uses GTK 4 and libadwaita. +This app is written in Python and uses GTK 4 and libadwaita. """ ) about.present() From 9c627ec3f5812e9303bbfac90502294466b72349 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:57:13 +0200 Subject: [PATCH 149/149] update markups --- src/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index e4b37a242..acd4983cc 100644 --- a/src/main.py +++ b/src/main.py @@ -689,10 +689,10 @@ def show_about_window(self, *_args): With Adwaita Manager you can: - Change any color of Adwaita theme - - Apply Material 3 colors from wallaper - - Use other users presets - - Change advanced options with CSS - - Extend functionality using plugins + - Apply Material 3 colors from wallaper + - Use other users presets + - Change advanced options with CSS + - Extend functionality using plugins This app is written in Python and uses GTK 4 and libadwaita. """
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 sp!jKhc**ke5dMpW&Ger) Date: Thu, 11 Aug 2022 11:29:51 +0200 Subject: [PATCH 064/149] use local file --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index d162543b7..31be453cf 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -57,7 +57,7 @@ ], "sources": [ { - "type": "url", + "type": "file", "path": "./monet/material_color_utilities_python-0.1.0-py3-none-any.whl", "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" } From 4d74bc5cf92bbe1813f5b1e6e5e0e51a72558831 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 11:49:04 +0200 Subject: [PATCH 065/149] add tone row --- src/window.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 3a705f98a..11b6724fc 100644 --- a/src/window.py +++ b/src/window.py @@ -81,11 +81,16 @@ def on_file_picker_button_clicked(self, *args): def on_monet_file_chooser_response(self, widget, response): if response == Gtk.ResponseType.ACCEPT: - image_file = self.monet_file_chooser_dialog.get_file() - image_basename = image_file.get_basename() + self.monet_image_file = self.monet_file_chooser_dialog.get_file() + image_basename = self.monet_image_file.get_basename() self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() + self.monet_img = Image.open(self.monet_image_file) + self.monet_theme = themeFromImage(self.monet_img) + self.monet_palette = self.monet_theme["palette"] + self.get_application().update_theme_from_monet(self.monet_theme) + def setup_monet_page(self): @@ -126,6 +131,10 @@ def setup_monet_page(self): self.content_monet.add(monet_pref_group) + self.tone_row = Adw.ComboRow() + self.tone_row.set_title(_("Tone")) + print(dir(self.tone_row)) + def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() for app_type in settings_schema["custom_css_app_types"]: From aad88ff496f9aa86a198cc763b40fb002d9356aa Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:03:21 +0200 Subject: [PATCH 066/149] add tone row --- src/window.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 11b6724fc..19122fad4 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] - self.get_application().update_theme_from_monet(self.monet_theme) + #self.get_application().update_theme_from_monet(self.monet_theme, self.tone_row.get_selected_item()) def setup_monet_page(self): @@ -133,6 +133,22 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) + + store = Gtk.ListStore(str) + store_values = [ + "1", + "5", + "10", + "15", + "20", + "25", + "United Kingdom", + "United States of America", + "Uruguay", + ] + for v in store_values: + store.append([v]) + self.tone_row.set_list_factory(store) print(dir(self.tone_row)) def setup_plugins_page(self): From 07e22ed96ec3235362fe97b9eba18dc42d3e7607 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:04:09 +0200 Subject: [PATCH 067/149] update list factory --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 19122fad4..f84a5318a 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListStore(str) + store = Gtk.ListItemFactory(str) store_values = [ "1", "5", From e1ff0aa84875576437f24bf4eb582d27a9d37b03 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:04:34 +0200 Subject: [PATCH 068/149] fix bug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index f84a5318a..8353a828f 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListItemFactory(str) + store = Gtk.ListItemFactory() store_values = [ "1", "5", From ce2067fd00189e92983b24011ea4127c983e9300 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:05:14 +0200 Subject: [PATCH 069/149] add debug info --- src/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window.py b/src/window.py index 8353a828f..7bc102f3e 100644 --- a/src/window.py +++ b/src/window.py @@ -135,6 +135,7 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.ListItemFactory() + print(dir(store)) store_values = [ "1", "5", From 11448c487a8b9a63e843163b5332e1438e99268b Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:06:23 +0200 Subject: [PATCH 070/149] update tone row --- src/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 7bc102f3e..a99b42d00 100644 --- a/src/window.py +++ b/src/window.py @@ -147,8 +147,7 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - for v in store_values: - store.append([v]) + store.set_data(store_values) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From c81d7af57511aa01501975cab814d9d510c70e0d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:07:34 +0200 Subject: [PATCH 071/149] update tone row --- src/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index a99b42d00..0e61c581d 100644 --- a/src/window.py +++ b/src/window.py @@ -147,7 +147,8 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - store.set_data(store_values) + store.replace_qdata(store_values) + store.replace_data(store_values) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From 352ae0c33575f76f96b6c8371f7aa79153cafcef Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:09:18 +0200 Subject: [PATCH 072/149] use GtkStringList --- src/window.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/window.py b/src/window.py index 0e61c581d..b35550b53 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListItemFactory() + store = Gtk.StringList() print(dir(store)) store_values = [ "1", @@ -147,8 +147,8 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - store.replace_qdata(store_values) - store.replace_data(store_values) + for v in store_values: + store.append([v]) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From c50cb8d000238e685bab787f1ad7518763088934 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:09:42 +0200 Subject: [PATCH 073/149] fix error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b35550b53..b28bac1d1 100644 --- a/src/window.py +++ b/src/window.py @@ -148,7 +148,7 @@ def setup_monet_page(self): "Uruguay", ] for v in store_values: - store.append([v]) + store.append(v) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From 5744873bb80e64db6949e5ac5bff2e2f9a2df308 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:10:26 +0200 Subject: [PATCH 074/149] use set_model --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b28bac1d1..258025af3 100644 --- a/src/window.py +++ b/src/window.py @@ -149,7 +149,7 @@ def setup_monet_page(self): ] for v in store_values: store.append(v) - self.tone_row.set_list_factory(store) + self.tone_row.set_model(store) print(dir(self.tone_row)) def setup_plugins_page(self): From 35f78ffb9cfdbac53cd1468e2eb3ab99dc17db9c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:11:07 +0200 Subject: [PATCH 075/149] add tone row to the page --- src/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 258025af3..434c417a6 100644 --- a/src/window.py +++ b/src/window.py @@ -135,7 +135,6 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - print(dir(store)) store_values = [ "1", "5", @@ -150,7 +149,7 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - print(dir(self.tone_row)) + self.content_monet.add(self.tone_row) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From d3d5c3987e153922a51467b62499900a522b5895 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:11:47 +0200 Subject: [PATCH 076/149] update pref group --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 434c417a6..7ce2b1cf8 100644 --- a/src/window.py +++ b/src/window.py @@ -129,7 +129,6 @@ def setup_monet_page(self): self.palette_picker.add_suffix(picker) monet_pref_group.add(self.palette_picker) - self.content_monet.add(monet_pref_group) self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) @@ -149,7 +148,8 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - self.content_monet.add(self.tone_row) + monet_pref_group.add(self.tone_row) + self.content_monet.add(monet_pref_group) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From 7c50a5dc38c068761ecb9e509f6a62b7e301988e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:19:28 +0200 Subject: [PATCH 077/149] set colorpalette --- src/window.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/window.py b/src/window.py index 7ce2b1cf8..4ae21ec71 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,25 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] - #self.get_application().update_theme_from_monet(self.monet_theme, self.tone_row.get_selected_item()) + self.tone = self.tone_row.get_selected_item() + + i = 0 + """ + {'primary': , + 'secondary': , + 'tertiary': , + 'neutral': , + 'neutralVariant': , + 'error': } + """ + print(self.monet_palette) + print(self.monet_theme) + for color in self.monet_palette.values(): + i+=1 + color = color.tone(self.tone) + self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + + #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): @@ -119,7 +137,7 @@ def setup_monet_page(self): self.palette_picker.set_title(_("Monet Palette")) self.palette_picker self.palette_pickers = {} - for i in range(5): + for i in range(6): i = i+1 picker = Gtk.ColorButton() picker.set_name(str(i)) @@ -141,9 +159,7 @@ def setup_monet_page(self): "15", "20", "25", - "United Kingdom", - "United States of America", - "Uruguay", + "30" ] for v in store_values: store.append(v) From b2a5ddd77d5096076242d8cf9192f9079b8181ae Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:20:34 +0200 Subject: [PATCH 078/149] add debug --- src/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window.py b/src/window.py index 4ae21ec71..b554ae472 100644 --- a/src/window.py +++ b/src/window.py @@ -86,6 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() + dir(self.monet_img) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From 26a74fe18f7075f6733f52b76da136449ff534db Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:21:09 +0200 Subject: [PATCH 079/149] fix bug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b554ae472..fb291e46c 100644 --- a/src/window.py +++ b/src/window.py @@ -86,7 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - dir(self.monet_img) + dir(self.monet_image_file) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From f3755eb8a1dc1dc32a0820af5b3ae53cbba5a0da Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:21:48 +0200 Subject: [PATCH 080/149] print debug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index fb291e46c..de17ed356 100644 --- a/src/window.py +++ b/src/window.py @@ -86,7 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - dir(self.monet_image_file) + print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From dbff368414eb89e07e9d65a284aad21806b23ef0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:24:58 +0200 Subject: [PATCH 081/149] use path instead of g object --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index de17ed356..83dec7b83 100644 --- a/src/window.py +++ b/src/window.py @@ -87,7 +87,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() print(dir(self.monet_image_file)) - self.monet_img = Image.open(self.monet_image_file) + self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] self.tone = self.tone_row.get_selected_item() From 028bad472421942cd85ece601bfe80362dfccb8e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:25:47 +0200 Subject: [PATCH 082/149] fix typo error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 83dec7b83..4780fa299 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,7 @@ def on_monet_file_chooser_response(self, widget, response): print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) - self.monet_palette = self.monet_theme["palette"] + self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() i = 0 From d1aa1a93cd637ad3b5cdb7a573c21a5e2e459c29 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:27:07 +0200 Subject: [PATCH 083/149] convert into int --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 4780fa299..4f5d6a4c8 100644 --- a/src/window.py +++ b/src/window.py @@ -86,11 +86,11 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() + print(dir(self.tone)) i = 0 """ @@ -105,7 +105,7 @@ def on_monet_file_chooser_response(self, widget, response): print(self.monet_theme) for color in self.monet_palette.values(): i+=1 - color = color.tone(self.tone) + color = color.tone(int(self.tone)) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) From d08f4acba7bd2fa80014900ad50437f8b8b3df31 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:28:31 +0200 Subject: [PATCH 084/149] fix error --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 4f5d6a4c8..275917824 100644 --- a/src/window.py +++ b/src/window.py @@ -90,7 +90,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - print(dir(self.tone)) + print(dir(self.tone.get_string())) i = 0 """ @@ -105,7 +105,7 @@ def on_monet_file_chooser_response(self, widget, response): print(self.monet_theme) for color in self.monet_palette.values(): i+=1 - color = color.tone(int(self.tone)) + color = color.tone(int(self.tone.get_string())) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) From 20d21ba39cd6a7c521ba1004e13a1f550b1bd4f5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:29:49 +0200 Subject: [PATCH 085/149] print debug --- src/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 275917824..866929fe4 100644 --- a/src/window.py +++ b/src/window.py @@ -90,7 +90,6 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - print(dir(self.tone.get_string())) i = 0 """ @@ -106,8 +105,10 @@ def on_monet_file_chooser_response(self, widget, response): for color in self.monet_palette.values(): i+=1 color = color.tone(int(self.tone.get_string())) + print(color) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + self.palette_pickers["1"].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): From fd5e7ac4994d76520564c938527751523d7b26bb Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:38:57 +0200 Subject: [PATCH 086/149] add toast when reset --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index e94f41da8..3b2e0e9a2 100644 --- a/src/main.py +++ b/src/main.py @@ -433,6 +433,7 @@ def reset_color_scheme(self, widget, response): file.delete() except Exception: pass + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( From 071bcaf2145fbdd43adb394cd8083e9ebf43dfff Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:44:22 +0200 Subject: [PATCH 087/149] update palette --- src/window.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/window.py b/src/window.py index 866929fe4..0c2b77390 100644 --- a/src/window.py +++ b/src/window.py @@ -102,22 +102,33 @@ def on_monet_file_chooser_response(self, widget, response): """ print(self.monet_palette) print(self.monet_theme) + self.monet_pref_group.remove(self.palette_picker) + + self.palette_picker = Adw.ActionRow() + self.palette_picker.set_name("monet_palette") + self.palette_picker.set_title(_("Monet Palette")) + self.palette_picker + self.palette_pickers = {} + i = 0 for color in self.monet_palette.values(): - i+=1 + i = i+1 + picker = Gtk.ColorButton() + picker.set_name(str(i)) color = color.tone(int(self.tone.get_string())) - print(color) - self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) - - self.palette_pickers["1"].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + picker.set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + picker.set_valign(Gtk.Align.CENTER) + self.palette_pickers[str(i)] = picker + self.palette_picker.add_suffix(picker) + self.monet_pref_group.add(self.palette_picker) #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): - monet_pref_group = Adw.PreferencesGroup() - monet_pref_group.set_name("monet") - monet_pref_group.set_title(_("Monet Engine")) - monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + self.monet_pref_group = Adw.PreferencesGroup() + self.monet_pref_group.set_name("monet") + self.monet_pref_group.set_title(_("Monet Engine")) + self.monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -132,7 +143,7 @@ def setup_monet_page(self): self.monet_file_chooser_button.connect("clicked", self.on_file_picker_button_clicked ) self.monet_file_chooser_dialog.connect("response", self.on_monet_file_chooser_response ) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) - monet_pref_group.add(self.monet_file_chooser_row) + self.monet_pref_group.add(self.monet_file_chooser_row) self.palette_picker = Adw.ActionRow() self.palette_picker.set_name("monet_palette") @@ -147,7 +158,7 @@ def setup_monet_page(self): picker.set_valign(Gtk.Align.CENTER) self.palette_pickers[str(i)] = picker self.palette_picker.add_suffix(picker) - monet_pref_group.add(self.palette_picker) + self.monet_pref_group.add(self.palette_picker) self.tone_row = Adw.ComboRow() From 2257a5afeea8c505e8d005afa551eda5d0c3c41a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:45:10 +0200 Subject: [PATCH 088/149] fix bug --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 0c2b77390..07e160ed9 100644 --- a/src/window.py +++ b/src/window.py @@ -177,8 +177,8 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - monet_pref_group.add(self.tone_row) - self.content_monet.add(monet_pref_group) + self.monet_pref_group.add(self.tone_row) + self.content_monet.add(self.monet_pref_group) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From 160e46863ad81602915df718ee421f17772bca09 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:55:12 +0200 Subject: [PATCH 089/149] update tone generation --- src/main.py | 3 ++ src/window.py | 99 ++++++++++++++++----------------------------------- 2 files changed, 33 insertions(+), 69 deletions(-) diff --git a/src/main.py b/src/main.py index 3b2e0e9a2..cb961f23a 100644 --- a/src/main.py +++ b/src/main.py @@ -206,6 +206,9 @@ def load_preset_variables(self, preset): self.reload_variables() + def update_theme_from_monet(self, theme, tone): + pass + def generate_gtk_css(self, app_type): final_css = "" for key in self.variables.keys(): diff --git a/src/window.py b/src/window.py index 07e160ed9..394b64723 100644 --- a/src/window.py +++ b/src/window.py @@ -35,6 +35,7 @@ from .custom_css_group import AdwcustomizerCustomCSSGroup from material_color_utilities_python import * + @Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') class AdwcustomizerMainWindow(Adw.ApplicationWindow): __gtype_name__ = 'AdwcustomizerMainWindow' @@ -52,7 +53,8 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) - self.presets_dropdown.get_popover().connect("show", self.on_presets_dropdown_activate) + self.presets_dropdown.get_popover().connect( + "show", self.on_presets_dropdown_activate) self.setup_monet_page() self.setup_plugins_page() @@ -81,99 +83,54 @@ def on_file_picker_button_clicked(self, *args): def on_monet_file_chooser_response(self, widget, response): if response == Gtk.ResponseType.ACCEPT: - self.monet_image_file = self.monet_file_chooser_dialog.get_file() + self.monet_image_file = self.monet_file_chooser_dialog.get_file() image_basename = self.monet_image_file.get_basename() self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) - self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - - i = 0 - """ - {'primary': , - 'secondary': , - 'tertiary': , - 'neutral': , - 'neutralVariant': , - 'error': } - """ - print(self.monet_palette) - print(self.monet_theme) - self.monet_pref_group.remove(self.palette_picker) - - self.palette_picker = Adw.ActionRow() - self.palette_picker.set_name("monet_palette") - self.palette_picker.set_title(_("Monet Palette")) - self.palette_picker - self.palette_pickers = {} - i = 0 - for color in self.monet_palette.values(): - i = i+1 - picker = Gtk.ColorButton() - picker.set_name(str(i)) - color = color.tone(int(self.tone.get_string())) - picker.set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) - picker.set_valign(Gtk.Align.CENTER) - self.palette_pickers[str(i)] = picker - self.palette_picker.add_suffix(picker) - self.monet_pref_group.add(self.palette_picker) - #self.get_application().update_theme_from_monet(self.monet_theme) + self.get_application().update_theme_from_monet(self.monet_theme, self.tone) def setup_monet_page(self): - self.monet_pref_group = Adw.PreferencesGroup() self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) - self.monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + self.monet_pref_group.set_description( + _("Monet is an engine that generates Material Design 3 palette from backgrounds color")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) - + self.monet_file_chooser_dialog = Gtk.FileChooserNative() self.monet_file_chooser_dialog.set_transient_for(self) self.monet_file_chooser_button = Gtk.Button() self.monet_file_chooser_button.set_label(_("Choose a file")) - self.monet_file_chooser_button.set_icon_name("folder-pictures-symbolic") + self.monet_file_chooser_button.set_icon_name( + "folder-pictures-symbolic") - self.monet_file_chooser_button.connect("clicked", self.on_file_picker_button_clicked ) - self.monet_file_chooser_dialog.connect("response", self.on_monet_file_chooser_response ) + self.monet_file_chooser_button.connect( + "clicked", self.on_file_picker_button_clicked) + self.monet_file_chooser_dialog.connect( + "response", self.on_monet_file_chooser_response) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) self.monet_pref_group.add(self.monet_file_chooser_row) - self.palette_picker = Adw.ActionRow() - self.palette_picker.set_name("monet_palette") - self.palette_picker.set_title(_("Monet Palette")) - self.palette_picker - self.palette_pickers = {} - for i in range(6): - i = i+1 - picker = Gtk.ColorButton() - picker.set_name(str(i)) - picker.set_rgba(Gdk.RGBA(red=0, green=0, blue=0, alpha=0)) - picker.set_valign(Gtk.Align.CENTER) - self.palette_pickers[str(i)] = picker - self.palette_picker.add_suffix(picker) + self.monet_palette_shades = AdwcustomizerPaletteShades("monet", + "Monet Palette", + 6) self.monet_pref_group.add(self.palette_picker) - self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - store_values = [ - "1", - "5", - "10", - "15", - "20", - "25", - "30" - ] + store_values = ["1"] + for i in range(5, 100, 5): + store_values.append(str(i)) for v in store_values: store.append(v) self.tone_row.set_model(store) @@ -198,26 +155,29 @@ def setup_colors_page(self): for variable in group["variables"]: pref_variable = AdwcustomizerOption(variable["name"], variable["title"], - variable.get("explanation"), + variable.get( + "explanation"), variable["adw_gtk3_support"]) pref_group.add(pref_variable) - self.get_application().pref_variables[variable["name"]] = pref_variable + self.get_application( + ).pref_variables[variable["name"]] = pref_variable self.content.add(pref_group) palette_pref_group = Adw.PreferencesGroup() palette_pref_group.set_name("palette_colors") palette_pref_group.set_title(_("Palette Colors")) - palette_pref_group.set_description(_("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) + palette_pref_group.set_description( + _("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) for color in settings_schema["palette"]: palette_shades = AdwcustomizerPaletteShades(color["prefix"], color["title"], color["n_shades"]) palette_pref_group.add(palette_shades) - self.get_application().pref_palette_shades[color["prefix"]] = palette_shades + self.get_application( + ).pref_palette_shades[color["prefix"]] = palette_shades self.content.add(palette_pref_group) - def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) while child is not None: @@ -225,7 +185,8 @@ def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) self.errors_button.set_visible(len(errors) > 0) for error in errors: - self.errors_list.append(AdwcustomizerError(error["error"], error["element"], error["line"])) + self.errors_list.append(AdwcustomizerError( + error["error"], error["element"], error["line"])) def on_presets_dropdown_activate(self, *args): self.get_application().reload_user_defined_presets() From 5d6f4697e512f1016f194709edbd054e00694e87 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:55:49 +0200 Subject: [PATCH 090/149] fix error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 394b64723..67ca2771b 100644 --- a/src/window.py +++ b/src/window.py @@ -122,7 +122,7 @@ def setup_monet_page(self): self.monet_palette_shades = AdwcustomizerPaletteShades("monet", "Monet Palette", 6) - self.monet_pref_group.add(self.palette_picker) + self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) From 93f07e1ff673d3c187ddc776cc3fef445807cd58 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:57:29 +0200 Subject: [PATCH 091/149] add 0xMRTT as translator --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index cb961f23a..a8671c20e 100644 --- a/src/main.py +++ b/src/main.py @@ -449,8 +449,8 @@ def show_about_window(self, *_args): issue_url="https://github.com/AdwCustomizerTeam/AdwCustomizer/issues", developers=[ 'Artyom "ArtyIF" Fomin https://github.com/ArtyIF', - "Verantor https://github.com/Verantor", "0xMRTT https://github.com/0xMRTT", + "Verantor https://github.com/Verantor", ], artists=[ 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' @@ -466,6 +466,7 @@ def show_about_window(self, *_args): Renato Corrêa https://www.transifex.com/user/profile/renatocrrs/ Aggelos Tselios https://www.transifex.com/user/profile/AndroGR/ David "Daudix UFO" Lapshin https://github.com/daudix-UFO' + 0xMRTT https://github.com/0xMRTT Juanjo Cillero https://www.transifex.com/user/profile/renux918/ Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", From f390b01cda4ac7e39caccb1433dcca37a8dc9ec4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 13:02:13 +0200 Subject: [PATCH 092/149] remove PR --- .github/workflows/flatpak-nightly.yml | 1 - .github/workflows/flatpak.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index e05befe07..fa297f23a 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -2,7 +2,6 @@ name: Build flatpak nightly on: push: branches: [next] - pull_request: jobs: flatpak: name: "Flatpak" diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 8d1b02d48..69360a41c 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -2,7 +2,6 @@ name: Build flatpak on: push: branches: [main] - pull_request: jobs: flatpak: name: "Flatpak" From 9aae287cb07333be89d0374f74bed067f8a56366 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:22:08 +0200 Subject: [PATCH 093/149] use palette shades --- src/main.py | 11 ++++++++++- src/window.py | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a8671c20e..f4c360cdd 100644 --- a/src/main.py +++ b/src/main.py @@ -26,6 +26,7 @@ import gi from gi.repository import Gtk, Gdk, Gio, Adw, GLib, Xdp, XdpGtk4 +from material_color_utilities_python import * from .settings_schema import settings_schema from .window import AdwcustomizerMainWindow @@ -207,7 +208,15 @@ def load_preset_variables(self, preset): self.reload_variables() def update_theme_from_monet(self, theme, tone): - pass + palettes = theme["palettes"] + + palette = {} + i = 0 + for color in palettes.values(): + i += 1 + palette[str(i)] = hexFromArgb(color.tone(tone)) + + self.pref_palette_shades["monet"].update_shades() def generate_gtk_css(self, app_type): final_css = "" diff --git a/src/window.py b/src/window.py index 67ca2771b..b92e6eeed 100644 --- a/src/window.py +++ b/src/window.py @@ -122,6 +122,8 @@ def setup_monet_page(self): self.monet_palette_shades = AdwcustomizerPaletteShades("monet", "Monet Palette", 6) + self.get_application( + ).pref_palette_shades["monet"] = self.monet_palette_shades self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() From 91d7e5f7bb578df08e07bcb1e326e332b8a108bc Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:23:31 +0200 Subject: [PATCH 094/149] fix error --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index f4c360cdd..274dae147 100644 --- a/src/main.py +++ b/src/main.py @@ -214,7 +214,7 @@ def update_theme_from_monet(self, theme, tone): i = 0 for color in palettes.values(): i += 1 - palette[str(i)] = hexFromArgb(color.tone(tone)) + palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) self.pref_palette_shades["monet"].update_shades() From c98f8df6101f5fad3639dc9f3423073d85837eac Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:24:16 +0200 Subject: [PATCH 095/149] add missin arg --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 274dae147..fbaf678a4 100644 --- a/src/main.py +++ b/src/main.py @@ -216,7 +216,7 @@ def update_theme_from_monet(self, theme, tone): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) - self.pref_palette_shades["monet"].update_shades() + self.pref_palette_shades["monet"].update_shades(palette) def generate_gtk_css(self, app_type): final_css = "" From 3ad2ebc2586d394dcb40e421a4270512f7f36226 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:25:48 +0200 Subject: [PATCH 096/149] add debug --- src/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.py b/src/main.py index fbaf678a4..ff7dceddf 100644 --- a/src/main.py +++ b/src/main.py @@ -216,6 +216,8 @@ def update_theme_from_monet(self, theme, tone): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) + print(palette) + self.pref_palette_shades["monet"].update_shades(palette) def generate_gtk_css(self, app_type): From b26d9a8df76e83ad27f41280a857f60f40273644 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:45:45 +0200 Subject: [PATCH 097/149] remove tone 1 --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b92e6eeed..efc166bea 100644 --- a/src/window.py +++ b/src/window.py @@ -130,7 +130,7 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - store_values = ["1"] + store_values = [] for i in range(5, 100, 5): store_values.append(str(i)) for v in store_values: From d5bce25c1e699e947049bfa4af0c4e1159fa006d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:55:00 +0200 Subject: [PATCH 098/149] add theme row --- src/window.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/window.py b/src/window.py index efc166bea..5bfb54f19 100644 --- a/src/window.py +++ b/src/window.py @@ -137,6 +137,16 @@ def setup_monet_page(self): store.append(v) self.tone_row.set_model(store) self.monet_pref_group.add(self.tone_row) + + self.monet_theme_row = Adw.ComboRow() + self.monet_theme_row.set_title(_("Theme")) + + store = Gtk.StringList() + store.append("Dark") + store.append("Light") + self.monet_theme_row.set_model(store) + self.monet_pref_group.add(self.monet_theme_row) + self.content_monet.add(self.monet_pref_group) def setup_plugins_page(self): From e2c9b1717836ff21233cecb7e7b102fedc181f08 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:00:07 +0200 Subject: [PATCH 099/149] add monet theme selector --- src/main.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++- src/window.py | 3 ++- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index ff7dceddf..a37cd3993 100644 --- a/src/main.py +++ b/src/main.py @@ -207,9 +207,11 @@ def load_preset_variables(self, preset): self.reload_variables() - def update_theme_from_monet(self, theme, tone): + def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] + monet_theme = monet_theme.get_string() + palette = {} i = 0 for color in palettes.values(): @@ -220,6 +222,56 @@ def update_theme_from_monet(self, theme, tone): self.pref_palette_shades["monet"].update_shades(palette) + print(theme) + + self.variable = { + "accent_color": theme["schemes"]["light"]["primary"], + "accent_bg_color": theme["schemes"]["light"]["primaryContainer"], + "accent_fg_color": theme["schemes"]["light"]["onPrimaryContainer"], + + "destructive_color": theme["schemes"]["light"][""], + "destructive_bg_color": theme["schemes"]["light"][""], + "destructive_fg_color": theme["schemes"]["light"][""], + + "success_color": theme["schemes"]["light"][""], + "success_bg_color": theme["schemes"]["light"][""], + "success_fg_color": theme["schemes"]["light"][""], + + "warning_color": theme["schemes"]["light"][""], + "warning_bg_color": theme["schemes"]["light"][""], + "warning_fg_color": "rgba(0, 0, 0, 0.8)", + + "error_color": theme["schemes"]["light"][""], + "error_bg_color": theme["schemes"]["light"][""], + "error_fg_color": theme["schemes"]["light"][""], + + "window_bg_color": theme["schemes"]["light"][""], + "window_fg_color": theme["schemes"]["light"][""], + + "view_bg_color": theme["schemes"]["light"][""], + "view_fg_color": theme["schemes"]["light"][""], + + "headerbar_bg_color": theme["schemes"]["light"][""], + "headerbar_fg_color": "rgba(0, 0, 0, 0.8)", + "headerbar_border_color": "rgba(0, 0, 0, 0.8)", + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": "rgba(0, 0, 0, 0.07)", + + "card_bg_color": theme["schemes"]["light"][""], + "card_fg_color": "rgba(0, 0, 0, 0.8)", + "card_shade_color": "rgba(0, 0, 0, 0.07)", + + "dialog_bg_color": theme["schemes"]["light"][""], + "dialog_fg_color": "rgba(0, 0, 0, 0.8)", + + "popover_bg_color": theme["schemes"]["light"][""], + "popover_fg_color": "rgba(0, 0, 0, 0.8)", + + "shade_color": theme["schemes"]["light"][""], + "scrollbar_outline_color": theme["schemes"]["light"][""] + } + + def generate_gtk_css(self, app_type): final_css = "" for key in self.variables.keys(): diff --git a/src/window.py b/src/window.py index 5bfb54f19..d38272320 100644 --- a/src/window.py +++ b/src/window.py @@ -91,7 +91,8 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() - self.get_application().update_theme_from_monet(self.monet_theme, self.tone) + self.monet_theme = self.monet_theme_row.get_selected_item() + self.get_application().update_theme_from_monet(self.monet_theme, self.tone, self.monet_theme) def setup_monet_page(self): From d2bde49e06d23a38d29d181bd8d80c38e56e9f68 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:00:33 +0200 Subject: [PATCH 100/149] add debug info --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index a37cd3993..c0d609958 100644 --- a/src/main.py +++ b/src/main.py @@ -222,6 +222,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): self.pref_palette_shades["monet"].update_shades(palette) + print(monet_theme) print(theme) self.variable = { From 47c4218523062b457958d1a3048eca133d6084fa Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:03:57 +0200 Subject: [PATCH 101/149] fix duplicated name --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index d38272320..08e14604d 100644 --- a/src/window.py +++ b/src/window.py @@ -89,10 +89,10 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() self.monet_img = Image.open(self.monet_image_file.get_path()) - self.monet_theme = themeFromImage(self.monet_img) + self.theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.monet_theme, self.tone, self.monet_theme) + self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) def setup_monet_page(self): From f5f8580b2e1a5ba31ea2dc6079ff7dcc1a498705 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:39:31 +0200 Subject: [PATCH 102/149] add automatic theme generation. Need test --- src/main.py | 137 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 101 insertions(+), 36 deletions(-) diff --git a/src/main.py b/src/main.py index c0d609958..314d21aeb 100644 --- a/src/main.py +++ b/src/main.py @@ -207,10 +207,22 @@ def load_preset_variables(self, preset): self.reload_variables() + + def rgba_from_argb(self, argb, alpha = None) -> str: + base = "rgba({}, {}, {}, {})" + + red = redFromArgb(argb) + green = greenFromArgb(argb) + blue = blueFromArgb(argb) + if not alpha: + alpha = alphaFromArgb(argb) + + return base.format(red, green, blue, alpha) + def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] - monet_theme = monet_theme.get_string() + monet_theme = monet_theme.get_string().lower() # dark / light palette = {} i = 0 @@ -225,53 +237,106 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(monet_theme) print(theme) - self.variable = { - "accent_color": theme["schemes"]["light"]["primary"], - "accent_bg_color": theme["schemes"]["light"]["primaryContainer"], - "accent_fg_color": theme["schemes"]["light"]["onPrimaryContainer"], + if monet_theme == "dark": + dark_theme = theme["schemes"]["dark"].toJSON() + self.variable = { + "accent_color": dark_theme["primary"], + "accent_bg_color": dark_theme["primaryContainer"], + "accent_fg_color": dark_theme["onPrimaryContainer"], + + "destructive_color": dark_theme["error"], + "destructive_bg_color": dark_theme["errorContainer"], + "destructive_fg_color": dark_theme["onError"], + + "success_color": dark_theme["tertiary"], + "success_bg_color": dark_theme["onTertiary"], + "success_fg_color": dark_theme["tertiaryContainer"], + + "warning_color": dark_theme["secondaryContainer"], + "warning_bg_color": dark_theme["inversePrimary"], + "warning_fg_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + + "error_color": dark_theme["error"], + "error_bg_color": dark_theme["errorContainer"], + "error_fg_color": dark_theme["onError"], + + "window_bg_color": dark_theme["surface"], + "window_fg_color": dark_theme["onSurface"], - "destructive_color": theme["schemes"]["light"][""], - "destructive_bg_color": theme["schemes"]["light"][""], - "destructive_fg_color": theme["schemes"]["light"][""], + "view_bg_color": dark_theme["surface"], + "view_fg_color": dark_theme["onSurface"], - "success_color": theme["schemes"]["light"][""], - "success_bg_color": theme["schemes"]["light"][""], - "success_fg_color": theme["schemes"]["light"][""], + "headerbar_bg_color": dark_theme["surface"], + "headerbar_fg_color": dark_theme["onSurface"], + "headerbar_border_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": dark_theme["shadow"], - "warning_color": theme["schemes"]["light"][""], - "warning_bg_color": theme["schemes"]["light"][""], - "warning_fg_color": "rgba(0, 0, 0, 0.8)", + "card_bg_color": self.rgba_from_argb(dark_theme["primary"], "0.05"), + "card_fg_color": dark_theme["surfaceVariant"], + "card_shade_color": dark_theme["shadow"], - "error_color": theme["schemes"]["light"][""], - "error_bg_color": theme["schemes"]["light"][""], - "error_fg_color": theme["schemes"]["light"][""], + "dialog_bg_color": dark_theme["secondaryContainer"], + "dialog_fg_color": dark_theme["onSecondaryContainer"], - "window_bg_color": theme["schemes"]["light"][""], - "window_fg_color": theme["schemes"]["light"][""], + "popover_bg_color": dark_theme["secondaryContainer"], + "popover_fg_color": dark_theme["onSecondaryContainer"], - "view_bg_color": theme["schemes"]["light"][""], - "view_fg_color": theme["schemes"]["light"][""], + "shade_color": dark_theme["shadow"], + "scrollbar_outline_color": dark_theme["outline"] + } + else: # light + light_theme = theme["schemes"]["light"].toJSON() + self.variable = { + "accent_color": light_theme["primary"], + "accent_bg_color": light_theme["primaryContainer"], + "accent_fg_color": light_theme["onPrimaryContainer"], - "headerbar_bg_color": theme["schemes"]["light"][""], - "headerbar_fg_color": "rgba(0, 0, 0, 0.8)", - "headerbar_border_color": "rgba(0, 0, 0, 0.8)", - "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": "rgba(0, 0, 0, 0.07)", + "destructive_color": light_theme["error"], + "destructive_bg_color": light_theme["errorContainer"], + "destructive_fg_color": light_theme["onError"], - "card_bg_color": theme["schemes"]["light"][""], - "card_fg_color": "rgba(0, 0, 0, 0.8)", - "card_shade_color": "rgba(0, 0, 0, 0.07)", + "success_color": light_theme["tertiary"], + "success_bg_color": light_theme["onTertiary"], + "success_fg_color": light_theme["tertiaryContainer"], - "dialog_bg_color": theme["schemes"]["light"][""], - "dialog_fg_color": "rgba(0, 0, 0, 0.8)", + "warning_color": light_theme["secondaryContainer"], + "warning_bg_color": light_theme["inversePrimary"], + "warning_fg_color": self.rgba_from_argb(light_theme["primary"], "0.8"), - "popover_bg_color": theme["schemes"]["light"][""], - "popover_fg_color": "rgba(0, 0, 0, 0.8)", + "error_color": light_theme["error"], + "error_bg_color": light_theme["errorContainer"], + "error_fg_color": light_theme["onError"], - "shade_color": theme["schemes"]["light"][""], - "scrollbar_outline_color": theme["schemes"]["light"][""] - } + "window_bg_color": light_theme["surface"], + "window_fg_color": light_theme["onSurface"], + "view_bg_color": light_theme["surface"], + "view_fg_color": light_theme["onSurface"], + + "headerbar_bg_color": light_theme["surface"], + "headerbar_fg_color": light_theme["onSurface"], + "headerbar_border_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": light_theme["shadow"], + + "card_bg_color": self.rgba_from_argb(light_theme["primary"], "0.05"), + "card_fg_color": light_theme["surfaceVariant"], + "card_shade_color": light_theme["shadow"], + + "dialog_bg_color": light_theme["secondaryContainer"], + "dialog_fg_color": light_theme["onSecondaryContainer"], + + "popover_bg_color": light_theme["secondaryContainer"], + "popover_fg_color": light_theme["onSecondaryContainer"], + + "shade_color": light_theme["shadow"], + "scrollbar_outline_color": light_theme["outline"] + } + + for key in self.variables.keys(): + if key in self.pref_variables: + self.pref_variables[key].update_value(self.variables[key]) def generate_gtk_css(self, app_type): final_css = "" From eb52f52fbb6c7fe4dc92771af839a39776c0e840 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:41:46 +0200 Subject: [PATCH 103/149] fix error --- src/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 314d21aeb..9e08e3b0d 100644 --- a/src/main.py +++ b/src/main.py @@ -239,7 +239,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"].toJSON() - self.variable = { + variable = { "accent_color": dark_theme["primary"], "accent_bg_color": dark_theme["primaryContainer"], "accent_fg_color": dark_theme["onPrimaryContainer"], @@ -287,7 +287,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): } else: # light light_theme = theme["schemes"]["light"].toJSON() - self.variable = { + variable = { "accent_color": light_theme["primary"], "accent_bg_color": light_theme["primaryContainer"], "accent_fg_color": light_theme["onPrimaryContainer"], @@ -334,9 +334,9 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "scrollbar_outline_color": light_theme["outline"] } - for key in self.variables.keys(): + for key in variables.keys(): if key in self.pref_variables: - self.pref_variables[key].update_value(self.variables[key]) + self.pref_variables[key].update_value(variables[key]) def generate_gtk_css(self, app_type): final_css = "" From 8c25c94e9545968462508b63e50772cff267050c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:44:12 +0200 Subject: [PATCH 104/149] add reload --- src/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.py b/src/main.py index 9e08e3b0d..0dab116bd 100644 --- a/src/main.py +++ b/src/main.py @@ -337,6 +337,8 @@ def update_theme_from_monet(self, theme, tone, monet_theme): for key in variables.keys(): if key in self.pref_variables: self.pref_variables[key].update_value(variables[key]) + + self.reload_variables() def generate_gtk_css(self, app_type): final_css = "" From aada5ae201fd69e6ec9a7e8458eda551b912f6f0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:46:00 +0200 Subject: [PATCH 105/149] add conditon --- src/window.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/window.py b/src/window.py index 08e14604d..205942adc 100644 --- a/src/window.py +++ b/src/window.py @@ -88,11 +88,12 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - self.monet_img = Image.open(self.monet_image_file.get_path()) - self.theme = themeFromImage(self.monet_img) - self.tone = self.tone_row.get_selected_item() - self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) + if response == Gtk.ResponseType.ACCEPT: + self.monet_img = Image.open(self.monet_image_file.get_path()) + self.theme = themeFromImage(self.monet_img) + self.tone = self.tone_row.get_selected_item() + self.monet_theme = self.monet_theme_row.get_selected_item() + self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) def setup_monet_page(self): From df673661572dccafe6ee7d0aad165b7e7905d29c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:57:41 +0200 Subject: [PATCH 106/149] fix error --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 0dab116bd..4089c2bb2 100644 --- a/src/main.py +++ b/src/main.py @@ -240,7 +240,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"].toJSON() variable = { - "accent_color": dark_theme["primary"], + "accent_color": dark_theme.primary, "accent_bg_color": dark_theme["primaryContainer"], "accent_fg_color": dark_theme["onPrimaryContainer"], @@ -334,9 +334,9 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "scrollbar_outline_color": light_theme["outline"] } - for key in variables.keys(): + for key in variable.keys(): if key in self.pref_variables: - self.pref_variables[key].update_value(variables[key]) + self.pref_variables[key].update_value(variable[key]) self.reload_variables() From 686035177b84911702658937f9e43bcbee7e2173 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:58:53 +0200 Subject: [PATCH 107/149] fix bug --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 4089c2bb2..a8870f66b 100644 --- a/src/main.py +++ b/src/main.py @@ -238,11 +238,11 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(theme) if monet_theme == "dark": - dark_theme = theme["schemes"]["dark"].toJSON() + dark_theme = theme["schemes"]["dark"] variable = { "accent_color": dark_theme.primary, - "accent_bg_color": dark_theme["primaryContainer"], - "accent_fg_color": dark_theme["onPrimaryContainer"], + "accent_bg_color": dark_theme.primaryContainer, + "accent_fg_color": dark_theme.onPrimaryContainer, "destructive_color": dark_theme["error"], "destructive_bg_color": dark_theme["errorContainer"], From a4f48a11b44b4d988423015097f967923932c390 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:03:34 +0200 Subject: [PATCH 108/149] update dark sheme --- src/main.py | 60 ++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/main.py b/src/main.py index a8870f66b..143e5d934 100644 --- a/src/main.py +++ b/src/main.py @@ -244,49 +244,49 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_bg_color": dark_theme.primaryContainer, "accent_fg_color": dark_theme.onPrimaryContainer, - "destructive_color": dark_theme["error"], - "destructive_bg_color": dark_theme["errorContainer"], - "destructive_fg_color": dark_theme["onError"], + "destructive_color": dark_theme.error, + "destructive_bg_color": dark_theme.errorContainer, + "destructive_fg_color": dark_theme.onError, - "success_color": dark_theme["tertiary"], - "success_bg_color": dark_theme["onTertiary"], - "success_fg_color": dark_theme["tertiaryContainer"], + "success_color": dark_theme.tertiary, + "success_bg_color": dark_theme.onTertiary, + "success_fg_color": dark_theme.tertiaryContainer, - "warning_color": dark_theme["secondaryContainer"], - "warning_bg_color": dark_theme["inversePrimary"], - "warning_fg_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "warning_color": dark_theme.secondaryContainer, + "warning_bg_color": dark_theme.inversePrimary, + "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": dark_theme["error"], - "error_bg_color": dark_theme["errorContainer"], - "error_fg_color": dark_theme["onError"], + "error_color": dark_theme.error, + "error_bg_color": dark_theme.errorContainer, + "error_fg_color": dark_theme.onError, - "window_bg_color": dark_theme["surface"], - "window_fg_color": dark_theme["onSurface"], + "window_bg_color": dark_theme.surface, + "window_fg_color": dark_theme.onSurface, - "view_bg_color": dark_theme["surface"], - "view_fg_color": dark_theme["onSurface"], + "view_bg_color": dark_theme.surface, + "view_fg_color": dark_theme.onSurface, - "headerbar_bg_color": dark_theme["surface"], - "headerbar_fg_color": dark_theme["onSurface"], - "headerbar_border_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "headerbar_bg_color": dark_theme.surface, + "headerbar_fg_color": dark_theme.onSurface, + "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": dark_theme["shadow"], + "headerbar_shade_color": dark_theme.shadow, - "card_bg_color": self.rgba_from_argb(dark_theme["primary"], "0.05"), - "card_fg_color": dark_theme["surfaceVariant"], - "card_shade_color": dark_theme["shadow"], + "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), + "card_fg_color": dark_theme.surfaceVariant, + "card_shade_color": dark_theme.shadow, - "dialog_bg_color": dark_theme["secondaryContainer"], - "dialog_fg_color": dark_theme["onSecondaryContainer"], + "dialog_bg_color": dark_theme.secondaryContainer, + "dialog_fg_color": dark_theme.onSecondaryContainer, - "popover_bg_color": dark_theme["secondaryContainer"], - "popover_fg_color": dark_theme["onSecondaryContainer"], + "popover_bg_color": dark_theme.secondaryContainer, + "popover_fg_color": dark_theme.onSecondaryContainer, - "shade_color": dark_theme["shadow"], - "scrollbar_outline_color": dark_theme["outline"] + "shade_color": dark_theme.shadow, + "scrollbar_outline_color": dark_theme.outline } else: # light - light_theme = theme["schemes"]["light"].toJSON() + light_theme = theme["schemes"]["light"] variable = { "accent_color": light_theme["primary"], "accent_bg_color": light_theme["primaryContainer"], From 2382062177dc2b6be2ec8508a9adac34753d51c0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:06:55 +0200 Subject: [PATCH 109/149] convert to rgba --- src/main.py | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/main.py b/src/main.py index 143e5d934..c7231e161 100644 --- a/src/main.py +++ b/src/main.py @@ -240,50 +240,50 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"] variable = { - "accent_color": dark_theme.primary, - "accent_bg_color": dark_theme.primaryContainer, - "accent_fg_color": dark_theme.onPrimaryContainer, + "accent_color": self.rgba_from_argb(dark_theme.primary), + "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), + "accent_fg_color": self.rgba_from_argb(dark_theme.onPrimaryContainer), - "destructive_color": dark_theme.error, - "destructive_bg_color": dark_theme.errorContainer, - "destructive_fg_color": dark_theme.onError, + "destructive_color": self.rgba_from_argb(dark_theme.error), + "destructive_bg_color": self.rgba_from_argb(dark_theme.errorContainer), + "destructive_fg_color": self.rgba_from_argb(dark_theme.onError), - "success_color": dark_theme.tertiary, - "success_bg_color": dark_theme.onTertiary, - "success_fg_color": dark_theme.tertiaryContainer, + "success_color": self.rgba_from_argb(dark_theme.tertiary), + "success_bg_color": self.rgba_from_argb(dark_theme.onTertiary), + "success_fg_color": self.rgba_from_argb(dark_theme.tertiaryContainer), - "warning_color": dark_theme.secondaryContainer, - "warning_bg_color": dark_theme.inversePrimary, + "warning_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "warning_bg_color": self.rgba_from_argb(dark_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": dark_theme.error, - "error_bg_color": dark_theme.errorContainer, - "error_fg_color": dark_theme.onError, + "error_color": self.rgba_from_argb(dark_theme.error), + "error_bg_color": self.rgba_from_argb(dark_theme.errorContainer), + "error_fg_color": self.rgba_from_argb(dark_theme.onError), - "window_bg_color": dark_theme.surface, - "window_fg_color": dark_theme.onSurface, + "window_bg_color": self.rgba_from_argb(dark_theme.surface), + "window_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "view_bg_color": dark_theme.surface, - "view_fg_color": dark_theme.onSurface, + "view_bg_color": self.rgba_from_argb(dark_theme.surface), + "view_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_bg_color": dark_theme.surface, - "headerbar_fg_color": dark_theme.onSurface, + "headerbar_bg_color": self.rgba_from_argb(dark_theme.surface), + "headerbar_fg_color": self.rgba_from_argb(dark_theme.onSurface), "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": dark_theme.shadow, + "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), - "card_fg_color": dark_theme.surfaceVariant, - "card_shade_color": dark_theme.shadow, + "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), + "card_shade_color": self.rgba_from_argb(dark_theme.shadow), - "dialog_bg_color": dark_theme.secondaryContainer, - "dialog_fg_color": dark_theme.onSecondaryContainer, + "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "popover_bg_color": dark_theme.secondaryContainer, - "popover_fg_color": dark_theme.onSecondaryContainer, + "popover_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "popover_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "shade_color": dark_theme.shadow, - "scrollbar_outline_color": dark_theme.outline + "shade_color": self.rgba_from_argb(dark_theme.shadow), + "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) } else: # light light_theme = theme["schemes"]["light"] From 1b12e486244c38b0a0d14f59cd01be66825e4cd0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:17:35 +0200 Subject: [PATCH 110/149] update tones --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 205942adc..e5f413426 100644 --- a/src/window.py +++ b/src/window.py @@ -101,7 +101,7 @@ def setup_monet_page(self): self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) self.monet_pref_group.set_description( - _("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + _("Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -133,7 +133,7 @@ def setup_monet_page(self): store = Gtk.StringList() store_values = [] - for i in range(5, 100, 5): + for i in range(20, 80, 5): store_values.append(str(i)) for v in store_values: store.append(v) From 0324b9575947bacabbf1099c2107cd3e5491dc08 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:22:34 +0200 Subject: [PATCH 111/149] add automatic preset load --- src/main.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index c7231e161..92fa90dd4 100644 --- a/src/main.py +++ b/src/main.py @@ -96,9 +96,17 @@ def do_activate(self): self.create_action("about", self.show_about_window) self.reload_user_defined_presets() - self.load_preset_from_resource( - "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita.json" - ) + + self.style_manager = Adw.StyleManager.get_default() + + if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: + self.load_preset_from_resource( + "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" + ) + else: + self.load_preset_from_resource( + "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita.json" + ) self.win.present() From f996aeeaccec757a7cca2cadf3826a373f770b92 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:23:08 +0200 Subject: [PATCH 112/149] add debug --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index 92fa90dd4..3a430c01d 100644 --- a/src/main.py +++ b/src/main.py @@ -99,6 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() + print(self.style_manager.get_color_scheme()) if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From 7bf5edf685f16b39bc8870924be508fca5278e34 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:24:40 +0200 Subject: [PATCH 113/149] add more debug --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 3a430c01d..661823e7f 100644 --- a/src/main.py +++ b/src/main.py @@ -98,8 +98,9 @@ def do_activate(self): self.reload_user_defined_presets() self.style_manager = Adw.StyleManager.get_default() - + print(dir(self.style_manager)) print(self.style_manager.get_color_scheme()) + print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From e939dcdd1722e8790964544e8665721ec61e793d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:25:41 +0200 Subject: [PATCH 114/149] fix bug --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 661823e7f..8a2c5bc14 100644 --- a/src/main.py +++ b/src/main.py @@ -99,9 +99,10 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) + print(self.style_manager.get_default()) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) - if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: + if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" ) From 004bf83923814f8d75d30179de80a9f2b12d76b5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:26:48 +0200 Subject: [PATCH 115/149] add debug --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 8a2c5bc14..e7c33d578 100644 --- a/src/main.py +++ b/src/main.py @@ -99,7 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) - print(self.style_manager.get_default()) + print(dir(self.style_manager.get_default())) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: From 3339808f0a28dd33710138e43516508069c986d0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:28:27 +0200 Subject: [PATCH 116/149] add debug --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index e7c33d578..4eceea150 100644 --- a/src/main.py +++ b/src/main.py @@ -100,6 +100,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) print(dir(self.style_manager.get_default())) + print(self.style_manager.get_default().get_color_scheme()) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: From aff7cf44f647e3d2fd89dfeabaf543c03f5f4198 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:33:27 +0200 Subject: [PATCH 117/149] fix style manager --- src/main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 4eceea150..e19935439 100644 --- a/src/main.py +++ b/src/main.py @@ -99,10 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) - print(dir(self.style_manager.get_default())) - print(self.style_manager.get_default().get_color_scheme()) - print(self.style_manager.get_color_scheme()) - print(dir(self.style_manager.get_color_scheme())) + print(self.style_manager.get_dark()) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From 8f2b40d01fe75f1ef4b3c412829d396d1f4e7568 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:34:28 +0200 Subject: [PATCH 118/149] add automatic preset choice if dark or ligjt --- src/main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index e19935439..a6578d3e4 100644 --- a/src/main.py +++ b/src/main.py @@ -98,9 +98,7 @@ def do_activate(self): self.reload_user_defined_presets() self.style_manager = Adw.StyleManager.get_default() - print(dir(self.style_manager)) - print(self.style_manager.get_dark()) - if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: + if self.style_manager.get_dark(): self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" ) From 9f222bd06e2a5db7cec0593cf79bef2e4957d300 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:37:03 +0200 Subject: [PATCH 119/149] add automatic color choice for monet --- src/main.py | 7 ++++++- src/window.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a6578d3e4..4868c1575 100644 --- a/src/main.py +++ b/src/main.py @@ -243,7 +243,12 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(monet_theme) print(theme) - + if monet_theme == "automatic": + if self.style_manager.get_dark(): + monet_theme = "dark" + else: + monet_theme = "light" + if monet_theme == "dark": dark_theme = theme["schemes"]["dark"] variable = { diff --git a/src/window.py b/src/window.py index e5f413426..1f10d3f0a 100644 --- a/src/window.py +++ b/src/window.py @@ -144,6 +144,7 @@ def setup_monet_page(self): self.monet_theme_row.set_title(_("Theme")) store = Gtk.StringList() + store.append("Automatic") store.append("Dark") store.append("Light") self.monet_theme_row.set_model(store) From 28e6218038ed4f67c50b67d3bc350d704a748c76 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:39:34 +0200 Subject: [PATCH 120/149] update light theme scheme --- src/main.py | 64 ++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/main.py b/src/main.py index 4868c1575..6aa3b4843 100644 --- a/src/main.py +++ b/src/main.py @@ -300,50 +300,50 @@ def update_theme_from_monet(self, theme, tone, monet_theme): else: # light light_theme = theme["schemes"]["light"] variable = { - "accent_color": light_theme["primary"], - "accent_bg_color": light_theme["primaryContainer"], - "accent_fg_color": light_theme["onPrimaryContainer"], + "accent_color": self.rgba_from_argb(light_theme.primary), + "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), + "accent_fg_color": self.rgba_from_argb(light_theme.onPrimaryContainer), - "destructive_color": light_theme["error"], - "destructive_bg_color": light_theme["errorContainer"], - "destructive_fg_color": light_theme["onError"], + "destructive_color": self.rgba_from_argb(light_theme.error), + "destructive_bg_color": self.rgba_from_argb(light_theme.errorContainer), + "destructive_fg_color": self.rgba_from_argb(light_theme.onError), - "success_color": light_theme["tertiary"], - "success_bg_color": light_theme["onTertiary"], - "success_fg_color": light_theme["tertiaryContainer"], + "success_color": self.rgba_from_argb(light_theme.tertiary), + "success_bg_color": self.rgba_from_argb(light_theme.onTertiary), + "success_fg_color": self.rgba_from_argb(light_theme.tertiaryContainer), - "warning_color": light_theme["secondaryContainer"], - "warning_bg_color": light_theme["inversePrimary"], - "warning_fg_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "warning_color": self.rgba_from_argb(light_theme.secondaryContainer), + "warning_bg_color": self.rgba_from_argb(light_theme.inversePrimary), + "warning_fg_color": self.rgba_from_argb(light_theme.primary, "0.8"), - "error_color": light_theme["error"], - "error_bg_color": light_theme["errorContainer"], - "error_fg_color": light_theme["onError"], + "error_color": self.rgba_from_argb(light_theme.error), + "error_bg_color": self.rgba_from_argb(light_theme.errorContainer), + "error_fg_color": self.rgba_from_argb(light_theme.onError), - "window_bg_color": light_theme["surface"], - "window_fg_color": light_theme["onSurface"], + "window_bg_color": self.rgba_from_argb(light_theme.surface), + "window_fg_color": self.rgba_from_argb(light_theme.onSurface), - "view_bg_color": light_theme["surface"], - "view_fg_color": light_theme["onSurface"], + "view_bg_color": self.rgba_from_argb(light_theme.surface), + "view_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_bg_color": light_theme["surface"], - "headerbar_fg_color": light_theme["onSurface"], - "headerbar_border_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "headerbar_bg_color": self.rgba_from_argb(light_theme.surface), + "headerbar_fg_color": self.rgba_from_argb(light_theme.onSurface), + "headerbar_border_color": self.rgba_from_argb(light_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": light_theme["shadow"], + "headerbar_shade_color": self.rgba_from_argb(light_theme.shadow), - "card_bg_color": self.rgba_from_argb(light_theme["primary"], "0.05"), - "card_fg_color": light_theme["surfaceVariant"], - "card_shade_color": light_theme["shadow"], + "card_bg_color": self.rgba_from_argb(light_theme.primary, "0.05"), + "card_fg_color": self.rgba_from_argb(light_theme.surfaceVariant), + "card_shade_color": self.rgba_from_argb(light_theme.shadow), - "dialog_bg_color": light_theme["secondaryContainer"], - "dialog_fg_color": light_theme["onSecondaryContainer"], + "dialog_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), + "dialog_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - "popover_bg_color": light_theme["secondaryContainer"], - "popover_fg_color": light_theme["onSecondaryContainer"], + "popover_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), + "popover_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - "shade_color": light_theme["shadow"], - "scrollbar_outline_color": light_theme["outline"] + "shade_color": self.rgba_from_argb(light_theme.shadow), + "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline) } for key in variable.keys(): From 8e51c880acbddaf88d0f68b1940931835a57e6b2 Mon Sep 17 00:00:00 2001 From: David Lapshin Date: Thu, 11 Aug 2022 17:48:22 +0300 Subject: [PATCH 121/149] Fix missing settings-symbolic & open-menu-symbolic --- src/adwcustomizer.gresource.xml | 8 ++++++-- ...thub.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg | 2 -- ...AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg | 8 ++++++++ ....AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg | 2 ++ src/ui/window.blp | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) delete mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg diff --git a/src/adwcustomizer.gresource.xml b/src/adwcustomizer.gresource.xml index dc6a30581..fa71a5932 100644 --- a/src/adwcustomizer.gresource.xml +++ b/src/adwcustomizer.gresource.xml @@ -42,11 +42,15 @@ >icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg + alias="open-menu-symbolic.svg" + >icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-fill-symbolic.svg + icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg deleted file mode 100644 index 50b8a3c4d..000000000 --- a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg new file mode 100644 index 000000000..7f4474335 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg new file mode 100644 index 000000000..408d7e5d4 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/src/ui/window.blp b/src/ui/window.blp index e9e6deb74..3b3abc816 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -47,7 +47,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { [end] Gtk.MenuButton { - icon-name: "menu-symbolic"; + icon-name: "open-menu-symbolic"; menu-model: main-menu; } From 84dda5f78d499801a49c20ed7163bfec4854f006 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:53:41 +0200 Subject: [PATCH 122/149] add switch to select dark or light apply --- src/main.py | 72 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/src/main.py b/src/main.py index 6aa3b4843..819f4dd10 100644 --- a/src/main.py +++ b/src/main.py @@ -443,7 +443,13 @@ def show_apply_color_scheme_dialog(self, *_args): Adw.ResponseAppearance.SUGGESTED, transient_for=self.props.active_window, ) - dialog.connect("response", self.apply_color_scheme) + + switch = Gtk.Switch() + print(dir(switch)) + + dialog.set_extra_child(switch) + + dialog.connect("response", self.apply_color_scheme, switch) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -534,28 +540,50 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response): + def apply_color_scheme(self, widget, response, switch): if response == "apply": - if widget.get_app_types()["gtk4"]: - gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") - if not os.path.exists(gtk4_dir): - os.makedirs(gtk4_dir) - gtk4_css = self.generate_gtk_css("gtk4") - with open( - os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8" - ) as file: - file.write(gtk4_css) - if widget.get_app_types()["gtk3"]: - gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") - if not os.path.exists(gtk3_dir): - os.makedirs(gtk3_dir) - gtk3_css = self.generate_gtk_css("gtk3") - with open( - os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" - ) as file: - file.write(gtk3_css) + if switch.get_active(): + if widget.get_app_types()["gtk4"]: + gtk4_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + if not os.path.exists(gtk4_dir): + os.makedirs(gtk4_dir) + gtk4_css = self.generate_gtk_css("gtk4") + with open( + os.path.join(gtk4_dir, "gtk-dark.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk4_css) + if widget.get_app_types()["gtk3"]: + gtk3_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + if not os.path.exists(gtk3_dir): + os.makedirs(gtk3_dir) + gtk3_css = self.generate_gtk_css("gtk3") + with open( + os.path.join(gtk3_dir, "gtk-dark.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk3_css) + else: + if widget.get_app_types()["gtk4"]: + gtk4_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + if not os.path.exists(gtk4_dir): + os.makedirs(gtk4_dir) + gtk4_css = self.generate_gtk_css("gtk4") + with open( + os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk4_css) + if widget.get_app_types()["gtk3"]: + gtk3_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + if not os.path.exists(gtk3_dir): + os.makedirs(gtk3_dir) + gtk3_css = self.generate_gtk_css("gtk3") + with open( + os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk3_css) self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): From 5e96066b9c4b1578a159c564f9931efeacbd0c19 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 17:57:02 +0200 Subject: [PATCH 123/149] change license Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 819f4dd10..a8e7e471a 100644 --- a/src/main.py +++ b/src/main.py @@ -641,7 +641,7 @@ def show_about_window(self, *_args): Juanjo Cillero https://www.transifex.com/user/profile/renux918/ Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", - license_type=Gtk.License.MIT_X11, + license_type=Gtk.License.GPL_3_0, ) about.present() From f054988887d13b1517b79cba8f9a69957d671ad4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:21:13 +0200 Subject: [PATCH 124/149] rework apply --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a8e7e471a..fc68884de 100644 --- a/src/main.py +++ b/src/main.py @@ -444,7 +444,7 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - switch = Gtk.Switch() + switch = Adw.ActionRow() print(dir(switch)) dialog.set_extra_child(switch) From 7639f5313c1e8a1d031adcbb3bed350edb153cf9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:24:37 +0200 Subject: [PATCH 125/149] update comborow --- src/main.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index fc68884de..04ac224e6 100644 --- a/src/main.py +++ b/src/main.py @@ -444,12 +444,18 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - switch = Adw.ActionRow() - print(dir(switch)) + comborow = Adw.ComboRow() + comborow.set_title(_("Apply as dark theme")) - dialog.set_extra_child(switch) + store = Gtk.StringList() + store.append("Dark") + store.append("Light") + comborow.set_model(store) + print(dir(comborow)) - dialog.connect("response", self.apply_color_scheme, switch) + dialog.set_extra_child(comborow) + + dialog.connect("response", self.apply_color_scheme, comborow) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -540,9 +546,9 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response, switch): + def apply_color_scheme(self, widget, response, comborow): if response == "apply": - if switch.get_active(): + if comborow.get_string().lower() == "dark": if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") From ac53e2e876add0dad2e4871bd7b3a66ea0ab0df7 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:31:44 +0200 Subject: [PATCH 126/149] use switch instead --- src/main.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main.py b/src/main.py index 04ac224e6..f76002025 100644 --- a/src/main.py +++ b/src/main.py @@ -444,18 +444,18 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - comborow = Adw.ComboRow() - comborow.set_title(_("Apply as dark theme")) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - store = Gtk.StringList() - store.append("Dark") - store.append("Light") - comborow.set_model(store) - print(dir(comborow)) + label = Gtk.Label(text="Export as Dark theme") + switch = Gtk.Switch() - dialog.set_extra_child(comborow) + box.append(label) + box.append(switch) + print(dir(switch)) - dialog.connect("response", self.apply_color_scheme, comborow) + dialog.set_extra_child(box) + + dialog.connect("response", self.apply_color_scheme, switch) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -546,9 +546,9 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response, comborow): + def apply_color_scheme(self, widget, response, switch): if response == "apply": - if comborow.get_string().lower() == "dark": + if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") From 4278e213228f94e38423a59aa46942ed2b00b4db Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:32:46 +0200 Subject: [PATCH 127/149] fix bug --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index f76002025..b681a0398 100644 --- a/src/main.py +++ b/src/main.py @@ -446,7 +446,7 @@ def show_apply_color_scheme_dialog(self, *_args): box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - label = Gtk.Label(text="Export as Dark theme") + label = Gtk.Label(label="Export as Dark theme") switch = Gtk.Switch() box.append(label) From 18bb8725ee3e5420d4b5d249e344699b7c1ea30a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:35:23 +0200 Subject: [PATCH 128/149] increase spacing --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index b681a0398..959b83397 100644 --- a/src/main.py +++ b/src/main.py @@ -444,7 +444,7 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=30) label = Gtk.Label(label="Export as Dark theme") switch = Gtk.Switch() From b6105f6302a28c6ad4f2f6b9b033b6e2e8ca59cf Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:38:00 +0200 Subject: [PATCH 129/149] update label --- src/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 959b83397..8595303d5 100644 --- a/src/main.py +++ b/src/main.py @@ -444,9 +444,9 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=30) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - label = Gtk.Label(label="Export as Dark theme") + label = Gtk.Label(label="Apply as Dark theme") switch = Gtk.Switch() box.append(label) From b7c6be25e731b205bf7a8c7ecb45bee60a10b014 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:39:24 +0200 Subject: [PATCH 130/149] format --- src/main.py | 72 +++++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/main.py b/src/main.py index 8595303d5..4d4d6f45a 100644 --- a/src/main.py +++ b/src/main.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -36,6 +36,7 @@ from .custom_css_group import AdwcustomizerCustomCSSGroup from .plugins_list import AdwcustomizerPluginsList + def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -114,7 +115,7 @@ def reload_user_defined_presets(self): self.props.active_window.presets_menu.remove(1) preset_directory = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets") if not os.path.exists(preset_directory): os.makedirs(preset_directory) @@ -141,7 +142,8 @@ def reload_user_defined_presets(self): "line": traceback.format_exc().strip(), } ) - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Failed to load preset"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Failed to load preset"))) self.props.active_window.update_errors(self.global_errors) @@ -174,7 +176,8 @@ def open_dir_callback(_, result): self.portal.open_uri( parent, - "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets"), + "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets"), Xdp.OpenUriFlags.NONE, None, open_dir_callback, @@ -214,8 +217,7 @@ def load_preset_variables(self, preset): self.reload_variables() - - def rgba_from_argb(self, argb, alpha = None) -> str: + def rgba_from_argb(self, argb, alpha=None) -> str: base = "rgba({}, {}, {}, {})" red = redFromArgb(argb) @@ -229,28 +231,22 @@ def rgba_from_argb(self, argb, alpha = None) -> str: def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] - monet_theme = monet_theme.get_string().lower() # dark / light + monet_theme = monet_theme.get_string().lower() # dark / light palette = {} i = 0 for color in palettes.values(): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) - - print(palette) - self.pref_palette_shades["monet"].update_shades(palette) - - print(monet_theme) - print(theme) if monet_theme == "automatic": if self.style_manager.get_dark(): monet_theme = "dark" else: monet_theme = "light" - + if monet_theme == "dark": - dark_theme = theme["schemes"]["dark"] + dark_theme = theme["schemes"]["dark"] variable = { "accent_color": self.rgba_from_argb(dark_theme.primary), "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), @@ -297,8 +293,8 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "shade_color": self.rgba_from_argb(dark_theme.shadow), "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) } - else: # light - light_theme = theme["schemes"]["light"] + else: # light + light_theme = theme["schemes"]["light"] variable = { "accent_color": self.rgba_from_argb(light_theme.primary), "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), @@ -349,7 +345,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): for key in variable.keys(): if key in self.pref_variables: self.pref_variables[key].update_value(variable[key]) - + self.reload_variables() def generate_gtk_css(self, app_type): @@ -419,7 +415,8 @@ def load_preset_action(self, _unused, *args): if args[0].get_string().startswith("custom-"): self.load_preset_from_file( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", args[0].get_string().replace("custom-", "", 1) + ".json", ) @@ -451,7 +448,6 @@ def show_apply_color_scheme_dialog(self, *_args): box.append(label) box.append(switch) - print(dir(switch)) dialog.set_extra_child(box) @@ -478,7 +474,8 @@ def show_save_preset_dialog(self, *_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(self.preset_name) + ".json", ) @@ -501,7 +498,7 @@ def on_preset_entry_change(*_args): dialog.set_body( _( "Saving preset to {0}. If that preset already exists, it will be overwritten!" - ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets")) + ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets")) ) dialog.set_response_enabled("save", False) else: @@ -510,7 +507,8 @@ def on_preset_entry_change(*_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(preset_entry.get_text()) + ".json", ) @@ -529,7 +527,8 @@ def save_preset(self, _unused, response, entry): if response == "save": with open( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(entry.get_text()) + ".json", ), @@ -544,14 +543,15 @@ def save_preset(self, _unused, response, entry): } file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Scheme successfully saved!"))) def apply_color_scheme(self, widget, response, switch): if response == "apply": if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -561,7 +561,7 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -572,7 +572,7 @@ def apply_color_scheme(self, widget, response, switch): else: if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -582,7 +582,7 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -590,30 +590,32 @@ def apply_color_scheme(self, widget, response, switch): os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" ) as file: file.write(gtk3_css) - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): if response == "reset": if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0/gtk.css") ) try: file.delete() except Exception: pass - + if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0/gtk.css") ) try: file.delete() except Exception: pass - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( From 1ee3b7c0bf0d349004c57742ef8498cb4b501df5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:39:52 +0200 Subject: [PATCH 131/149] format --- src/app_type_dialog.py | 23 +++- src/custom_css_group.py | 24 ++-- src/error.py | 9 +- src/main.py | 157 +++++++++++++------------ src/option.py | 27 +++-- src/palette_shades.py | 25 ++-- src/plugin.py | 11 +- src/plugins/__init__.py | 6 +- src/plugins/gtk4.py | 7 +- src/plugins_list.py | 21 ++-- src/setting.py | 7 +- src/settings_schema.py | 251 ++++++++++++++++++++-------------------- src/window.py | 70 ++++++----- 13 files changed, 355 insertions(+), 283 deletions(-) diff --git a/src/app_type_dialog.py b/src/app_type_dialog.py index be2707fe2..f7f88133d 100644 --- a/src/app_type_dialog.py +++ b/src/app_type_dialog.py @@ -7,25 +7,36 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/app_type_dialog.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/app_type_dialog.ui" +) class AdwcustomizerAppTypeDialog(Adw.MessageDialog): - __gtype_name__ = 'AdwcustomizerAppTypeDialog' + __gtype_name__ = "AdwcustomizerAppTypeDialog" gtk4_app_type = Gtk.Template.Child("gtk4-app-type") gtk3_app_type = Gtk.Template.Child("gtk3-app-type") - def __init__(self, heading, body, ok_response_name, ok_response_label, ok_response_appearance, **kwargs): + def __init__( + self, + heading, + body, + ok_response_name, + ok_response_label, + ok_response_appearance, + **kwargs + ): super().__init__(**kwargs) self.set_heading(heading) self.set_body(body) @@ -39,5 +50,5 @@ def __init__(self, heading, body, ok_response_name, ok_response_label, ok_respon def get_app_types(self): return { "gtk4": self.gtk4_app_type.get_active(), - "gtk3": self.gtk3_app_type.get_active() + "gtk3": self.gtk3_app_type.get_active(), } diff --git a/src/custom_css_group.py b/src/custom_css_group.py index 2e2d453bd..1f98ab800 100644 --- a/src/custom_css_group.py +++ b/src/custom_css_group.py @@ -7,20 +7,23 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/custom_css_group.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/custom_css_group.ui" +) class AdwcustomizerCustomCSSGroup(Adw.PreferencesGroup): - __gtype_name__ = 'AdwcustomizerCustomCSSGroup' + __gtype_name__ = "AdwcustomizerCustomCSSGroup" app_type_dropdown = Gtk.Template.Child("app-type-dropdown") custom_css_text_view = Gtk.Template.Child("custom-css-text-view") @@ -31,14 +34,21 @@ def __init__(self, **kwargs): def load_custom_css(self, custom_css): self.custom_css = custom_css - self.custom_css_text_view.get_buffer().set_text(list(self.custom_css.values())[self.app_type_dropdown.get_selected()]) + self.custom_css_text_view.get_buffer().set_text( + list(self.custom_css.values())[self.app_type_dropdown.get_selected()] + ) @Gtk.Template.Callback() def on_custom_css_changed(self, buffer): Gtk.Application.get_default().mark_as_dirty() - Gtk.Application.get_default().update_custom_css_text(list(self.custom_css.keys())[self.app_type_dropdown.get_selected()], buffer.props.text) + Gtk.Application.get_default().update_custom_css_text( + list(self.custom_css.keys())[self.app_type_dropdown.get_selected()], + buffer.props.text, + ) @Gtk.Template.Callback() def on_dropdown_notify(self, _unused, pspec): if pspec.name == "selected": - self.custom_css_text_view.get_buffer().set_text(list(self.custom_css.values())[self.app_type_dropdown.get_selected()]) + self.custom_css_text_view.get_buffer().set_text( + list(self.custom_css.values())[self.app_type_dropdown.get_selected()] + ) diff --git a/src/error.py b/src/error.py index 98fd3fdf1..2760bd544 100644 --- a/src/error.py +++ b/src/error.py @@ -7,20 +7,21 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/error.ui') + +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/error.ui") class AdwcustomizerError(Gtk.ListBoxRow): - __gtype_name__ = 'AdwcustomizerError' + __gtype_name__ = "AdwcustomizerError" error_label = Gtk.Template.Child("error-label") element_label = Gtk.Template.Child("element-label") diff --git a/src/main.py b/src/main.py index 4d4d6f45a..042eaf87b 100644 --- a/src/main.py +++ b/src/main.py @@ -89,10 +89,8 @@ def do_activate(self): GLib.Variant("s", "adwaita"), self.load_preset_action, ) - self.create_action("apply_color_scheme", - self.show_apply_color_scheme_dialog) - self.create_action("reset_color_scheme", - self.show_reset_color_scheme_dialog) + self.create_action("apply_color_scheme", self.show_apply_color_scheme_dialog) + self.create_action("reset_color_scheme", self.show_reset_color_scheme_dialog) self.create_action("save_preset", self.show_save_preset_dialog) self.create_action("about", self.show_about_window) @@ -115,7 +113,9 @@ def reload_user_defined_presets(self): self.props.active_window.presets_menu.remove(1) preset_directory = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), + "presets", + ) if not os.path.exists(preset_directory): os.makedirs(preset_directory) @@ -132,8 +132,7 @@ def reload_user_defined_presets(self): raise KeyError("variables") if preset.get("palette") is None: raise KeyError("palette") - self.custom_presets[file_name.replace( - ".json", "")] = preset["name"] + self.custom_presets[file_name.replace(".json", "")] = preset["name"] except Exception: self.global_errors.append( { @@ -143,7 +142,8 @@ def reload_user_defined_presets(self): } ) self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Failed to load preset"))) + Adw.Toast(title=_("Failed to load preset")) + ) self.props.active_window.update_errors(self.global_errors) @@ -176,8 +176,11 @@ def open_dir_callback(_, result): self.portal.open_uri( parent, - "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), "presets"), + "file://" + + os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), + "presets", + ), Xdp.OpenUriFlags.NONE, None, open_dir_callback, @@ -190,8 +193,7 @@ def load_preset_from_file(self, preset_path): self.load_preset_variables(json.loads(preset_text)) def load_preset_from_resource(self, preset_path): - preset_text = Gio.resources_lookup_data( - preset_path, 0).get_data().decode() + preset_text = Gio.resources_lookup_data(preset_path, 0).get_data().decode() self.load_preset_variables(json.loads(preset_text)) def load_preset_variables(self, preset): @@ -251,47 +253,40 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_color": self.rgba_from_argb(dark_theme.primary), "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), "accent_fg_color": self.rgba_from_argb(dark_theme.onPrimaryContainer), - "destructive_color": self.rgba_from_argb(dark_theme.error), "destructive_bg_color": self.rgba_from_argb(dark_theme.errorContainer), "destructive_fg_color": self.rgba_from_argb(dark_theme.onError), - "success_color": self.rgba_from_argb(dark_theme.tertiary), "success_bg_color": self.rgba_from_argb(dark_theme.onTertiary), "success_fg_color": self.rgba_from_argb(dark_theme.tertiaryContainer), - "warning_color": self.rgba_from_argb(dark_theme.secondaryContainer), "warning_bg_color": self.rgba_from_argb(dark_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": self.rgba_from_argb(dark_theme.error), "error_bg_color": self.rgba_from_argb(dark_theme.errorContainer), "error_fg_color": self.rgba_from_argb(dark_theme.onError), - "window_bg_color": self.rgba_from_argb(dark_theme.surface), "window_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "view_bg_color": self.rgba_from_argb(dark_theme.surface), "view_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_bg_color": self.rgba_from_argb(dark_theme.surface), "headerbar_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), + "headerbar_border_color": self.rgba_from_argb( + dark_theme.primary, "0.8" + ), "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), - "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), "card_shade_color": self.rgba_from_argb(dark_theme.shadow), - "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "popover_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), - "popover_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - + "popover_fg_color": self.rgba_from_argb( + dark_theme.onSecondaryContainer + ), "shade_color": self.rgba_from_argb(dark_theme.shadow), - "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) + "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline), } else: # light light_theme = theme["schemes"]["light"] @@ -299,47 +294,42 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_color": self.rgba_from_argb(light_theme.primary), "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), "accent_fg_color": self.rgba_from_argb(light_theme.onPrimaryContainer), - "destructive_color": self.rgba_from_argb(light_theme.error), "destructive_bg_color": self.rgba_from_argb(light_theme.errorContainer), "destructive_fg_color": self.rgba_from_argb(light_theme.onError), - "success_color": self.rgba_from_argb(light_theme.tertiary), "success_bg_color": self.rgba_from_argb(light_theme.onTertiary), "success_fg_color": self.rgba_from_argb(light_theme.tertiaryContainer), - "warning_color": self.rgba_from_argb(light_theme.secondaryContainer), "warning_bg_color": self.rgba_from_argb(light_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(light_theme.primary, "0.8"), - "error_color": self.rgba_from_argb(light_theme.error), "error_bg_color": self.rgba_from_argb(light_theme.errorContainer), "error_fg_color": self.rgba_from_argb(light_theme.onError), - "window_bg_color": self.rgba_from_argb(light_theme.surface), "window_fg_color": self.rgba_from_argb(light_theme.onSurface), - "view_bg_color": self.rgba_from_argb(light_theme.surface), "view_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_bg_color": self.rgba_from_argb(light_theme.surface), "headerbar_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_border_color": self.rgba_from_argb(light_theme.primary, "0.8"), + "headerbar_border_color": self.rgba_from_argb( + light_theme.primary, "0.8" + ), "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(light_theme.shadow), - "card_bg_color": self.rgba_from_argb(light_theme.primary, "0.05"), "card_fg_color": self.rgba_from_argb(light_theme.surfaceVariant), "card_shade_color": self.rgba_from_argb(light_theme.shadow), - "dialog_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), - "dialog_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - + "dialog_fg_color": self.rgba_from_argb( + light_theme.onSecondaryContainer + ), "popover_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), - "popover_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - + "popover_fg_color": self.rgba_from_argb( + light_theme.onSecondaryContainer + ), "shade_color": self.rgba_from_argb(light_theme.shadow), - "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline) + "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline), } for key in variable.keys(): @@ -395,8 +385,7 @@ def on_error(_, section, error): css_provider.connect("parsing-error", on_error) css_provider.load_from_data(gtk_css.encode()) - self.props.active_window.update_errors( - self.global_errors + parsing_errors) + self.props.active_window.update_errors(self.global_errors + parsing_errors) # loading with the priority above user to override the applied config if self.current_css_provider is not None: Gtk.StyleContext.remove_provider_for_display( @@ -415,8 +404,7 @@ def load_preset_action(self, _unused, *args): if args[0].get_string().startswith("custom-"): self.load_preset_from_file( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", args[0].get_string().replace("custom-", "", 1) + ".json", ) @@ -474,8 +462,7 @@ def show_save_preset_dialog(self, *_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", to_slug_case(self.preset_name) + ".json", ) @@ -485,8 +472,7 @@ def show_save_preset_dialog(self, *_args): dialog.add_response("cancel", _("Cancel")) dialog.add_response("save", _("Save")) - dialog.set_response_appearance( - "save", Adw.ResponseAppearance.SUGGESTED) + dialog.set_response_appearance("save", Adw.ResponseAppearance.SUGGESTED) dialog.set_default_response("cancel") dialog.set_close_response("cancel") @@ -498,7 +484,14 @@ def on_preset_entry_change(*_args): dialog.set_body( _( "Saving preset to {0}. If that preset already exists, it will be overwritten!" - ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets")) + ).format( + os.path.join( + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "presets", + ) + ) ) dialog.set_response_enabled("save", False) else: @@ -507,8 +500,9 @@ def on_preset_entry_change(*_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), "presets", to_slug_case(preset_entry.get_text()) + ".json", ) @@ -527,8 +521,7 @@ def save_preset(self, _unused, response, entry): if response == "save": with open( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", to_slug_case(entry.get_text()) + ".json", ), @@ -544,14 +537,19 @@ def save_preset(self, _unused, response, entry): file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Scheme successfully saved!"))) + Adw.Toast(title=_("Scheme successfully saved!")) + ) def apply_color_scheme(self, widget, response, switch): if response == "apply": if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0", + ) if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -561,7 +559,11 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0", + ) if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -572,7 +574,11 @@ def apply_color_scheme(self, widget, response, switch): else: if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0", + ) if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -582,7 +588,11 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0", + ) if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -591,14 +601,19 @@ def apply_color_scheme(self, widget, response, switch): ) as file: file.write(gtk3_css) self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Scheme set successfully!"))) + Adw.Toast(title=_("Scheme set successfully!")) + ) def reset_color_scheme(self, widget, response): if response == "reset": if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0/gtk.css") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0/gtk.css", + ) ) try: file.delete() @@ -608,14 +623,17 @@ def reset_color_scheme(self, widget, response): if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0/gtk.css") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0/gtk.css", + ) ) try: file.delete() except Exception: pass - self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Reset successfully!"))) + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( @@ -631,12 +649,8 @@ def show_about_window(self, *_args): "0xMRTT https://github.com/0xMRTT", "Verantor https://github.com/Verantor", ], - artists=[ - 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' - ], - designers=[ - 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' - ], + artists=['David "Daudix UFO" Lapshin https://github.com/daudix-UFO'], + designers=['David "Daudix UFO" Lapshin https://github.com/daudix-UFO'], # Translators: This is a place to put your credits (formats: "Name https://example.com" or "Name ", no quotes) and is not meant to be translated literally. translator_credits="""Maxime V https://www.transifex.com/user/profile/Adaoh/ FineFindus https://github.com/FineFindus @@ -676,8 +690,7 @@ def create_stateful_action( self, name, parameter_type, initial_state, callback, shortcuts=None ): """Add a stateful application action.""" - action = Gio.SimpleAction.new_stateful( - name, parameter_type, initial_state) + action = Gio.SimpleAction.new_stateful(name, parameter_type, initial_state) action.connect("activate", callback) self.add_action(action) if shortcuts: diff --git a/src/option.py b/src/option.py index ed98f2d12..885339f22 100644 --- a/src/option.py +++ b/src/option.py @@ -7,20 +7,21 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/option.ui') + +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/option.ui") class AdwcustomizerOption(Adw.ActionRow): - __gtype_name__ = 'AdwcustomizerOption' + __gtype_name__ = "AdwcustomizerOption" color_value = Gtk.Template.Child("color-value") text_value = Gtk.Template.Child("text-value") @@ -42,10 +43,14 @@ def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs): self.warning_button.set_visible(False) elif adw_gtk3_support == "partial": self.warning_button.add_css_class("warning") - self.warning_label.set_label(_("This option is only partially supported by the adw-gtk3 theme.")) + self.warning_label.set_label( + _("This option is only partially supported by the adw-gtk3 theme.") + ) elif adw_gtk3_support == "no": self.warning_button.add_css_class("error") - self.warning_label.set_label(_("This option is not supported by the adw-gtk3 theme.")) + self.warning_label.set_label( + _("This option is not supported by the adw-gtk3 theme.") + ) self.explanation_label.set_label(explanation or "") if explanation is None: @@ -53,7 +58,9 @@ def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs): @Gtk.Template.Callback() def on_color_value_changed(self, *_args): - self.update_value(self.color_value.get_rgba().to_string(), update_from="color_value") + self.update_value( + self.color_value.get_rgba().to_string(), update_from="color_value" + ) @Gtk.Template.Callback() def on_text_value_changed(self, *_args): @@ -86,7 +93,11 @@ def update_value(self, new_value, **kwargs): self.color_value.set_rgba(rgba) self.color_value.set_tooltip_text(_("Not a color, see text value")) - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "text_value" and new_value != "": + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "text_value" + and new_value != "" + ): Gtk.Application.get_default().variables[self.get_name()] = new_value Gtk.Application.get_default().mark_as_dirty() Gtk.Application.get_default().reload_variables() diff --git a/src/palette_shades.py b/src/palette_shades.py index f7eb9bf79..dcb0cc63d 100644 --- a/src/palette_shades.py +++ b/src/palette_shades.py @@ -7,20 +7,23 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/palette_shades.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/palette_shades.ui" +) class AdwcustomizerPaletteShades(Adw.ActionRow): - __gtype_name__ = 'AdwcustomizerPaletteShades' + __gtype_name__ = "AdwcustomizerPaletteShades" def __init__(self, prefix, color_title, n_shades, **kwargs): super().__init__(**kwargs) @@ -52,9 +55,17 @@ def update_shades(self, shades, **kwargs): if new_rgba.parse(shades[str(i)]): self.color_pickers[str(i)].set_rgba(new_rgba) self.color_pickers[str(i)].set_tooltip_text(shades[str(i)]) - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "color_value": - Gtk.Application.get_default().palette[self.prefix][str(i)] = shades[str(i)] + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "color_value" + ): + Gtk.Application.get_default().palette[self.prefix][str(i)] = shades[ + str(i) + ] - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "color_value": + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "color_value" + ): Gtk.Application.get_default().mark_as_dirty() Gtk.Application.get_default().reload_variables() diff --git a/src/plugin.py b/src/plugin.py index 16a234f24..cceb7e014 100644 --- a/src/plugin.py +++ b/src/plugin.py @@ -7,17 +7,18 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from .setting import AdwcustomizerSetting + class AdwcustomizerPlugin: def __init__(self): self.title = None @@ -48,7 +49,9 @@ def get_custom_settings_for_preset(self): def get_alias_values(self): alias_values = {} for key, value in self.alias_dict.items(): - alias_values[key] = self.colors.get(value, self.palette.get(value, self.custom_settings.get(value))) + alias_values[key] = self.colors.get( + value, self.palette.get(value, self.custom_settings.get(value)) + ) return alias_values def validate(self): @@ -58,4 +61,4 @@ def apply(self): raise NotImplementedError() def save(self): - pass \ No newline at end of file + pass diff --git a/src/plugins/__init__.py b/src/plugins/__init__.py index a66319289..f93ffe537 100644 --- a/src/plugins/__init__.py +++ b/src/plugins/__init__.py @@ -7,11 +7,11 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with this program. If not, see . \ No newline at end of file +# along with this program. If not, see . diff --git a/src/plugins/gtk4.py b/src/plugins/gtk4.py index b5a7d14f1..dd5fe68e9 100644 --- a/src/plugins/gtk4.py +++ b/src/plugins/gtk4.py @@ -7,16 +7,17 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from ..plugin import AdwcustomizerPlugin + class AdwcustomizerGtk4Plugin(AdwcustomizerPlugin): - pass \ No newline at end of file + pass diff --git a/src/plugins_list.py b/src/plugins_list.py index 3c7c04b35..d2c14499e 100644 --- a/src/plugins_list.py +++ b/src/plugins_list.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -20,22 +20,27 @@ import os from pathlib import Path import importlib + + class AdwcustomizerPluginsList: def __init__(self): - self.plugins = { # AdwCustomizerTeam plugins - "gtk4": AdwcustomizerGtk4Plugin() - } + self.plugins = {"gtk4": AdwcustomizerGtk4Plugin()} # AdwCustomizerTeam plugins self.add_user_plugins() def add_user_plugins(self): - self.user_plugin_dir = Path(os.environ.get("XDG_DATA_HOME", os.environ["HOME"])) / ".local" / "share" / "AdwCustomizer" / "plugins" + self.user_plugin_dir = ( + Path(os.environ.get("XDG_DATA_HOME", os.environ["HOME"])) + / ".local" + / "share" + / "AdwCustomizer" + / "plugins" + ) if self.user_plugin_dir.exists(): for path, _, name in os.walk(self.user_plugin_dir): print(name[0]) else: print("No plugins dir found") - def load_all_custom_settings(self, settings): for plugin_id, plugin in self.plugins.items(): plugin.load_custom_settings(settings[plugin_id]) @@ -43,4 +48,4 @@ def load_all_custom_settings(self, settings): def get_all_custom_settings_for_preset(self): custom_settings = {} for plugin_id, plugin in self.plugins.items(): - custom_settings[plugin_id] = plugin.get_custom_settings_for_preset() \ No newline at end of file + custom_settings[plugin_id] = plugin.get_custom_settings_for_preset() diff --git a/src/setting.py b/src/setting.py index 9a7492815..a2d3479b5 100644 --- a/src/setting.py +++ b/src/setting.py @@ -7,15 +7,16 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . + class AdwcustomizerSetting: def __init__(self, name, title, value_type, explanation=None, default_value=None): # TODO supported types: @@ -34,4 +35,4 @@ def __init__(self, name, title, value_type, explanation=None, default_value=None def set_value(self, new_value): # TODO checks - self.value = new_value \ No newline at end of file + self.value = new_value diff --git a/src/settings_schema.py b/src/settings_schema.py index ea9317441..ea22ce840 100644 --- a/src/settings_schema.py +++ b/src/settings_schema.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -21,117 +21,137 @@ { "name": "accent_colors", "title": _("Accent Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, and entries, to indicate that a widget is important, interactive, or currently active."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, and entries, to indicate that a widget is important, interactive, or currently active." + ), "variables": [ { "name": "accent_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "accent_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "accent_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "destructive_colors", "title": _("Destructive Colors"), - "description": _("These colors are used for buttons to indicate a dangerous action, such as deleting a file."), + "description": _( + "These colors are used for buttons to indicate a dangerous action, such as deleting a file." + ), "variables": [ { "name": "destructive_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "destructive_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "destructive_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "success_colors", "title": _("Success Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a success or a high level."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a success or a high level." + ), "variables": [ { "name": "success_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "success_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "success_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "warning_colors", "title": _("Warning Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a warning or a low level."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a warning or a low level." + ), "variables": [ { "name": "warning_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "warning_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "warning_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "error_colors", "title": _("Error Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, and entries, to indicate a failure."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, and entries, to indicate a failure." + ), "variables": [ { "name": "error_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "error_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "error_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "window_colors", @@ -141,66 +161,76 @@ { "name": "window_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "window_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "view_colors", "title": _("View Colors"), - "description": _("These colors are used in a variety of widgets, such as text views and entries."), + "description": _( + "These colors are used in a variety of widgets, such as text views and entries." + ), "variables": [ { "name": "view_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "view_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "headerbar_colors", "title": _("Header Bar Colors"), - "description": _("These colors are used for header bars, as well as widgets that are meant to be visually attached to it, such as search bars or tab bars."), + "description": _( + "These colors are used for header bars, as well as widgets that are meant to be visually attached to it, such as search bars or tab bars." + ), "variables": [ { "name": "headerbar_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "headerbar_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "headerbar_border_color", "title": _("Border Color"), - "explanation": _("The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout."), - "adw_gtk3_support": "no" + "explanation": _( + "The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout." + ), + "adw_gtk3_support": "no", }, { "name": "headerbar_backdrop_color", "title": _("Backdrop Color"), - "explanation": _("The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color."), - "adw_gtk3_support": "yes" + "explanation": _( + "The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color." + ), + "adw_gtk3_support": "yes", }, { "name": "headerbar_shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window."), - "adw_gtk3_support": "no" - } - ] + "explanation": _( + "The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window." + ), + "adw_gtk3_support": "no", + }, + ], }, { "name": "card_colors", @@ -210,20 +240,22 @@ { "name": "card_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "card_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "card_shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards."), - "adw_gtk3_support": "no" - } - ] + "explanation": _( + "The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards." + ), + "adw_gtk3_support": "no", + }, + ], }, { "name": "dialog_colors", @@ -233,14 +265,14 @@ { "name": "dialog_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "no" + "adw_gtk3_support": "no", }, { "name": "dialog_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "no" - } - ] + "adw_gtk3_support": "no", + }, + ], }, { "name": "popover_colors", @@ -250,14 +282,14 @@ { "name": "popover_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "popover_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "misc_colors", @@ -267,67 +299,32 @@ { "name": "shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders."), - "adw_gtk3_support": "no" + "explanation": _( + "The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders." + ), + "adw_gtk3_support": "no", }, { "name": "scrollbar_outline_color", "title": _("Scrollbar Outline Color"), - "explanation": _("The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color."), - "adw_gtk3_support": "no" - } - ] - } + "explanation": _( + "The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color." + ), + "adw_gtk3_support": "no", + }, + ], + }, ], "palette": [ - { - "prefix": "blue_", - "title": _("Blue"), - "n_shades": 5 - }, - { - "prefix": "green_", - "title": _("Green"), - "n_shades": 5 - }, - { - "prefix": "yellow_", - "title": _("Yellow"), - "n_shades": 5 - }, - { - "prefix": "orange_", - "title": _("Orange"), - "n_shades": 5 - }, - { - "prefix": "red_", - "title": _("Red"), - "n_shades": 5 - }, - { - "prefix": "purple_", - "title": _("Purple"), - "n_shades": 5 - }, - { - "prefix": "brown_", - "title": _("Brown"), - "n_shades": 5 - }, - { - "prefix": "light_", - "title": _("Light"), - "n_shades": 5 - }, - { - "prefix": "dark_", - "title": _("Dark"), - "n_shades": 5 - } + {"prefix": "blue_", "title": _("Blue"), "n_shades": 5}, + {"prefix": "green_", "title": _("Green"), "n_shades": 5}, + {"prefix": "yellow_", "title": _("Yellow"), "n_shades": 5}, + {"prefix": "orange_", "title": _("Orange"), "n_shades": 5}, + {"prefix": "red_", "title": _("Red"), "n_shades": 5}, + {"prefix": "purple_", "title": _("Purple"), "n_shades": 5}, + {"prefix": "brown_", "title": _("Brown"), "n_shades": 5}, + {"prefix": "light_", "title": _("Light"), "n_shades": 5}, + {"prefix": "dark_", "title": _("Dark"), "n_shades": 5}, ], - "custom_css_app_types": [ - "gtk4", - "gtk3" - ] + "custom_css_app_types": ["gtk4", "gtk3"], } diff --git a/src/window.py b/src/window.py index 1f10d3f0a..25d03cc83 100644 --- a/src/window.py +++ b/src/window.py @@ -36,9 +36,9 @@ from material_color_utilities_python import * -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui") class AdwcustomizerMainWindow(Adw.ApplicationWindow): - __gtype_name__ = 'AdwcustomizerMainWindow' + __gtype_name__ = "AdwcustomizerMainWindow" content = Gtk.Template.Child() toast_overlay = Gtk.Template.Child() @@ -54,14 +54,14 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) self.presets_dropdown.get_popover().connect( - "show", self.on_presets_dropdown_activate) + "show", self.on_presets_dropdown_activate + ) self.setup_monet_page() self.setup_plugins_page() self.setup_colors_page() - self.settings = Gio.Settings( - "com.github.AdwCustomizerTeam.AdwCustomizer") + self.settings = Gio.Settings("com.github.AdwCustomizerTeam.AdwCustomizer") self.settings.bind( "window-width", self, "default-width", Gio.SettingsBindFlags.DEFAULT @@ -93,7 +93,9 @@ def on_monet_file_chooser_response(self, widget, response): self.theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) + self.get_application().update_theme_from_monet( + self.theme, self.tone, self.monet_theme + ) def setup_monet_page(self): @@ -101,7 +103,10 @@ def setup_monet_page(self): self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) self.monet_pref_group.set_description( - _("Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow")) + _( + "Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow" + ) + ) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -111,21 +116,21 @@ def setup_monet_page(self): self.monet_file_chooser_button = Gtk.Button() self.monet_file_chooser_button.set_label(_("Choose a file")) - self.monet_file_chooser_button.set_icon_name( - "folder-pictures-symbolic") + self.monet_file_chooser_button.set_icon_name("folder-pictures-symbolic") self.monet_file_chooser_button.connect( - "clicked", self.on_file_picker_button_clicked) + "clicked", self.on_file_picker_button_clicked + ) self.monet_file_chooser_dialog.connect( - "response", self.on_monet_file_chooser_response) + "response", self.on_monet_file_chooser_response + ) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) self.monet_pref_group.add(self.monet_file_chooser_row) - self.monet_palette_shades = AdwcustomizerPaletteShades("monet", - "Monet Palette", - 6) - self.get_application( - ).pref_palette_shades["monet"] = self.monet_palette_shades + self.monet_palette_shades = AdwcustomizerPaletteShades( + "monet", "Monet Palette", 6 + ) + self.get_application().pref_palette_shades["monet"] = self.monet_palette_shades self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() @@ -168,14 +173,14 @@ def setup_colors_page(self): pref_group.set_description(group["description"]) for variable in group["variables"]: - pref_variable = AdwcustomizerOption(variable["name"], - variable["title"], - variable.get( - "explanation"), - variable["adw_gtk3_support"]) + pref_variable = AdwcustomizerOption( + variable["name"], + variable["title"], + variable.get("explanation"), + variable["adw_gtk3_support"], + ) pref_group.add(pref_variable) - self.get_application( - ).pref_variables[variable["name"]] = pref_variable + self.get_application().pref_variables[variable["name"]] = pref_variable self.content.add(pref_group) @@ -183,14 +188,16 @@ def setup_colors_page(self): palette_pref_group.set_name("palette_colors") palette_pref_group.set_title(_("Palette Colors")) palette_pref_group.set_description( - _("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) + _( + 'Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.' + ) + ) for color in settings_schema["palette"]: - palette_shades = AdwcustomizerPaletteShades(color["prefix"], - color["title"], - color["n_shades"]) + palette_shades = AdwcustomizerPaletteShades( + color["prefix"], color["title"], color["n_shades"] + ) palette_pref_group.add(palette_shades) - self.get_application( - ).pref_palette_shades[color["prefix"]] = palette_shades + self.get_application().pref_palette_shades[color["prefix"]] = palette_shades self.content.add(palette_pref_group) def update_errors(self, errors): @@ -200,8 +207,9 @@ def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) self.errors_button.set_visible(len(errors) > 0) for error in errors: - self.errors_list.append(AdwcustomizerError( - error["error"], error["element"], error["line"])) + self.errors_list.append( + AdwcustomizerError(error["error"], error["element"], error["line"]) + ) def on_presets_dropdown_activate(self, *args): self.get_application().reload_user_defined_presets() From f84080832408da0368c8ff33b488993b9e538235 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:44:51 +0200 Subject: [PATCH 132/149] add version --- meson.build | 6 +++++- src/info.py.in | 2 ++ src/main.py | 3 ++- src/meson.build | 11 +++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/info.py.in diff --git a/meson.build b/meson.build index 36f2ff2f4..e22a4fc1e 100644 --- a/meson.build +++ b/meson.build @@ -1,11 +1,15 @@ project('adwcustomizer', - version: 'git', + version: '0.1.0', meson_version: '>= 0.59.0', default_options: [ 'warning_level=2', 'werror=false', ], ) +dependency('glib-2.0') +dependency('pygobject-3.0') +dependency('libadwaita-1') + i18n = import('i18n') gnome = import('gnome') diff --git a/src/info.py.in b/src/info.py.in new file mode 100644 index 000000000..20fc34949 --- /dev/null +++ b/src/info.py.in @@ -0,0 +1,2 @@ +version = '@version@' +build_type = '@build_type@' \ No newline at end of file diff --git a/src/main.py b/src/main.py index 042eaf87b..142524a33 100644 --- a/src/main.py +++ b/src/main.py @@ -35,7 +35,7 @@ from .app_type_dialog import AdwcustomizerAppTypeDialog from .custom_css_group import AdwcustomizerCustomCSSGroup from .plugins_list import AdwcustomizerPluginsList - +from . import info def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -664,6 +664,7 @@ def show_about_window(self, *_args): Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, + version=f"{info.version}" ) about.present() diff --git a/src/meson.build b/src/meson.build index 7f45b1d13..b395392b1 100644 --- a/src/meson.build +++ b/src/meson.build @@ -40,6 +40,17 @@ configure_file( install_dir: get_option('bindir') ) +configure_file( + input: 'info.py.in', + output: '@BASENAME@', + install: true, + install_dir: python.get_install_dir() / 'adwcustomizer', + configuration: configuration_data({ + 'version': meson.project_version(), + 'build_type': get_option('buildtype'), + }), +) + adwcustomizer_sources = [ '__init__.py', 'settings_schema.py', From c775f93492d60738f4453c7f7323af2b82efabd9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:46:03 +0200 Subject: [PATCH 133/149] update meson build --- src/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index b395392b1..d3e13293a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -44,7 +44,7 @@ configure_file( input: 'info.py.in', output: '@BASENAME@', install: true, - install_dir: python.get_install_dir() / 'adwcustomizer', + install_dir: moduledir, configuration: configuration_data({ 'version': meson.project_version(), 'build_type': get_option('buildtype'), From 30ac48c58b3685a52a4b27b44d61fe2b90477094 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:47:30 +0200 Subject: [PATCH 134/149] format --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 142524a33..4849549f9 100644 --- a/src/main.py +++ b/src/main.py @@ -37,6 +37,7 @@ from .plugins_list import AdwcustomizerPluginsList from . import info + def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -664,7 +665,7 @@ def show_about_window(self, *_args): Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, - version=f"{info.version}" + version=f"{info.version}", ) about.present() From 63d59ffd66ece733b449f914eba171e4c2560345 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:51:30 +0200 Subject: [PATCH 135/149] udpate appstream metadata #77 --- ...github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index 9547dad90..86def6ddf 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -2,8 +2,11 @@ com.github.AdwCustomizerTeam.AdwCustomizer.desktop CC0-1.0 - MIT + GPL-3.0 - Change the look of Adwaita, with ease + Change the look of Adwaita, with ease - + https://github.com/AdwCustomizerTeam/AdwCustomizer/issues + https://github.com/AdwCustomizerTeam/AdwCustomizer + https://www.transifex.com/adwcustomizerteam/adwcustomizer/ + \ No newline at end of file From 6b64caccd48484c845c1c96e1f230fef629360f7 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 19:27:47 +0200 Subject: [PATCH 136/149] move menu button next to close button --- src/ui/window.blp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index 3b3abc816..da2d16a8c 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -45,11 +45,6 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } } - [end] - Gtk.MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } [end] MenuButton errors-button { @@ -58,6 +53,13 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { popover: errors-popover; } + + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + } Gtk.Box { From 2d7e04e3b7e0914df7a2bde1e2c9ffefdcafa9a5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 19:27:57 +0200 Subject: [PATCH 137/149] update appstream metadata --- data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index 86def6ddf..b6b00b08c 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -3,6 +3,8 @@ com.github.AdwCustomizerTeam.AdwCustomizer.desktop CC0-1.0 GPL-3.0 + Adwaita Manager + Change the look of Adwaita, with ease Change the look of Adwaita, with ease From 8d2facab423a51c45a07fd5debeca2b53703528f Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 20:12:34 +0200 Subject: [PATCH 138/149] switch back to main Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index 31be453cf..2bb34ef9d 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -71,7 +71,7 @@ { "type" : "git", "path" : ".", - "branch": "next" + "branch": "main" } ] } From 6405f813075861d95168c8018dba123736d029ed Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 20:13:21 +0200 Subject: [PATCH 139/149] auto instead of automatic Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 25d03cc83..2e35d7f4b 100644 --- a/src/window.py +++ b/src/window.py @@ -149,7 +149,7 @@ def setup_monet_page(self): self.monet_theme_row.set_title(_("Theme")) store = Gtk.StringList() - store.append("Automatic") + store.append("Auto") store.append("Dark") store.append("Light") self.monet_theme_row.set_model(store) From 405ad1d079e59ceaa645b28072ae6ccdd21d1f58 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:25:05 +0200 Subject: [PATCH 140/149] Update POT --- po/AdwCustomizer.pot | 229 +++++++++++++++++++++++++------------------ 1 file changed, 134 insertions(+), 95 deletions(-) diff --git a/po/AdwCustomizer.pot b/po/AdwCustomizer.pot index c45e60352..1d707805a 100644 --- a/po/AdwCustomizer.pot +++ b/po/AdwCustomizer.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-09 22:21+0300\n" +"POT-Creation-Date: 2022-08-12 11:24+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,11 +18,13 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: data/com.github.AdwCustomizerTeam.AdwCustomizer.desktop.in:3 -#: src/ui/window.blp:5 src/main.py:332 +#: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:6 +#: src/ui/window.blp:5 src/main.py:642 msgid "Adwaita Manager" msgstr "" #: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:7 +#: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:9 msgid "Change the look of Adwaita, with ease" msgstr "" @@ -70,225 +72,236 @@ msgstr "" msgid "Toggle Text Value" msgstr "" -#: src/ui/window.blp:13 src/main.py:245 +#: src/ui/window.blp:23 src/main.py:428 msgid "Apply" msgstr "" -#: src/ui/window.blp:20 -msgid "Save Preset" +#: src/ui/window.blp:35 +msgid "Presets" msgstr "" -#: src/ui/window.blp:36 -msgid "Presets" +#: src/ui/window.blp:42 +msgid "Save Preset" msgstr "" -#: src/ui/window.blp:58 +#: src/ui/window.blp:112 msgid "Built-in Presets" msgstr "" -#: src/ui/window.blp:73 +#: src/ui/window.blp:134 +msgid "Release Notes" +msgstr "" + +#: src/ui/window.blp:138 msgid "Reset Applied Color Scheme" msgstr "" -#: src/ui/window.blp:74 +#: src/ui/window.blp:142 msgid "About Adwaita Manager" msgstr "" -#: src/app_type_dialog.py:43 src/main.py:264 +#: src/app_type_dialog.py:44 src/main.py:474 msgid "Cancel" msgstr "" -#: src/main.py:123 +#: src/main.py:140 src/main.py:146 msgid "Failed to load preset" msgstr "" -#: src/main.py:139 +#: src/main.py:163 msgid "Open in File Manager" msgstr "" -#: src/main.py:142 +#: src/main.py:169 msgid "User Defined Presets" msgstr "" -#: src/main.py:203 +#: src/main.py:358 msgid "Unsaved changes" msgstr "" -#: src/main.py:243 +#: src/main.py:423 msgid "Apply this color scheme?" msgstr "" -#: src/main.py:244 +#: src/main.py:425 msgid "" "Warning: any custom CSS files for those app types will be irreversibly " "overwritten!" msgstr "" -#: src/main.py:251 +#: src/main.py:448 msgid "Reset applied color scheme?" msgstr "" -#: src/main.py:252 +#: src/main.py:449 msgid "Make sure you have the current settings saved as a preset." msgstr "" -#: src/main.py:253 +#: src/main.py:451 msgid "Reset" msgstr "" -#: src/main.py:260 +#: src/main.py:461 msgid "Save preset as..." msgstr "" -#: src/main.py:261 src/main.py:274 src/main.py:277 +#: src/main.py:463 src/main.py:487 src/main.py:501 #, python-brace-format msgid "" "Saving preset to {0}. If that preset already exists, it will be " "overwritten!" msgstr "" -#: src/main.py:265 +#: src/main.py:475 msgid "Save" msgstr "" -#: src/main.py:334 -msgid "Adwaita Manager Team" +#: src/main.py:541 +msgid "Scheme successfully saved!" msgstr "" -#. Translators: This is a place to put your credits (formats: "Name https://example.com" or "Name ", no quotes) and is not meant to be translated literally. -#: src/main.py:338 -msgid "translator-credits" +#: src/main.py:605 +msgid "Scheme set successfully!" msgstr "" -#: src/option.py:55 +#: src/main.py:637 +msgid "Reset successfully!" +msgstr "" + +#: src/main.py:644 +msgid "Adwaita Manager Team" +msgstr "" + +#: src/option.py:47 msgid "This option is only partially supported by the adw-gtk3 theme." msgstr "" -#: src/option.py:58 +#: src/option.py:52 msgid "This option is not supported by the adw-gtk3 theme." msgstr "" -#: src/option.py:97 +#: src/option.py:94 msgid "Not a color, see text value" msgstr "" -#: src/settings_schema.py:5 +#: src/settings_schema.py:23 msgid "Accent Colors" msgstr "" -#: src/settings_schema.py:6 +#: src/settings_schema.py:25 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, and entries, to indicate that a widget is important, interactive, or " "currently active." msgstr "" -#: src/settings_schema.py:10 src/settings_schema.py:33 -#: src/settings_schema.py:56 src/settings_schema.py:79 -#: src/settings_schema.py:102 +#: src/settings_schema.py:30 src/settings_schema.py:57 +#: src/settings_schema.py:84 src/settings_schema.py:111 +#: src/settings_schema.py:138 msgid "Standalone Color" msgstr "" -#: src/settings_schema.py:11 src/settings_schema.py:34 -#: src/settings_schema.py:57 src/settings_schema.py:80 -#: src/settings_schema.py:103 +#: src/settings_schema.py:32 src/settings_schema.py:59 +#: src/settings_schema.py:86 src/settings_schema.py:113 +#: src/settings_schema.py:140 msgid "" "The standalone colors are similar to the background ones, but provide better " "contrast when used as foreground color on top of a neutral background - for " "example, colorful text in a window." msgstr "" -#: src/settings_schema.py:16 src/settings_schema.py:39 -#: src/settings_schema.py:62 src/settings_schema.py:85 -#: src/settings_schema.py:108 src/settings_schema.py:125 -#: src/settings_schema.py:142 src/settings_schema.py:159 -#: src/settings_schema.py:194 src/settings_schema.py:217 -#: src/settings_schema.py:234 +#: src/settings_schema.py:38 src/settings_schema.py:65 +#: src/settings_schema.py:92 src/settings_schema.py:119 +#: src/settings_schema.py:146 src/settings_schema.py:163 +#: src/settings_schema.py:182 src/settings_schema.py:201 +#: src/settings_schema.py:242 src/settings_schema.py:267 +#: src/settings_schema.py:284 msgid "Background Color" msgstr "" -#: src/settings_schema.py:21 src/settings_schema.py:44 -#: src/settings_schema.py:67 src/settings_schema.py:90 -#: src/settings_schema.py:113 src/settings_schema.py:130 -#: src/settings_schema.py:147 src/settings_schema.py:164 -#: src/settings_schema.py:199 src/settings_schema.py:222 -#: src/settings_schema.py:239 +#: src/settings_schema.py:43 src/settings_schema.py:70 +#: src/settings_schema.py:97 src/settings_schema.py:124 +#: src/settings_schema.py:151 src/settings_schema.py:168 +#: src/settings_schema.py:187 src/settings_schema.py:206 +#: src/settings_schema.py:247 src/settings_schema.py:272 +#: src/settings_schema.py:289 msgid "Foreground Color" msgstr "" -#: src/settings_schema.py:28 +#: src/settings_schema.py:50 msgid "Destructive Colors" msgstr "" -#: src/settings_schema.py:29 +#: src/settings_schema.py:52 msgid "" "These colors are used for buttons to indicate a dangerous action, such as " "deleting a file." msgstr "" -#: src/settings_schema.py:51 +#: src/settings_schema.py:77 msgid "Success Colors" msgstr "" -#: src/settings_schema.py:52 +#: src/settings_schema.py:79 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, entries, and level bars, to indicate a success or a high level." msgstr "" -#: src/settings_schema.py:74 +#: src/settings_schema.py:104 msgid "Warning Colors" msgstr "" -#: src/settings_schema.py:75 +#: src/settings_schema.py:106 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, entries, and level bars, to indicate a warning or a low level." msgstr "" -#: src/settings_schema.py:97 +#: src/settings_schema.py:131 msgid "Error Colors" msgstr "" -#: src/settings_schema.py:98 +#: src/settings_schema.py:133 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, and entries, to indicate a failure." msgstr "" -#: src/settings_schema.py:120 +#: src/settings_schema.py:158 msgid "Window Colors" msgstr "" -#: src/settings_schema.py:121 +#: src/settings_schema.py:159 msgid "These colors are used primarily for windows." msgstr "" -#: src/settings_schema.py:137 +#: src/settings_schema.py:175 msgid "View Colors" msgstr "" -#: src/settings_schema.py:138 +#: src/settings_schema.py:177 msgid "" "These colors are used in a variety of widgets, such as text views and " "entries." msgstr "" -#: src/settings_schema.py:154 +#: src/settings_schema.py:194 msgid "Header Bar Colors" msgstr "" -#: src/settings_schema.py:155 +#: src/settings_schema.py:196 msgid "" "These colors are used for header bars, as well as widgets that are meant to " "be visually attached to it, such as search bars or tab bars." msgstr "" -#: src/settings_schema.py:169 +#: src/settings_schema.py:211 msgid "Border Color" msgstr "" -#: src/settings_schema.py:170 +#: src/settings_schema.py:213 msgid "" "The border color has the same default value as a foreground color, but " "doesn't change along with it. This can be useful if a light window has a " @@ -297,11 +310,11 @@ msgid "" "example, separators between the two header bars in a split header bar layout." msgstr "" -#: src/settings_schema.py:175 +#: src/settings_schema.py:219 msgid "Backdrop Color" msgstr "" -#: src/settings_schema.py:176 +#: src/settings_schema.py:221 msgid "" "The backdrop color is used instead of the background color when the window " "is not focused. By default it's an alias of the window's background color " @@ -309,113 +322,139 @@ msgid "" "it to a value matching your header bar background color." msgstr "" -#: src/settings_schema.py:181 src/settings_schema.py:204 -#: src/settings_schema.py:251 +#: src/settings_schema.py:227 src/settings_schema.py:252 +#: src/settings_schema.py:301 msgid "Shade Color" msgstr "" -#: src/settings_schema.py:182 +#: src/settings_schema.py:229 msgid "" "The shade color is used to provide a dark border for header bars and similar " "widgets that separates them from the main window." msgstr "" -#: src/settings_schema.py:189 +#: src/settings_schema.py:237 msgid "Card Colors" msgstr "" -#: src/settings_schema.py:190 +#: src/settings_schema.py:238 msgid "These colors are used for cards and boxed lists." msgstr "" -#: src/settings_schema.py:205 +#: src/settings_schema.py:254 msgid "" "The shade color is used for shadows that are used by cards to separate " "themselves from the window background, as well as for row dividers in the " "cards." msgstr "" -#: src/settings_schema.py:212 +#: src/settings_schema.py:262 msgid "Dialog Colors" msgstr "" -#: src/settings_schema.py:213 +#: src/settings_schema.py:263 msgid "These colors are used for message dialogs." msgstr "" -#: src/settings_schema.py:229 +#: src/settings_schema.py:279 msgid "Popover Colors" msgstr "" -#: src/settings_schema.py:230 +#: src/settings_schema.py:280 msgid "These colors are used for popovers." msgstr "" -#: src/settings_schema.py:246 +#: src/settings_schema.py:296 msgid "Miscalleneous Colors" msgstr "" -#: src/settings_schema.py:247 +#: src/settings_schema.py:297 msgid "Colors that don't fit in any particular group." msgstr "" -#: src/settings_schema.py:252 +#: src/settings_schema.py:303 msgid "" "The shade color is used by inline tab bars, as well as the transitions in " "leaflets and flaps, and info bar borders." msgstr "" -#: src/settings_schema.py:257 +#: src/settings_schema.py:309 msgid "Scrollbar Outline Color" msgstr "" -#: src/settings_schema.py:258 +#: src/settings_schema.py:311 msgid "" "The scrollbar outline color is used by scrollbars to ensure that overlay " "scrollbars are visible regardless of the content color." msgstr "" -#: src/settings_schema.py:267 +#: src/settings_schema.py:319 msgid "Blue" msgstr "" -#: src/settings_schema.py:272 +#: src/settings_schema.py:320 msgid "Green" msgstr "" -#: src/settings_schema.py:277 +#: src/settings_schema.py:321 msgid "Yellow" msgstr "" -#: src/settings_schema.py:282 +#: src/settings_schema.py:322 msgid "Orange" msgstr "" -#: src/settings_schema.py:287 +#: src/settings_schema.py:323 msgid "Red" msgstr "" -#: src/settings_schema.py:292 +#: src/settings_schema.py:324 msgid "Purple" msgstr "" -#: src/settings_schema.py:297 +#: src/settings_schema.py:325 msgid "Brown" msgstr "" -#: src/settings_schema.py:302 +#: src/settings_schema.py:326 msgid "Light" msgstr "" -#: src/settings_schema.py:307 +#: src/settings_schema.py:327 msgid "Dark" msgstr "" -#: src/window.py:70 +#: src/window.py:104 +msgid "Monet Engine" +msgstr "" + +#: src/window.py:107 +msgid "" +"Monet is an engine that generates Material Design 3 palette from backgrounds " +"color. The generation can be slow" +msgstr "" + +#: src/window.py:112 +msgid "Background Image" +msgstr "" + +#: src/window.py:118 +msgid "Choose a file" +msgstr "" + +#: src/window.py:137 +msgid "Tone" +msgstr "" + +#: src/window.py:149 +msgid "Theme" +msgstr "" + +#: src/window.py:189 msgid "Palette Colors" msgstr "" -#: src/window.py:71 +#: src/window.py:192 msgid "" "Named palette colors used by some applications. Default colors follow the GNOME Human " From deb7a6f40df1acb07f1d291f3c471dc81fa71cd5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:27:19 +0200 Subject: [PATCH 141/149] add devel flatpak --- .github/workflows/flatpak-nightly.yml | 4 +- ...AdwCustomizerTeam.AdwCustomizer.Devel.json | 82 +++++++++++++++++++ 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index fa297f23a..613457218 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -14,6 +14,6 @@ jobs: uses: actions/checkout@v3.0.2 - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 with: - bundle: com.github.AdwCustomizerTeam.AdwCustomizer.flatpak - manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.json + bundle: com.github.AdwCustomizerTeam.AdwCustomizer.Devel.flatpak + manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json cache-key: flatpak-builder-${{ github.sha }}-nightly \ No newline at end of file diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json b/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json new file mode 100644 index 000000000..31be453cf --- /dev/null +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json @@ -0,0 +1,82 @@ +{ + "app-id" : "com.github.AdwCustomizerTeam.AdwCustomizer", + "runtime" : "org.gnome.Platform", + "runtime-version" : "master", + "sdk" : "org.gnome.Sdk", + "command" : "adwcustomizer", + "finish-args" : [ + "--share=network", + "--share=ipc", + "--socket=fallback-x11", + "--device=dri", + "--socket=wayland", + "--filesystem=xdg-config/gtk-3.0", + "--filesystem=xdg-config/gtk-4.0" + ], + "cleanup" : [ + "/include", + "/lib/pkgconfig", + "/man", + "/share/doc", + "/share/gtk-doc", + "/share/man", + "/share/pkgconfig", + "*.la", + "*.a" + ], + "modules" : [ + "pypi-dependencies.json", + { + "name" : "blueprint-compiler", + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "url" : "https://gitlab.gnome.org/jwestman/blueprint-compiler", + "branch" : "main" + } + ] + }, + { + "name": "libportal", + "buildsystem": "meson", + "config-opts": ["-Ddocs=false", "-Dvapi=false", "-Dbackends=gtk4"], + "sources": [ + { + "type": "git", + "url": "https://github.com/flatpak/libportal", + "branch": "main" + } + ] + }, + { + "name": "material-color-utilities-python", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"material_color_utilities_python~=0.1.0\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "path": "./monet/material_color_utilities_python-0.1.0-py3-none-any.whl", + "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" + } + ] + }, + { + "name" : "adwcustomizer", + "builddir" : true, + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "path" : ".", + "branch": "next" + } + ] + } + ], + "build-options" : { + "env" : { } + } +} From e13af9f723333ad3b2311b4cf9393f2d2a9d37d8 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:28:57 +0200 Subject: [PATCH 142/149] update license --- po/AdwCustomizer.pot | 2 +- po/update_potfile.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/po/AdwCustomizer.pot b/po/AdwCustomizer.pot index 1d707805a..13f7a243a 100644 --- a/po/AdwCustomizer.pot +++ b/po/AdwCustomizer.pot @@ -1,6 +1,6 @@ # Adwaita Manager POT file # Copyright (C) 2022 Adwaita Manager Team -# This file is distributed under the MIT/X11 license. +# This file is distributed under the GNU GPLv3 license. # Adwaita Manager Team, 2022. # #, fuzzy diff --git a/po/update_potfile.sh b/po/update_potfile.sh index b20cc2c9e..8c9c7f35f 100755 --- a/po/update_potfile.sh +++ b/po/update_potfile.sh @@ -3,7 +3,7 @@ po_dir=$(dirname "$(realpath "$0")") xgettext -f "$po_dir"/POTFILES -o "$po_dir"/AdwCustomizer.pot --add-comments=Translators --keyword=_ --keyword=C_1c,2 --from-code=UTF-8 sed -i "s/SOME DESCRIPTIVE TITLE./Adwaita Manager POT file/" "$po_dir"/AdwCustomizer.pot sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/$(date +%Y) Adwaita Manager Team/" "$po_dir"/AdwCustomizer.pot -sed -i "s@same license as the PACKAGE package.@MIT/X11 license.@" "$po_dir"/AdwCustomizer.pot +sed -i "s@same license as the PACKAGE package.@GNU GPLv3 license.@" "$po_dir"/AdwCustomizer.pot sed -i "s/FIRST AUTHOR , YEAR./Adwaita Manager Team, $(date +%Y)./" "$po_dir"/AdwCustomizer.pot regex="$po_dir/([a-zA-Z_]*).po" From a9fe0b768dc3df47b20f63c3697a1b0e79e8efa4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:30:51 +0200 Subject: [PATCH 143/149] reverse button order --- src/ui/window.blp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index da2d16a8c..ba11eeb97 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -29,6 +29,12 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { stack: view_stack; } + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + [end] MenuButton presets-dropdown { menu-model: presets-menu; @@ -54,11 +60,6 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } - [end] - Gtk.MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } } From b23768a060e4f8cdae68493158d5342a0c17eaa4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:38:35 +0200 Subject: [PATCH 144/149] change card fg color --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 4849549f9..50f452655 100644 --- a/src/main.py +++ b/src/main.py @@ -278,7 +278,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), - "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), + "card_fg_color": self.rgba_from_argb(dark_theme.onSurface), "card_shade_color": self.rgba_from_argb(dark_theme.shadow), "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), From 36ec03fe62cfd1a38580200a8c55bdd2404a7939 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:49:29 +0200 Subject: [PATCH 145/149] update releases notes --- ...ustomizerTeam.AdwCustomizer.appdata.xml.in | 16 +++++++++ src/main.py | 34 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index b431f38a0..f75d2b327 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -104,6 +104,22 @@ First release of Adwaita Manager. + + Add AdwViewSwitcher in the header bar. + Move CSS to the "Advanced" tab + Move the rest to the "Colours" tab + Add Monet tab which generates a theme from a background + Add disk saved and disk unsaved icon in the header bar + Update about dialog + Change license to GNU GPLv3 + Begin plugin support + Move preset selector to a drop-down called palette (icon palette) + Add ability to apply the theme onlyfor dark theme or oy for light theme + Automaticly use Adwaita-dark preset if the user prefered scheme is dark. + Added Flatpak CI build + Added issue template for bug and feature request + `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch + diff --git a/src/main.py b/src/main.py index 50f452655..bed21e1f7 100644 --- a/src/main.py +++ b/src/main.py @@ -666,6 +666,40 @@ def show_about_window(self, *_args): copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, version=f"{info.version}", + release_notes=""" + + + Add AdwViewSwitcher in the header bar. + Move CSS to the "Advanced" tab + Move the rest to the "Colours" tab + Add Monet tab which generates a theme from a background + Add disk saved and disk unsaved icon in the header bar + Update about dialog + Change license to GNU GPLv3 + Begin plugin support + Move preset selector to a drop-down called palette (icon palette) + Add ability to apply the theme onlyfor dark theme or oy for light theme + Automaticly use Adwaita-dark preset if the user prefered scheme is dark. + Added Flatpak CI build + Added issue template for bug and feature request + `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch + + + """, + comments=""" + + Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. + + With Adwaita Manager you can: + + Change any color of Adwaita theme + Apply Material 3 colors from wallaper + Use other users presets + Change advanced options with CSS + Extend functionality using plugins + + This app is written in Python and uses GTK 4 and libadwaita. + """ ) about.present() From 262a690da3ab80eb3ca9bed8fff6b358ee981864 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:54:45 +0200 Subject: [PATCH 146/149] remove markup --- src/main.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index bed21e1f7..1f93c3fb5 100644 --- a/src/main.py +++ b/src/main.py @@ -667,7 +667,6 @@ def show_about_window(self, *_args): license_type=Gtk.License.GPL_3_0, version=f"{info.version}", release_notes=""" - Add AdwViewSwitcher in the header bar. Move CSS to the "Advanced" tab @@ -684,13 +683,11 @@ def show_about_window(self, *_args): Added issue template for bug and feature request `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch - """, comments=""" - + Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. - - With Adwaita Manager you can: +With Adwaita Manager you can: Change any color of Adwaita theme Apply Material 3 colors from wallaper @@ -698,7 +695,7 @@ def show_about_window(self, *_args): Change advanced options with CSS Extend functionality using plugins - This app is written in Python and uses GTK 4 and libadwaita. + This app is written in Python and uses GTK 4 and libadwaita. """ ) about.present() From 0afaf852d61223ed36bbf8c4eb322dbc4e3c9397 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:55:46 +0200 Subject: [PATCH 147/149] update markups --- src/main.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main.py b/src/main.py index 1f93c3fb5..027696cd3 100644 --- a/src/main.py +++ b/src/main.py @@ -685,16 +685,15 @@ def show_about_window(self, *_args): """, comments=""" - Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. With Adwaita Manager you can: - - Change any color of Adwaita theme - Apply Material 3 colors from wallaper - Use other users presets - Change advanced options with CSS - Extend functionality using plugins - + + Change any color of Adwaita theme + Apply Material 3 colors from wallaper + Use other users presets + Change advanced options with CSS + Extend functionality using plugins + This app is written in Python and uses GTK 4 and libadwaita. """ ) From 9530bbaa83a49692b2f135661095690c17c748bd Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:56:35 +0200 Subject: [PATCH 148/149] update comments --- src/main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.py b/src/main.py index 027696cd3..e4b37a242 100644 --- a/src/main.py +++ b/src/main.py @@ -685,16 +685,16 @@ def show_about_window(self, *_args): """, comments=""" - Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. +Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. With Adwaita Manager you can: - Change any color of Adwaita theme - Apply Material 3 colors from wallaper - Use other users presets - Change advanced options with CSS - Extend functionality using plugins + - Change any color of Adwaita theme + - Apply Material 3 colors from wallaper + - Use other users presets + - Change advanced options with CSS + - Extend functionality using plugins - This app is written in Python and uses GTK 4 and libadwaita. +This app is written in Python and uses GTK 4 and libadwaita. """ ) about.present() From 9c627ec3f5812e9303bbfac90502294466b72349 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:57:13 +0200 Subject: [PATCH 149/149] update markups --- src/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index e4b37a242..acd4983cc 100644 --- a/src/main.py +++ b/src/main.py @@ -689,10 +689,10 @@ def show_about_window(self, *_args): With Adwaita Manager you can: - Change any color of Adwaita theme - - Apply Material 3 colors from wallaper - - Use other users presets - - Change advanced options with CSS - - Extend functionality using plugins + - Apply Material 3 colors from wallaper + - Use other users presets + - Change advanced options with CSS + - Extend functionality using plugins This app is written in Python and uses GTK 4 and libadwaita. """
9k!HK&rNI=+w6kZCi6xLjXyXnzS|^FQu(- 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 sp!jKhc**ke5dMpW&Ger) Date: Thu, 11 Aug 2022 11:29:51 +0200 Subject: [PATCH 064/149] use local file --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index d162543b7..31be453cf 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -57,7 +57,7 @@ ], "sources": [ { - "type": "url", + "type": "file", "path": "./monet/material_color_utilities_python-0.1.0-py3-none-any.whl", "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" } From 4d74bc5cf92bbe1813f5b1e6e5e0e51a72558831 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 11:49:04 +0200 Subject: [PATCH 065/149] add tone row --- src/window.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 3a705f98a..11b6724fc 100644 --- a/src/window.py +++ b/src/window.py @@ -81,11 +81,16 @@ def on_file_picker_button_clicked(self, *args): def on_monet_file_chooser_response(self, widget, response): if response == Gtk.ResponseType.ACCEPT: - image_file = self.monet_file_chooser_dialog.get_file() - image_basename = image_file.get_basename() + self.monet_image_file = self.monet_file_chooser_dialog.get_file() + image_basename = self.monet_image_file.get_basename() self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() + self.monet_img = Image.open(self.monet_image_file) + self.monet_theme = themeFromImage(self.monet_img) + self.monet_palette = self.monet_theme["palette"] + self.get_application().update_theme_from_monet(self.monet_theme) + def setup_monet_page(self): @@ -126,6 +131,10 @@ def setup_monet_page(self): self.content_monet.add(monet_pref_group) + self.tone_row = Adw.ComboRow() + self.tone_row.set_title(_("Tone")) + print(dir(self.tone_row)) + def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() for app_type in settings_schema["custom_css_app_types"]: From aad88ff496f9aa86a198cc763b40fb002d9356aa Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:03:21 +0200 Subject: [PATCH 066/149] add tone row --- src/window.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 11b6724fc..19122fad4 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] - self.get_application().update_theme_from_monet(self.monet_theme) + #self.get_application().update_theme_from_monet(self.monet_theme, self.tone_row.get_selected_item()) def setup_monet_page(self): @@ -133,6 +133,22 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) + + store = Gtk.ListStore(str) + store_values = [ + "1", + "5", + "10", + "15", + "20", + "25", + "United Kingdom", + "United States of America", + "Uruguay", + ] + for v in store_values: + store.append([v]) + self.tone_row.set_list_factory(store) print(dir(self.tone_row)) def setup_plugins_page(self): From 07e22ed96ec3235362fe97b9eba18dc42d3e7607 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:04:09 +0200 Subject: [PATCH 067/149] update list factory --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 19122fad4..f84a5318a 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListStore(str) + store = Gtk.ListItemFactory(str) store_values = [ "1", "5", From e1ff0aa84875576437f24bf4eb582d27a9d37b03 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:04:34 +0200 Subject: [PATCH 068/149] fix bug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index f84a5318a..8353a828f 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListItemFactory(str) + store = Gtk.ListItemFactory() store_values = [ "1", "5", From ce2067fd00189e92983b24011ea4127c983e9300 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:05:14 +0200 Subject: [PATCH 069/149] add debug info --- src/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window.py b/src/window.py index 8353a828f..7bc102f3e 100644 --- a/src/window.py +++ b/src/window.py @@ -135,6 +135,7 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.ListItemFactory() + print(dir(store)) store_values = [ "1", "5", From 11448c487a8b9a63e843163b5332e1438e99268b Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:06:23 +0200 Subject: [PATCH 070/149] update tone row --- src/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 7bc102f3e..a99b42d00 100644 --- a/src/window.py +++ b/src/window.py @@ -147,8 +147,7 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - for v in store_values: - store.append([v]) + store.set_data(store_values) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From c81d7af57511aa01501975cab814d9d510c70e0d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:07:34 +0200 Subject: [PATCH 071/149] update tone row --- src/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index a99b42d00..0e61c581d 100644 --- a/src/window.py +++ b/src/window.py @@ -147,7 +147,8 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - store.set_data(store_values) + store.replace_qdata(store_values) + store.replace_data(store_values) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From 352ae0c33575f76f96b6c8371f7aa79153cafcef Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:09:18 +0200 Subject: [PATCH 072/149] use GtkStringList --- src/window.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/window.py b/src/window.py index 0e61c581d..b35550b53 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListItemFactory() + store = Gtk.StringList() print(dir(store)) store_values = [ "1", @@ -147,8 +147,8 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - store.replace_qdata(store_values) - store.replace_data(store_values) + for v in store_values: + store.append([v]) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From c50cb8d000238e685bab787f1ad7518763088934 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:09:42 +0200 Subject: [PATCH 073/149] fix error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b35550b53..b28bac1d1 100644 --- a/src/window.py +++ b/src/window.py @@ -148,7 +148,7 @@ def setup_monet_page(self): "Uruguay", ] for v in store_values: - store.append([v]) + store.append(v) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From 5744873bb80e64db6949e5ac5bff2e2f9a2df308 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:10:26 +0200 Subject: [PATCH 074/149] use set_model --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b28bac1d1..258025af3 100644 --- a/src/window.py +++ b/src/window.py @@ -149,7 +149,7 @@ def setup_monet_page(self): ] for v in store_values: store.append(v) - self.tone_row.set_list_factory(store) + self.tone_row.set_model(store) print(dir(self.tone_row)) def setup_plugins_page(self): From 35f78ffb9cfdbac53cd1468e2eb3ab99dc17db9c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:11:07 +0200 Subject: [PATCH 075/149] add tone row to the page --- src/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 258025af3..434c417a6 100644 --- a/src/window.py +++ b/src/window.py @@ -135,7 +135,6 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - print(dir(store)) store_values = [ "1", "5", @@ -150,7 +149,7 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - print(dir(self.tone_row)) + self.content_monet.add(self.tone_row) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From d3d5c3987e153922a51467b62499900a522b5895 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:11:47 +0200 Subject: [PATCH 076/149] update pref group --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 434c417a6..7ce2b1cf8 100644 --- a/src/window.py +++ b/src/window.py @@ -129,7 +129,6 @@ def setup_monet_page(self): self.palette_picker.add_suffix(picker) monet_pref_group.add(self.palette_picker) - self.content_monet.add(monet_pref_group) self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) @@ -149,7 +148,8 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - self.content_monet.add(self.tone_row) + monet_pref_group.add(self.tone_row) + self.content_monet.add(monet_pref_group) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From 7c50a5dc38c068761ecb9e509f6a62b7e301988e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:19:28 +0200 Subject: [PATCH 077/149] set colorpalette --- src/window.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/window.py b/src/window.py index 7ce2b1cf8..4ae21ec71 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,25 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] - #self.get_application().update_theme_from_monet(self.monet_theme, self.tone_row.get_selected_item()) + self.tone = self.tone_row.get_selected_item() + + i = 0 + """ + {'primary': , + 'secondary': , + 'tertiary': , + 'neutral': , + 'neutralVariant': , + 'error': } + """ + print(self.monet_palette) + print(self.monet_theme) + for color in self.monet_palette.values(): + i+=1 + color = color.tone(self.tone) + self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + + #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): @@ -119,7 +137,7 @@ def setup_monet_page(self): self.palette_picker.set_title(_("Monet Palette")) self.palette_picker self.palette_pickers = {} - for i in range(5): + for i in range(6): i = i+1 picker = Gtk.ColorButton() picker.set_name(str(i)) @@ -141,9 +159,7 @@ def setup_monet_page(self): "15", "20", "25", - "United Kingdom", - "United States of America", - "Uruguay", + "30" ] for v in store_values: store.append(v) From b2a5ddd77d5096076242d8cf9192f9079b8181ae Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:20:34 +0200 Subject: [PATCH 078/149] add debug --- src/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window.py b/src/window.py index 4ae21ec71..b554ae472 100644 --- a/src/window.py +++ b/src/window.py @@ -86,6 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() + dir(self.monet_img) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From 26a74fe18f7075f6733f52b76da136449ff534db Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:21:09 +0200 Subject: [PATCH 079/149] fix bug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b554ae472..fb291e46c 100644 --- a/src/window.py +++ b/src/window.py @@ -86,7 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - dir(self.monet_img) + dir(self.monet_image_file) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From f3755eb8a1dc1dc32a0820af5b3ae53cbba5a0da Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:21:48 +0200 Subject: [PATCH 080/149] print debug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index fb291e46c..de17ed356 100644 --- a/src/window.py +++ b/src/window.py @@ -86,7 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - dir(self.monet_image_file) + print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From dbff368414eb89e07e9d65a284aad21806b23ef0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:24:58 +0200 Subject: [PATCH 081/149] use path instead of g object --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index de17ed356..83dec7b83 100644 --- a/src/window.py +++ b/src/window.py @@ -87,7 +87,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() print(dir(self.monet_image_file)) - self.monet_img = Image.open(self.monet_image_file) + self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] self.tone = self.tone_row.get_selected_item() From 028bad472421942cd85ece601bfe80362dfccb8e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:25:47 +0200 Subject: [PATCH 082/149] fix typo error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 83dec7b83..4780fa299 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,7 @@ def on_monet_file_chooser_response(self, widget, response): print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) - self.monet_palette = self.monet_theme["palette"] + self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() i = 0 From d1aa1a93cd637ad3b5cdb7a573c21a5e2e459c29 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:27:07 +0200 Subject: [PATCH 083/149] convert into int --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 4780fa299..4f5d6a4c8 100644 --- a/src/window.py +++ b/src/window.py @@ -86,11 +86,11 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() + print(dir(self.tone)) i = 0 """ @@ -105,7 +105,7 @@ def on_monet_file_chooser_response(self, widget, response): print(self.monet_theme) for color in self.monet_palette.values(): i+=1 - color = color.tone(self.tone) + color = color.tone(int(self.tone)) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) From d08f4acba7bd2fa80014900ad50437f8b8b3df31 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:28:31 +0200 Subject: [PATCH 084/149] fix error --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 4f5d6a4c8..275917824 100644 --- a/src/window.py +++ b/src/window.py @@ -90,7 +90,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - print(dir(self.tone)) + print(dir(self.tone.get_string())) i = 0 """ @@ -105,7 +105,7 @@ def on_monet_file_chooser_response(self, widget, response): print(self.monet_theme) for color in self.monet_palette.values(): i+=1 - color = color.tone(int(self.tone)) + color = color.tone(int(self.tone.get_string())) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) From 20d21ba39cd6a7c521ba1004e13a1f550b1bd4f5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:29:49 +0200 Subject: [PATCH 085/149] print debug --- src/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 275917824..866929fe4 100644 --- a/src/window.py +++ b/src/window.py @@ -90,7 +90,6 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - print(dir(self.tone.get_string())) i = 0 """ @@ -106,8 +105,10 @@ def on_monet_file_chooser_response(self, widget, response): for color in self.monet_palette.values(): i+=1 color = color.tone(int(self.tone.get_string())) + print(color) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + self.palette_pickers["1"].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): From fd5e7ac4994d76520564c938527751523d7b26bb Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:38:57 +0200 Subject: [PATCH 086/149] add toast when reset --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index e94f41da8..3b2e0e9a2 100644 --- a/src/main.py +++ b/src/main.py @@ -433,6 +433,7 @@ def reset_color_scheme(self, widget, response): file.delete() except Exception: pass + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( From 071bcaf2145fbdd43adb394cd8083e9ebf43dfff Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:44:22 +0200 Subject: [PATCH 087/149] update palette --- src/window.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/window.py b/src/window.py index 866929fe4..0c2b77390 100644 --- a/src/window.py +++ b/src/window.py @@ -102,22 +102,33 @@ def on_monet_file_chooser_response(self, widget, response): """ print(self.monet_palette) print(self.monet_theme) + self.monet_pref_group.remove(self.palette_picker) + + self.palette_picker = Adw.ActionRow() + self.palette_picker.set_name("monet_palette") + self.palette_picker.set_title(_("Monet Palette")) + self.palette_picker + self.palette_pickers = {} + i = 0 for color in self.monet_palette.values(): - i+=1 + i = i+1 + picker = Gtk.ColorButton() + picker.set_name(str(i)) color = color.tone(int(self.tone.get_string())) - print(color) - self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) - - self.palette_pickers["1"].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + picker.set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + picker.set_valign(Gtk.Align.CENTER) + self.palette_pickers[str(i)] = picker + self.palette_picker.add_suffix(picker) + self.monet_pref_group.add(self.palette_picker) #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): - monet_pref_group = Adw.PreferencesGroup() - monet_pref_group.set_name("monet") - monet_pref_group.set_title(_("Monet Engine")) - monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + self.monet_pref_group = Adw.PreferencesGroup() + self.monet_pref_group.set_name("monet") + self.monet_pref_group.set_title(_("Monet Engine")) + self.monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -132,7 +143,7 @@ def setup_monet_page(self): self.monet_file_chooser_button.connect("clicked", self.on_file_picker_button_clicked ) self.monet_file_chooser_dialog.connect("response", self.on_monet_file_chooser_response ) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) - monet_pref_group.add(self.monet_file_chooser_row) + self.monet_pref_group.add(self.monet_file_chooser_row) self.palette_picker = Adw.ActionRow() self.palette_picker.set_name("monet_palette") @@ -147,7 +158,7 @@ def setup_monet_page(self): picker.set_valign(Gtk.Align.CENTER) self.palette_pickers[str(i)] = picker self.palette_picker.add_suffix(picker) - monet_pref_group.add(self.palette_picker) + self.monet_pref_group.add(self.palette_picker) self.tone_row = Adw.ComboRow() From 2257a5afeea8c505e8d005afa551eda5d0c3c41a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:45:10 +0200 Subject: [PATCH 088/149] fix bug --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 0c2b77390..07e160ed9 100644 --- a/src/window.py +++ b/src/window.py @@ -177,8 +177,8 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - monet_pref_group.add(self.tone_row) - self.content_monet.add(monet_pref_group) + self.monet_pref_group.add(self.tone_row) + self.content_monet.add(self.monet_pref_group) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From 160e46863ad81602915df718ee421f17772bca09 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:55:12 +0200 Subject: [PATCH 089/149] update tone generation --- src/main.py | 3 ++ src/window.py | 99 ++++++++++++++++----------------------------------- 2 files changed, 33 insertions(+), 69 deletions(-) diff --git a/src/main.py b/src/main.py index 3b2e0e9a2..cb961f23a 100644 --- a/src/main.py +++ b/src/main.py @@ -206,6 +206,9 @@ def load_preset_variables(self, preset): self.reload_variables() + def update_theme_from_monet(self, theme, tone): + pass + def generate_gtk_css(self, app_type): final_css = "" for key in self.variables.keys(): diff --git a/src/window.py b/src/window.py index 07e160ed9..394b64723 100644 --- a/src/window.py +++ b/src/window.py @@ -35,6 +35,7 @@ from .custom_css_group import AdwcustomizerCustomCSSGroup from material_color_utilities_python import * + @Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') class AdwcustomizerMainWindow(Adw.ApplicationWindow): __gtype_name__ = 'AdwcustomizerMainWindow' @@ -52,7 +53,8 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) - self.presets_dropdown.get_popover().connect("show", self.on_presets_dropdown_activate) + self.presets_dropdown.get_popover().connect( + "show", self.on_presets_dropdown_activate) self.setup_monet_page() self.setup_plugins_page() @@ -81,99 +83,54 @@ def on_file_picker_button_clicked(self, *args): def on_monet_file_chooser_response(self, widget, response): if response == Gtk.ResponseType.ACCEPT: - self.monet_image_file = self.monet_file_chooser_dialog.get_file() + self.monet_image_file = self.monet_file_chooser_dialog.get_file() image_basename = self.monet_image_file.get_basename() self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) - self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - - i = 0 - """ - {'primary': , - 'secondary': , - 'tertiary': , - 'neutral': , - 'neutralVariant': , - 'error': } - """ - print(self.monet_palette) - print(self.monet_theme) - self.monet_pref_group.remove(self.palette_picker) - - self.palette_picker = Adw.ActionRow() - self.palette_picker.set_name("monet_palette") - self.palette_picker.set_title(_("Monet Palette")) - self.palette_picker - self.palette_pickers = {} - i = 0 - for color in self.monet_palette.values(): - i = i+1 - picker = Gtk.ColorButton() - picker.set_name(str(i)) - color = color.tone(int(self.tone.get_string())) - picker.set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) - picker.set_valign(Gtk.Align.CENTER) - self.palette_pickers[str(i)] = picker - self.palette_picker.add_suffix(picker) - self.monet_pref_group.add(self.palette_picker) - #self.get_application().update_theme_from_monet(self.monet_theme) + self.get_application().update_theme_from_monet(self.monet_theme, self.tone) def setup_monet_page(self): - self.monet_pref_group = Adw.PreferencesGroup() self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) - self.monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + self.monet_pref_group.set_description( + _("Monet is an engine that generates Material Design 3 palette from backgrounds color")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) - + self.monet_file_chooser_dialog = Gtk.FileChooserNative() self.monet_file_chooser_dialog.set_transient_for(self) self.monet_file_chooser_button = Gtk.Button() self.monet_file_chooser_button.set_label(_("Choose a file")) - self.monet_file_chooser_button.set_icon_name("folder-pictures-symbolic") + self.monet_file_chooser_button.set_icon_name( + "folder-pictures-symbolic") - self.monet_file_chooser_button.connect("clicked", self.on_file_picker_button_clicked ) - self.monet_file_chooser_dialog.connect("response", self.on_monet_file_chooser_response ) + self.monet_file_chooser_button.connect( + "clicked", self.on_file_picker_button_clicked) + self.monet_file_chooser_dialog.connect( + "response", self.on_monet_file_chooser_response) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) self.monet_pref_group.add(self.monet_file_chooser_row) - self.palette_picker = Adw.ActionRow() - self.palette_picker.set_name("monet_palette") - self.palette_picker.set_title(_("Monet Palette")) - self.palette_picker - self.palette_pickers = {} - for i in range(6): - i = i+1 - picker = Gtk.ColorButton() - picker.set_name(str(i)) - picker.set_rgba(Gdk.RGBA(red=0, green=0, blue=0, alpha=0)) - picker.set_valign(Gtk.Align.CENTER) - self.palette_pickers[str(i)] = picker - self.palette_picker.add_suffix(picker) + self.monet_palette_shades = AdwcustomizerPaletteShades("monet", + "Monet Palette", + 6) self.monet_pref_group.add(self.palette_picker) - self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - store_values = [ - "1", - "5", - "10", - "15", - "20", - "25", - "30" - ] + store_values = ["1"] + for i in range(5, 100, 5): + store_values.append(str(i)) for v in store_values: store.append(v) self.tone_row.set_model(store) @@ -198,26 +155,29 @@ def setup_colors_page(self): for variable in group["variables"]: pref_variable = AdwcustomizerOption(variable["name"], variable["title"], - variable.get("explanation"), + variable.get( + "explanation"), variable["adw_gtk3_support"]) pref_group.add(pref_variable) - self.get_application().pref_variables[variable["name"]] = pref_variable + self.get_application( + ).pref_variables[variable["name"]] = pref_variable self.content.add(pref_group) palette_pref_group = Adw.PreferencesGroup() palette_pref_group.set_name("palette_colors") palette_pref_group.set_title(_("Palette Colors")) - palette_pref_group.set_description(_("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) + palette_pref_group.set_description( + _("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) for color in settings_schema["palette"]: palette_shades = AdwcustomizerPaletteShades(color["prefix"], color["title"], color["n_shades"]) palette_pref_group.add(palette_shades) - self.get_application().pref_palette_shades[color["prefix"]] = palette_shades + self.get_application( + ).pref_palette_shades[color["prefix"]] = palette_shades self.content.add(palette_pref_group) - def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) while child is not None: @@ -225,7 +185,8 @@ def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) self.errors_button.set_visible(len(errors) > 0) for error in errors: - self.errors_list.append(AdwcustomizerError(error["error"], error["element"], error["line"])) + self.errors_list.append(AdwcustomizerError( + error["error"], error["element"], error["line"])) def on_presets_dropdown_activate(self, *args): self.get_application().reload_user_defined_presets() From 5d6f4697e512f1016f194709edbd054e00694e87 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:55:49 +0200 Subject: [PATCH 090/149] fix error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 394b64723..67ca2771b 100644 --- a/src/window.py +++ b/src/window.py @@ -122,7 +122,7 @@ def setup_monet_page(self): self.monet_palette_shades = AdwcustomizerPaletteShades("monet", "Monet Palette", 6) - self.monet_pref_group.add(self.palette_picker) + self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) From 93f07e1ff673d3c187ddc776cc3fef445807cd58 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:57:29 +0200 Subject: [PATCH 091/149] add 0xMRTT as translator --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index cb961f23a..a8671c20e 100644 --- a/src/main.py +++ b/src/main.py @@ -449,8 +449,8 @@ def show_about_window(self, *_args): issue_url="https://github.com/AdwCustomizerTeam/AdwCustomizer/issues", developers=[ 'Artyom "ArtyIF" Fomin https://github.com/ArtyIF', - "Verantor https://github.com/Verantor", "0xMRTT https://github.com/0xMRTT", + "Verantor https://github.com/Verantor", ], artists=[ 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' @@ -466,6 +466,7 @@ def show_about_window(self, *_args): Renato Corrêa https://www.transifex.com/user/profile/renatocrrs/ Aggelos Tselios https://www.transifex.com/user/profile/AndroGR/ David "Daudix UFO" Lapshin https://github.com/daudix-UFO' + 0xMRTT https://github.com/0xMRTT Juanjo Cillero https://www.transifex.com/user/profile/renux918/ Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", From f390b01cda4ac7e39caccb1433dcca37a8dc9ec4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 13:02:13 +0200 Subject: [PATCH 092/149] remove PR --- .github/workflows/flatpak-nightly.yml | 1 - .github/workflows/flatpak.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index e05befe07..fa297f23a 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -2,7 +2,6 @@ name: Build flatpak nightly on: push: branches: [next] - pull_request: jobs: flatpak: name: "Flatpak" diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 8d1b02d48..69360a41c 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -2,7 +2,6 @@ name: Build flatpak on: push: branches: [main] - pull_request: jobs: flatpak: name: "Flatpak" From 9aae287cb07333be89d0374f74bed067f8a56366 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:22:08 +0200 Subject: [PATCH 093/149] use palette shades --- src/main.py | 11 ++++++++++- src/window.py | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a8671c20e..f4c360cdd 100644 --- a/src/main.py +++ b/src/main.py @@ -26,6 +26,7 @@ import gi from gi.repository import Gtk, Gdk, Gio, Adw, GLib, Xdp, XdpGtk4 +from material_color_utilities_python import * from .settings_schema import settings_schema from .window import AdwcustomizerMainWindow @@ -207,7 +208,15 @@ def load_preset_variables(self, preset): self.reload_variables() def update_theme_from_monet(self, theme, tone): - pass + palettes = theme["palettes"] + + palette = {} + i = 0 + for color in palettes.values(): + i += 1 + palette[str(i)] = hexFromArgb(color.tone(tone)) + + self.pref_palette_shades["monet"].update_shades() def generate_gtk_css(self, app_type): final_css = "" diff --git a/src/window.py b/src/window.py index 67ca2771b..b92e6eeed 100644 --- a/src/window.py +++ b/src/window.py @@ -122,6 +122,8 @@ def setup_monet_page(self): self.monet_palette_shades = AdwcustomizerPaletteShades("monet", "Monet Palette", 6) + self.get_application( + ).pref_palette_shades["monet"] = self.monet_palette_shades self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() From 91d7e5f7bb578df08e07bcb1e326e332b8a108bc Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:23:31 +0200 Subject: [PATCH 094/149] fix error --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index f4c360cdd..274dae147 100644 --- a/src/main.py +++ b/src/main.py @@ -214,7 +214,7 @@ def update_theme_from_monet(self, theme, tone): i = 0 for color in palettes.values(): i += 1 - palette[str(i)] = hexFromArgb(color.tone(tone)) + palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) self.pref_palette_shades["monet"].update_shades() From c98f8df6101f5fad3639dc9f3423073d85837eac Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:24:16 +0200 Subject: [PATCH 095/149] add missin arg --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 274dae147..fbaf678a4 100644 --- a/src/main.py +++ b/src/main.py @@ -216,7 +216,7 @@ def update_theme_from_monet(self, theme, tone): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) - self.pref_palette_shades["monet"].update_shades() + self.pref_palette_shades["monet"].update_shades(palette) def generate_gtk_css(self, app_type): final_css = "" From 3ad2ebc2586d394dcb40e421a4270512f7f36226 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:25:48 +0200 Subject: [PATCH 096/149] add debug --- src/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.py b/src/main.py index fbaf678a4..ff7dceddf 100644 --- a/src/main.py +++ b/src/main.py @@ -216,6 +216,8 @@ def update_theme_from_monet(self, theme, tone): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) + print(palette) + self.pref_palette_shades["monet"].update_shades(palette) def generate_gtk_css(self, app_type): From b26d9a8df76e83ad27f41280a857f60f40273644 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:45:45 +0200 Subject: [PATCH 097/149] remove tone 1 --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b92e6eeed..efc166bea 100644 --- a/src/window.py +++ b/src/window.py @@ -130,7 +130,7 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - store_values = ["1"] + store_values = [] for i in range(5, 100, 5): store_values.append(str(i)) for v in store_values: From d5bce25c1e699e947049bfa4af0c4e1159fa006d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:55:00 +0200 Subject: [PATCH 098/149] add theme row --- src/window.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/window.py b/src/window.py index efc166bea..5bfb54f19 100644 --- a/src/window.py +++ b/src/window.py @@ -137,6 +137,16 @@ def setup_monet_page(self): store.append(v) self.tone_row.set_model(store) self.monet_pref_group.add(self.tone_row) + + self.monet_theme_row = Adw.ComboRow() + self.monet_theme_row.set_title(_("Theme")) + + store = Gtk.StringList() + store.append("Dark") + store.append("Light") + self.monet_theme_row.set_model(store) + self.monet_pref_group.add(self.monet_theme_row) + self.content_monet.add(self.monet_pref_group) def setup_plugins_page(self): From e2c9b1717836ff21233cecb7e7b102fedc181f08 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:00:07 +0200 Subject: [PATCH 099/149] add monet theme selector --- src/main.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++- src/window.py | 3 ++- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index ff7dceddf..a37cd3993 100644 --- a/src/main.py +++ b/src/main.py @@ -207,9 +207,11 @@ def load_preset_variables(self, preset): self.reload_variables() - def update_theme_from_monet(self, theme, tone): + def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] + monet_theme = monet_theme.get_string() + palette = {} i = 0 for color in palettes.values(): @@ -220,6 +222,56 @@ def update_theme_from_monet(self, theme, tone): self.pref_palette_shades["monet"].update_shades(palette) + print(theme) + + self.variable = { + "accent_color": theme["schemes"]["light"]["primary"], + "accent_bg_color": theme["schemes"]["light"]["primaryContainer"], + "accent_fg_color": theme["schemes"]["light"]["onPrimaryContainer"], + + "destructive_color": theme["schemes"]["light"][""], + "destructive_bg_color": theme["schemes"]["light"][""], + "destructive_fg_color": theme["schemes"]["light"][""], + + "success_color": theme["schemes"]["light"][""], + "success_bg_color": theme["schemes"]["light"][""], + "success_fg_color": theme["schemes"]["light"][""], + + "warning_color": theme["schemes"]["light"][""], + "warning_bg_color": theme["schemes"]["light"][""], + "warning_fg_color": "rgba(0, 0, 0, 0.8)", + + "error_color": theme["schemes"]["light"][""], + "error_bg_color": theme["schemes"]["light"][""], + "error_fg_color": theme["schemes"]["light"][""], + + "window_bg_color": theme["schemes"]["light"][""], + "window_fg_color": theme["schemes"]["light"][""], + + "view_bg_color": theme["schemes"]["light"][""], + "view_fg_color": theme["schemes"]["light"][""], + + "headerbar_bg_color": theme["schemes"]["light"][""], + "headerbar_fg_color": "rgba(0, 0, 0, 0.8)", + "headerbar_border_color": "rgba(0, 0, 0, 0.8)", + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": "rgba(0, 0, 0, 0.07)", + + "card_bg_color": theme["schemes"]["light"][""], + "card_fg_color": "rgba(0, 0, 0, 0.8)", + "card_shade_color": "rgba(0, 0, 0, 0.07)", + + "dialog_bg_color": theme["schemes"]["light"][""], + "dialog_fg_color": "rgba(0, 0, 0, 0.8)", + + "popover_bg_color": theme["schemes"]["light"][""], + "popover_fg_color": "rgba(0, 0, 0, 0.8)", + + "shade_color": theme["schemes"]["light"][""], + "scrollbar_outline_color": theme["schemes"]["light"][""] + } + + def generate_gtk_css(self, app_type): final_css = "" for key in self.variables.keys(): diff --git a/src/window.py b/src/window.py index 5bfb54f19..d38272320 100644 --- a/src/window.py +++ b/src/window.py @@ -91,7 +91,8 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() - self.get_application().update_theme_from_monet(self.monet_theme, self.tone) + self.monet_theme = self.monet_theme_row.get_selected_item() + self.get_application().update_theme_from_monet(self.monet_theme, self.tone, self.monet_theme) def setup_monet_page(self): From d2bde49e06d23a38d29d181bd8d80c38e56e9f68 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:00:33 +0200 Subject: [PATCH 100/149] add debug info --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index a37cd3993..c0d609958 100644 --- a/src/main.py +++ b/src/main.py @@ -222,6 +222,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): self.pref_palette_shades["monet"].update_shades(palette) + print(monet_theme) print(theme) self.variable = { From 47c4218523062b457958d1a3048eca133d6084fa Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:03:57 +0200 Subject: [PATCH 101/149] fix duplicated name --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index d38272320..08e14604d 100644 --- a/src/window.py +++ b/src/window.py @@ -89,10 +89,10 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() self.monet_img = Image.open(self.monet_image_file.get_path()) - self.monet_theme = themeFromImage(self.monet_img) + self.theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.monet_theme, self.tone, self.monet_theme) + self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) def setup_monet_page(self): From f5f8580b2e1a5ba31ea2dc6079ff7dcc1a498705 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:39:31 +0200 Subject: [PATCH 102/149] add automatic theme generation. Need test --- src/main.py | 137 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 101 insertions(+), 36 deletions(-) diff --git a/src/main.py b/src/main.py index c0d609958..314d21aeb 100644 --- a/src/main.py +++ b/src/main.py @@ -207,10 +207,22 @@ def load_preset_variables(self, preset): self.reload_variables() + + def rgba_from_argb(self, argb, alpha = None) -> str: + base = "rgba({}, {}, {}, {})" + + red = redFromArgb(argb) + green = greenFromArgb(argb) + blue = blueFromArgb(argb) + if not alpha: + alpha = alphaFromArgb(argb) + + return base.format(red, green, blue, alpha) + def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] - monet_theme = monet_theme.get_string() + monet_theme = monet_theme.get_string().lower() # dark / light palette = {} i = 0 @@ -225,53 +237,106 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(monet_theme) print(theme) - self.variable = { - "accent_color": theme["schemes"]["light"]["primary"], - "accent_bg_color": theme["schemes"]["light"]["primaryContainer"], - "accent_fg_color": theme["schemes"]["light"]["onPrimaryContainer"], + if monet_theme == "dark": + dark_theme = theme["schemes"]["dark"].toJSON() + self.variable = { + "accent_color": dark_theme["primary"], + "accent_bg_color": dark_theme["primaryContainer"], + "accent_fg_color": dark_theme["onPrimaryContainer"], + + "destructive_color": dark_theme["error"], + "destructive_bg_color": dark_theme["errorContainer"], + "destructive_fg_color": dark_theme["onError"], + + "success_color": dark_theme["tertiary"], + "success_bg_color": dark_theme["onTertiary"], + "success_fg_color": dark_theme["tertiaryContainer"], + + "warning_color": dark_theme["secondaryContainer"], + "warning_bg_color": dark_theme["inversePrimary"], + "warning_fg_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + + "error_color": dark_theme["error"], + "error_bg_color": dark_theme["errorContainer"], + "error_fg_color": dark_theme["onError"], + + "window_bg_color": dark_theme["surface"], + "window_fg_color": dark_theme["onSurface"], - "destructive_color": theme["schemes"]["light"][""], - "destructive_bg_color": theme["schemes"]["light"][""], - "destructive_fg_color": theme["schemes"]["light"][""], + "view_bg_color": dark_theme["surface"], + "view_fg_color": dark_theme["onSurface"], - "success_color": theme["schemes"]["light"][""], - "success_bg_color": theme["schemes"]["light"][""], - "success_fg_color": theme["schemes"]["light"][""], + "headerbar_bg_color": dark_theme["surface"], + "headerbar_fg_color": dark_theme["onSurface"], + "headerbar_border_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": dark_theme["shadow"], - "warning_color": theme["schemes"]["light"][""], - "warning_bg_color": theme["schemes"]["light"][""], - "warning_fg_color": "rgba(0, 0, 0, 0.8)", + "card_bg_color": self.rgba_from_argb(dark_theme["primary"], "0.05"), + "card_fg_color": dark_theme["surfaceVariant"], + "card_shade_color": dark_theme["shadow"], - "error_color": theme["schemes"]["light"][""], - "error_bg_color": theme["schemes"]["light"][""], - "error_fg_color": theme["schemes"]["light"][""], + "dialog_bg_color": dark_theme["secondaryContainer"], + "dialog_fg_color": dark_theme["onSecondaryContainer"], - "window_bg_color": theme["schemes"]["light"][""], - "window_fg_color": theme["schemes"]["light"][""], + "popover_bg_color": dark_theme["secondaryContainer"], + "popover_fg_color": dark_theme["onSecondaryContainer"], - "view_bg_color": theme["schemes"]["light"][""], - "view_fg_color": theme["schemes"]["light"][""], + "shade_color": dark_theme["shadow"], + "scrollbar_outline_color": dark_theme["outline"] + } + else: # light + light_theme = theme["schemes"]["light"].toJSON() + self.variable = { + "accent_color": light_theme["primary"], + "accent_bg_color": light_theme["primaryContainer"], + "accent_fg_color": light_theme["onPrimaryContainer"], - "headerbar_bg_color": theme["schemes"]["light"][""], - "headerbar_fg_color": "rgba(0, 0, 0, 0.8)", - "headerbar_border_color": "rgba(0, 0, 0, 0.8)", - "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": "rgba(0, 0, 0, 0.07)", + "destructive_color": light_theme["error"], + "destructive_bg_color": light_theme["errorContainer"], + "destructive_fg_color": light_theme["onError"], - "card_bg_color": theme["schemes"]["light"][""], - "card_fg_color": "rgba(0, 0, 0, 0.8)", - "card_shade_color": "rgba(0, 0, 0, 0.07)", + "success_color": light_theme["tertiary"], + "success_bg_color": light_theme["onTertiary"], + "success_fg_color": light_theme["tertiaryContainer"], - "dialog_bg_color": theme["schemes"]["light"][""], - "dialog_fg_color": "rgba(0, 0, 0, 0.8)", + "warning_color": light_theme["secondaryContainer"], + "warning_bg_color": light_theme["inversePrimary"], + "warning_fg_color": self.rgba_from_argb(light_theme["primary"], "0.8"), - "popover_bg_color": theme["schemes"]["light"][""], - "popover_fg_color": "rgba(0, 0, 0, 0.8)", + "error_color": light_theme["error"], + "error_bg_color": light_theme["errorContainer"], + "error_fg_color": light_theme["onError"], - "shade_color": theme["schemes"]["light"][""], - "scrollbar_outline_color": theme["schemes"]["light"][""] - } + "window_bg_color": light_theme["surface"], + "window_fg_color": light_theme["onSurface"], + "view_bg_color": light_theme["surface"], + "view_fg_color": light_theme["onSurface"], + + "headerbar_bg_color": light_theme["surface"], + "headerbar_fg_color": light_theme["onSurface"], + "headerbar_border_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": light_theme["shadow"], + + "card_bg_color": self.rgba_from_argb(light_theme["primary"], "0.05"), + "card_fg_color": light_theme["surfaceVariant"], + "card_shade_color": light_theme["shadow"], + + "dialog_bg_color": light_theme["secondaryContainer"], + "dialog_fg_color": light_theme["onSecondaryContainer"], + + "popover_bg_color": light_theme["secondaryContainer"], + "popover_fg_color": light_theme["onSecondaryContainer"], + + "shade_color": light_theme["shadow"], + "scrollbar_outline_color": light_theme["outline"] + } + + for key in self.variables.keys(): + if key in self.pref_variables: + self.pref_variables[key].update_value(self.variables[key]) def generate_gtk_css(self, app_type): final_css = "" From eb52f52fbb6c7fe4dc92771af839a39776c0e840 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:41:46 +0200 Subject: [PATCH 103/149] fix error --- src/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 314d21aeb..9e08e3b0d 100644 --- a/src/main.py +++ b/src/main.py @@ -239,7 +239,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"].toJSON() - self.variable = { + variable = { "accent_color": dark_theme["primary"], "accent_bg_color": dark_theme["primaryContainer"], "accent_fg_color": dark_theme["onPrimaryContainer"], @@ -287,7 +287,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): } else: # light light_theme = theme["schemes"]["light"].toJSON() - self.variable = { + variable = { "accent_color": light_theme["primary"], "accent_bg_color": light_theme["primaryContainer"], "accent_fg_color": light_theme["onPrimaryContainer"], @@ -334,9 +334,9 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "scrollbar_outline_color": light_theme["outline"] } - for key in self.variables.keys(): + for key in variables.keys(): if key in self.pref_variables: - self.pref_variables[key].update_value(self.variables[key]) + self.pref_variables[key].update_value(variables[key]) def generate_gtk_css(self, app_type): final_css = "" From 8c25c94e9545968462508b63e50772cff267050c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:44:12 +0200 Subject: [PATCH 104/149] add reload --- src/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.py b/src/main.py index 9e08e3b0d..0dab116bd 100644 --- a/src/main.py +++ b/src/main.py @@ -337,6 +337,8 @@ def update_theme_from_monet(self, theme, tone, monet_theme): for key in variables.keys(): if key in self.pref_variables: self.pref_variables[key].update_value(variables[key]) + + self.reload_variables() def generate_gtk_css(self, app_type): final_css = "" From aada5ae201fd69e6ec9a7e8458eda551b912f6f0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:46:00 +0200 Subject: [PATCH 105/149] add conditon --- src/window.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/window.py b/src/window.py index 08e14604d..205942adc 100644 --- a/src/window.py +++ b/src/window.py @@ -88,11 +88,12 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - self.monet_img = Image.open(self.monet_image_file.get_path()) - self.theme = themeFromImage(self.monet_img) - self.tone = self.tone_row.get_selected_item() - self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) + if response == Gtk.ResponseType.ACCEPT: + self.monet_img = Image.open(self.monet_image_file.get_path()) + self.theme = themeFromImage(self.monet_img) + self.tone = self.tone_row.get_selected_item() + self.monet_theme = self.monet_theme_row.get_selected_item() + self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) def setup_monet_page(self): From df673661572dccafe6ee7d0aad165b7e7905d29c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:57:41 +0200 Subject: [PATCH 106/149] fix error --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 0dab116bd..4089c2bb2 100644 --- a/src/main.py +++ b/src/main.py @@ -240,7 +240,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"].toJSON() variable = { - "accent_color": dark_theme["primary"], + "accent_color": dark_theme.primary, "accent_bg_color": dark_theme["primaryContainer"], "accent_fg_color": dark_theme["onPrimaryContainer"], @@ -334,9 +334,9 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "scrollbar_outline_color": light_theme["outline"] } - for key in variables.keys(): + for key in variable.keys(): if key in self.pref_variables: - self.pref_variables[key].update_value(variables[key]) + self.pref_variables[key].update_value(variable[key]) self.reload_variables() From 686035177b84911702658937f9e43bcbee7e2173 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:58:53 +0200 Subject: [PATCH 107/149] fix bug --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 4089c2bb2..a8870f66b 100644 --- a/src/main.py +++ b/src/main.py @@ -238,11 +238,11 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(theme) if monet_theme == "dark": - dark_theme = theme["schemes"]["dark"].toJSON() + dark_theme = theme["schemes"]["dark"] variable = { "accent_color": dark_theme.primary, - "accent_bg_color": dark_theme["primaryContainer"], - "accent_fg_color": dark_theme["onPrimaryContainer"], + "accent_bg_color": dark_theme.primaryContainer, + "accent_fg_color": dark_theme.onPrimaryContainer, "destructive_color": dark_theme["error"], "destructive_bg_color": dark_theme["errorContainer"], From a4f48a11b44b4d988423015097f967923932c390 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:03:34 +0200 Subject: [PATCH 108/149] update dark sheme --- src/main.py | 60 ++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/main.py b/src/main.py index a8870f66b..143e5d934 100644 --- a/src/main.py +++ b/src/main.py @@ -244,49 +244,49 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_bg_color": dark_theme.primaryContainer, "accent_fg_color": dark_theme.onPrimaryContainer, - "destructive_color": dark_theme["error"], - "destructive_bg_color": dark_theme["errorContainer"], - "destructive_fg_color": dark_theme["onError"], + "destructive_color": dark_theme.error, + "destructive_bg_color": dark_theme.errorContainer, + "destructive_fg_color": dark_theme.onError, - "success_color": dark_theme["tertiary"], - "success_bg_color": dark_theme["onTertiary"], - "success_fg_color": dark_theme["tertiaryContainer"], + "success_color": dark_theme.tertiary, + "success_bg_color": dark_theme.onTertiary, + "success_fg_color": dark_theme.tertiaryContainer, - "warning_color": dark_theme["secondaryContainer"], - "warning_bg_color": dark_theme["inversePrimary"], - "warning_fg_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "warning_color": dark_theme.secondaryContainer, + "warning_bg_color": dark_theme.inversePrimary, + "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": dark_theme["error"], - "error_bg_color": dark_theme["errorContainer"], - "error_fg_color": dark_theme["onError"], + "error_color": dark_theme.error, + "error_bg_color": dark_theme.errorContainer, + "error_fg_color": dark_theme.onError, - "window_bg_color": dark_theme["surface"], - "window_fg_color": dark_theme["onSurface"], + "window_bg_color": dark_theme.surface, + "window_fg_color": dark_theme.onSurface, - "view_bg_color": dark_theme["surface"], - "view_fg_color": dark_theme["onSurface"], + "view_bg_color": dark_theme.surface, + "view_fg_color": dark_theme.onSurface, - "headerbar_bg_color": dark_theme["surface"], - "headerbar_fg_color": dark_theme["onSurface"], - "headerbar_border_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "headerbar_bg_color": dark_theme.surface, + "headerbar_fg_color": dark_theme.onSurface, + "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": dark_theme["shadow"], + "headerbar_shade_color": dark_theme.shadow, - "card_bg_color": self.rgba_from_argb(dark_theme["primary"], "0.05"), - "card_fg_color": dark_theme["surfaceVariant"], - "card_shade_color": dark_theme["shadow"], + "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), + "card_fg_color": dark_theme.surfaceVariant, + "card_shade_color": dark_theme.shadow, - "dialog_bg_color": dark_theme["secondaryContainer"], - "dialog_fg_color": dark_theme["onSecondaryContainer"], + "dialog_bg_color": dark_theme.secondaryContainer, + "dialog_fg_color": dark_theme.onSecondaryContainer, - "popover_bg_color": dark_theme["secondaryContainer"], - "popover_fg_color": dark_theme["onSecondaryContainer"], + "popover_bg_color": dark_theme.secondaryContainer, + "popover_fg_color": dark_theme.onSecondaryContainer, - "shade_color": dark_theme["shadow"], - "scrollbar_outline_color": dark_theme["outline"] + "shade_color": dark_theme.shadow, + "scrollbar_outline_color": dark_theme.outline } else: # light - light_theme = theme["schemes"]["light"].toJSON() + light_theme = theme["schemes"]["light"] variable = { "accent_color": light_theme["primary"], "accent_bg_color": light_theme["primaryContainer"], From 2382062177dc2b6be2ec8508a9adac34753d51c0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:06:55 +0200 Subject: [PATCH 109/149] convert to rgba --- src/main.py | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/main.py b/src/main.py index 143e5d934..c7231e161 100644 --- a/src/main.py +++ b/src/main.py @@ -240,50 +240,50 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"] variable = { - "accent_color": dark_theme.primary, - "accent_bg_color": dark_theme.primaryContainer, - "accent_fg_color": dark_theme.onPrimaryContainer, + "accent_color": self.rgba_from_argb(dark_theme.primary), + "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), + "accent_fg_color": self.rgba_from_argb(dark_theme.onPrimaryContainer), - "destructive_color": dark_theme.error, - "destructive_bg_color": dark_theme.errorContainer, - "destructive_fg_color": dark_theme.onError, + "destructive_color": self.rgba_from_argb(dark_theme.error), + "destructive_bg_color": self.rgba_from_argb(dark_theme.errorContainer), + "destructive_fg_color": self.rgba_from_argb(dark_theme.onError), - "success_color": dark_theme.tertiary, - "success_bg_color": dark_theme.onTertiary, - "success_fg_color": dark_theme.tertiaryContainer, + "success_color": self.rgba_from_argb(dark_theme.tertiary), + "success_bg_color": self.rgba_from_argb(dark_theme.onTertiary), + "success_fg_color": self.rgba_from_argb(dark_theme.tertiaryContainer), - "warning_color": dark_theme.secondaryContainer, - "warning_bg_color": dark_theme.inversePrimary, + "warning_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "warning_bg_color": self.rgba_from_argb(dark_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": dark_theme.error, - "error_bg_color": dark_theme.errorContainer, - "error_fg_color": dark_theme.onError, + "error_color": self.rgba_from_argb(dark_theme.error), + "error_bg_color": self.rgba_from_argb(dark_theme.errorContainer), + "error_fg_color": self.rgba_from_argb(dark_theme.onError), - "window_bg_color": dark_theme.surface, - "window_fg_color": dark_theme.onSurface, + "window_bg_color": self.rgba_from_argb(dark_theme.surface), + "window_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "view_bg_color": dark_theme.surface, - "view_fg_color": dark_theme.onSurface, + "view_bg_color": self.rgba_from_argb(dark_theme.surface), + "view_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_bg_color": dark_theme.surface, - "headerbar_fg_color": dark_theme.onSurface, + "headerbar_bg_color": self.rgba_from_argb(dark_theme.surface), + "headerbar_fg_color": self.rgba_from_argb(dark_theme.onSurface), "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": dark_theme.shadow, + "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), - "card_fg_color": dark_theme.surfaceVariant, - "card_shade_color": dark_theme.shadow, + "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), + "card_shade_color": self.rgba_from_argb(dark_theme.shadow), - "dialog_bg_color": dark_theme.secondaryContainer, - "dialog_fg_color": dark_theme.onSecondaryContainer, + "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "popover_bg_color": dark_theme.secondaryContainer, - "popover_fg_color": dark_theme.onSecondaryContainer, + "popover_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "popover_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "shade_color": dark_theme.shadow, - "scrollbar_outline_color": dark_theme.outline + "shade_color": self.rgba_from_argb(dark_theme.shadow), + "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) } else: # light light_theme = theme["schemes"]["light"] From 1b12e486244c38b0a0d14f59cd01be66825e4cd0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:17:35 +0200 Subject: [PATCH 110/149] update tones --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 205942adc..e5f413426 100644 --- a/src/window.py +++ b/src/window.py @@ -101,7 +101,7 @@ def setup_monet_page(self): self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) self.monet_pref_group.set_description( - _("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + _("Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -133,7 +133,7 @@ def setup_monet_page(self): store = Gtk.StringList() store_values = [] - for i in range(5, 100, 5): + for i in range(20, 80, 5): store_values.append(str(i)) for v in store_values: store.append(v) From 0324b9575947bacabbf1099c2107cd3e5491dc08 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:22:34 +0200 Subject: [PATCH 111/149] add automatic preset load --- src/main.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index c7231e161..92fa90dd4 100644 --- a/src/main.py +++ b/src/main.py @@ -96,9 +96,17 @@ def do_activate(self): self.create_action("about", self.show_about_window) self.reload_user_defined_presets() - self.load_preset_from_resource( - "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita.json" - ) + + self.style_manager = Adw.StyleManager.get_default() + + if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: + self.load_preset_from_resource( + "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" + ) + else: + self.load_preset_from_resource( + "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita.json" + ) self.win.present() From f996aeeaccec757a7cca2cadf3826a373f770b92 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:23:08 +0200 Subject: [PATCH 112/149] add debug --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index 92fa90dd4..3a430c01d 100644 --- a/src/main.py +++ b/src/main.py @@ -99,6 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() + print(self.style_manager.get_color_scheme()) if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From 7bf5edf685f16b39bc8870924be508fca5278e34 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:24:40 +0200 Subject: [PATCH 113/149] add more debug --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 3a430c01d..661823e7f 100644 --- a/src/main.py +++ b/src/main.py @@ -98,8 +98,9 @@ def do_activate(self): self.reload_user_defined_presets() self.style_manager = Adw.StyleManager.get_default() - + print(dir(self.style_manager)) print(self.style_manager.get_color_scheme()) + print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From e939dcdd1722e8790964544e8665721ec61e793d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:25:41 +0200 Subject: [PATCH 114/149] fix bug --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 661823e7f..8a2c5bc14 100644 --- a/src/main.py +++ b/src/main.py @@ -99,9 +99,10 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) + print(self.style_manager.get_default()) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) - if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: + if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" ) From 004bf83923814f8d75d30179de80a9f2b12d76b5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:26:48 +0200 Subject: [PATCH 115/149] add debug --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 8a2c5bc14..e7c33d578 100644 --- a/src/main.py +++ b/src/main.py @@ -99,7 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) - print(self.style_manager.get_default()) + print(dir(self.style_manager.get_default())) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: From 3339808f0a28dd33710138e43516508069c986d0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:28:27 +0200 Subject: [PATCH 116/149] add debug --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index e7c33d578..4eceea150 100644 --- a/src/main.py +++ b/src/main.py @@ -100,6 +100,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) print(dir(self.style_manager.get_default())) + print(self.style_manager.get_default().get_color_scheme()) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: From aff7cf44f647e3d2fd89dfeabaf543c03f5f4198 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:33:27 +0200 Subject: [PATCH 117/149] fix style manager --- src/main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 4eceea150..e19935439 100644 --- a/src/main.py +++ b/src/main.py @@ -99,10 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) - print(dir(self.style_manager.get_default())) - print(self.style_manager.get_default().get_color_scheme()) - print(self.style_manager.get_color_scheme()) - print(dir(self.style_manager.get_color_scheme())) + print(self.style_manager.get_dark()) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From 8f2b40d01fe75f1ef4b3c412829d396d1f4e7568 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:34:28 +0200 Subject: [PATCH 118/149] add automatic preset choice if dark or ligjt --- src/main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index e19935439..a6578d3e4 100644 --- a/src/main.py +++ b/src/main.py @@ -98,9 +98,7 @@ def do_activate(self): self.reload_user_defined_presets() self.style_manager = Adw.StyleManager.get_default() - print(dir(self.style_manager)) - print(self.style_manager.get_dark()) - if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: + if self.style_manager.get_dark(): self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" ) From 9f222bd06e2a5db7cec0593cf79bef2e4957d300 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:37:03 +0200 Subject: [PATCH 119/149] add automatic color choice for monet --- src/main.py | 7 ++++++- src/window.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a6578d3e4..4868c1575 100644 --- a/src/main.py +++ b/src/main.py @@ -243,7 +243,12 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(monet_theme) print(theme) - + if monet_theme == "automatic": + if self.style_manager.get_dark(): + monet_theme = "dark" + else: + monet_theme = "light" + if monet_theme == "dark": dark_theme = theme["schemes"]["dark"] variable = { diff --git a/src/window.py b/src/window.py index e5f413426..1f10d3f0a 100644 --- a/src/window.py +++ b/src/window.py @@ -144,6 +144,7 @@ def setup_monet_page(self): self.monet_theme_row.set_title(_("Theme")) store = Gtk.StringList() + store.append("Automatic") store.append("Dark") store.append("Light") self.monet_theme_row.set_model(store) From 28e6218038ed4f67c50b67d3bc350d704a748c76 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:39:34 +0200 Subject: [PATCH 120/149] update light theme scheme --- src/main.py | 64 ++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/main.py b/src/main.py index 4868c1575..6aa3b4843 100644 --- a/src/main.py +++ b/src/main.py @@ -300,50 +300,50 @@ def update_theme_from_monet(self, theme, tone, monet_theme): else: # light light_theme = theme["schemes"]["light"] variable = { - "accent_color": light_theme["primary"], - "accent_bg_color": light_theme["primaryContainer"], - "accent_fg_color": light_theme["onPrimaryContainer"], + "accent_color": self.rgba_from_argb(light_theme.primary), + "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), + "accent_fg_color": self.rgba_from_argb(light_theme.onPrimaryContainer), - "destructive_color": light_theme["error"], - "destructive_bg_color": light_theme["errorContainer"], - "destructive_fg_color": light_theme["onError"], + "destructive_color": self.rgba_from_argb(light_theme.error), + "destructive_bg_color": self.rgba_from_argb(light_theme.errorContainer), + "destructive_fg_color": self.rgba_from_argb(light_theme.onError), - "success_color": light_theme["tertiary"], - "success_bg_color": light_theme["onTertiary"], - "success_fg_color": light_theme["tertiaryContainer"], + "success_color": self.rgba_from_argb(light_theme.tertiary), + "success_bg_color": self.rgba_from_argb(light_theme.onTertiary), + "success_fg_color": self.rgba_from_argb(light_theme.tertiaryContainer), - "warning_color": light_theme["secondaryContainer"], - "warning_bg_color": light_theme["inversePrimary"], - "warning_fg_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "warning_color": self.rgba_from_argb(light_theme.secondaryContainer), + "warning_bg_color": self.rgba_from_argb(light_theme.inversePrimary), + "warning_fg_color": self.rgba_from_argb(light_theme.primary, "0.8"), - "error_color": light_theme["error"], - "error_bg_color": light_theme["errorContainer"], - "error_fg_color": light_theme["onError"], + "error_color": self.rgba_from_argb(light_theme.error), + "error_bg_color": self.rgba_from_argb(light_theme.errorContainer), + "error_fg_color": self.rgba_from_argb(light_theme.onError), - "window_bg_color": light_theme["surface"], - "window_fg_color": light_theme["onSurface"], + "window_bg_color": self.rgba_from_argb(light_theme.surface), + "window_fg_color": self.rgba_from_argb(light_theme.onSurface), - "view_bg_color": light_theme["surface"], - "view_fg_color": light_theme["onSurface"], + "view_bg_color": self.rgba_from_argb(light_theme.surface), + "view_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_bg_color": light_theme["surface"], - "headerbar_fg_color": light_theme["onSurface"], - "headerbar_border_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "headerbar_bg_color": self.rgba_from_argb(light_theme.surface), + "headerbar_fg_color": self.rgba_from_argb(light_theme.onSurface), + "headerbar_border_color": self.rgba_from_argb(light_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": light_theme["shadow"], + "headerbar_shade_color": self.rgba_from_argb(light_theme.shadow), - "card_bg_color": self.rgba_from_argb(light_theme["primary"], "0.05"), - "card_fg_color": light_theme["surfaceVariant"], - "card_shade_color": light_theme["shadow"], + "card_bg_color": self.rgba_from_argb(light_theme.primary, "0.05"), + "card_fg_color": self.rgba_from_argb(light_theme.surfaceVariant), + "card_shade_color": self.rgba_from_argb(light_theme.shadow), - "dialog_bg_color": light_theme["secondaryContainer"], - "dialog_fg_color": light_theme["onSecondaryContainer"], + "dialog_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), + "dialog_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - "popover_bg_color": light_theme["secondaryContainer"], - "popover_fg_color": light_theme["onSecondaryContainer"], + "popover_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), + "popover_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - "shade_color": light_theme["shadow"], - "scrollbar_outline_color": light_theme["outline"] + "shade_color": self.rgba_from_argb(light_theme.shadow), + "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline) } for key in variable.keys(): From 8e51c880acbddaf88d0f68b1940931835a57e6b2 Mon Sep 17 00:00:00 2001 From: David Lapshin Date: Thu, 11 Aug 2022 17:48:22 +0300 Subject: [PATCH 121/149] Fix missing settings-symbolic & open-menu-symbolic --- src/adwcustomizer.gresource.xml | 8 ++++++-- ...thub.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg | 2 -- ...AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg | 8 ++++++++ ....AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg | 2 ++ src/ui/window.blp | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) delete mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg diff --git a/src/adwcustomizer.gresource.xml b/src/adwcustomizer.gresource.xml index dc6a30581..fa71a5932 100644 --- a/src/adwcustomizer.gresource.xml +++ b/src/adwcustomizer.gresource.xml @@ -42,11 +42,15 @@ >icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg + alias="open-menu-symbolic.svg" + >icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-fill-symbolic.svg + icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg deleted file mode 100644 index 50b8a3c4d..000000000 --- a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg new file mode 100644 index 000000000..7f4474335 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg new file mode 100644 index 000000000..408d7e5d4 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/src/ui/window.blp b/src/ui/window.blp index e9e6deb74..3b3abc816 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -47,7 +47,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { [end] Gtk.MenuButton { - icon-name: "menu-symbolic"; + icon-name: "open-menu-symbolic"; menu-model: main-menu; } From 84dda5f78d499801a49c20ed7163bfec4854f006 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:53:41 +0200 Subject: [PATCH 122/149] add switch to select dark or light apply --- src/main.py | 72 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/src/main.py b/src/main.py index 6aa3b4843..819f4dd10 100644 --- a/src/main.py +++ b/src/main.py @@ -443,7 +443,13 @@ def show_apply_color_scheme_dialog(self, *_args): Adw.ResponseAppearance.SUGGESTED, transient_for=self.props.active_window, ) - dialog.connect("response", self.apply_color_scheme) + + switch = Gtk.Switch() + print(dir(switch)) + + dialog.set_extra_child(switch) + + dialog.connect("response", self.apply_color_scheme, switch) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -534,28 +540,50 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response): + def apply_color_scheme(self, widget, response, switch): if response == "apply": - if widget.get_app_types()["gtk4"]: - gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") - if not os.path.exists(gtk4_dir): - os.makedirs(gtk4_dir) - gtk4_css = self.generate_gtk_css("gtk4") - with open( - os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8" - ) as file: - file.write(gtk4_css) - if widget.get_app_types()["gtk3"]: - gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") - if not os.path.exists(gtk3_dir): - os.makedirs(gtk3_dir) - gtk3_css = self.generate_gtk_css("gtk3") - with open( - os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" - ) as file: - file.write(gtk3_css) + if switch.get_active(): + if widget.get_app_types()["gtk4"]: + gtk4_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + if not os.path.exists(gtk4_dir): + os.makedirs(gtk4_dir) + gtk4_css = self.generate_gtk_css("gtk4") + with open( + os.path.join(gtk4_dir, "gtk-dark.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk4_css) + if widget.get_app_types()["gtk3"]: + gtk3_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + if not os.path.exists(gtk3_dir): + os.makedirs(gtk3_dir) + gtk3_css = self.generate_gtk_css("gtk3") + with open( + os.path.join(gtk3_dir, "gtk-dark.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk3_css) + else: + if widget.get_app_types()["gtk4"]: + gtk4_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + if not os.path.exists(gtk4_dir): + os.makedirs(gtk4_dir) + gtk4_css = self.generate_gtk_css("gtk4") + with open( + os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk4_css) + if widget.get_app_types()["gtk3"]: + gtk3_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + if not os.path.exists(gtk3_dir): + os.makedirs(gtk3_dir) + gtk3_css = self.generate_gtk_css("gtk3") + with open( + os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk3_css) self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): From 5e96066b9c4b1578a159c564f9931efeacbd0c19 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 17:57:02 +0200 Subject: [PATCH 123/149] change license Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 819f4dd10..a8e7e471a 100644 --- a/src/main.py +++ b/src/main.py @@ -641,7 +641,7 @@ def show_about_window(self, *_args): Juanjo Cillero https://www.transifex.com/user/profile/renux918/ Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", - license_type=Gtk.License.MIT_X11, + license_type=Gtk.License.GPL_3_0, ) about.present() From f054988887d13b1517b79cba8f9a69957d671ad4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:21:13 +0200 Subject: [PATCH 124/149] rework apply --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a8e7e471a..fc68884de 100644 --- a/src/main.py +++ b/src/main.py @@ -444,7 +444,7 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - switch = Gtk.Switch() + switch = Adw.ActionRow() print(dir(switch)) dialog.set_extra_child(switch) From 7639f5313c1e8a1d031adcbb3bed350edb153cf9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:24:37 +0200 Subject: [PATCH 125/149] update comborow --- src/main.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index fc68884de..04ac224e6 100644 --- a/src/main.py +++ b/src/main.py @@ -444,12 +444,18 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - switch = Adw.ActionRow() - print(dir(switch)) + comborow = Adw.ComboRow() + comborow.set_title(_("Apply as dark theme")) - dialog.set_extra_child(switch) + store = Gtk.StringList() + store.append("Dark") + store.append("Light") + comborow.set_model(store) + print(dir(comborow)) - dialog.connect("response", self.apply_color_scheme, switch) + dialog.set_extra_child(comborow) + + dialog.connect("response", self.apply_color_scheme, comborow) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -540,9 +546,9 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response, switch): + def apply_color_scheme(self, widget, response, comborow): if response == "apply": - if switch.get_active(): + if comborow.get_string().lower() == "dark": if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") From ac53e2e876add0dad2e4871bd7b3a66ea0ab0df7 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:31:44 +0200 Subject: [PATCH 126/149] use switch instead --- src/main.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main.py b/src/main.py index 04ac224e6..f76002025 100644 --- a/src/main.py +++ b/src/main.py @@ -444,18 +444,18 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - comborow = Adw.ComboRow() - comborow.set_title(_("Apply as dark theme")) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - store = Gtk.StringList() - store.append("Dark") - store.append("Light") - comborow.set_model(store) - print(dir(comborow)) + label = Gtk.Label(text="Export as Dark theme") + switch = Gtk.Switch() - dialog.set_extra_child(comborow) + box.append(label) + box.append(switch) + print(dir(switch)) - dialog.connect("response", self.apply_color_scheme, comborow) + dialog.set_extra_child(box) + + dialog.connect("response", self.apply_color_scheme, switch) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -546,9 +546,9 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response, comborow): + def apply_color_scheme(self, widget, response, switch): if response == "apply": - if comborow.get_string().lower() == "dark": + if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") From 4278e213228f94e38423a59aa46942ed2b00b4db Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:32:46 +0200 Subject: [PATCH 127/149] fix bug --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index f76002025..b681a0398 100644 --- a/src/main.py +++ b/src/main.py @@ -446,7 +446,7 @@ def show_apply_color_scheme_dialog(self, *_args): box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - label = Gtk.Label(text="Export as Dark theme") + label = Gtk.Label(label="Export as Dark theme") switch = Gtk.Switch() box.append(label) From 18bb8725ee3e5420d4b5d249e344699b7c1ea30a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:35:23 +0200 Subject: [PATCH 128/149] increase spacing --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index b681a0398..959b83397 100644 --- a/src/main.py +++ b/src/main.py @@ -444,7 +444,7 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=30) label = Gtk.Label(label="Export as Dark theme") switch = Gtk.Switch() From b6105f6302a28c6ad4f2f6b9b033b6e2e8ca59cf Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:38:00 +0200 Subject: [PATCH 129/149] update label --- src/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 959b83397..8595303d5 100644 --- a/src/main.py +++ b/src/main.py @@ -444,9 +444,9 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=30) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - label = Gtk.Label(label="Export as Dark theme") + label = Gtk.Label(label="Apply as Dark theme") switch = Gtk.Switch() box.append(label) From b7c6be25e731b205bf7a8c7ecb45bee60a10b014 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:39:24 +0200 Subject: [PATCH 130/149] format --- src/main.py | 72 +++++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/main.py b/src/main.py index 8595303d5..4d4d6f45a 100644 --- a/src/main.py +++ b/src/main.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -36,6 +36,7 @@ from .custom_css_group import AdwcustomizerCustomCSSGroup from .plugins_list import AdwcustomizerPluginsList + def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -114,7 +115,7 @@ def reload_user_defined_presets(self): self.props.active_window.presets_menu.remove(1) preset_directory = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets") if not os.path.exists(preset_directory): os.makedirs(preset_directory) @@ -141,7 +142,8 @@ def reload_user_defined_presets(self): "line": traceback.format_exc().strip(), } ) - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Failed to load preset"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Failed to load preset"))) self.props.active_window.update_errors(self.global_errors) @@ -174,7 +176,8 @@ def open_dir_callback(_, result): self.portal.open_uri( parent, - "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets"), + "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets"), Xdp.OpenUriFlags.NONE, None, open_dir_callback, @@ -214,8 +217,7 @@ def load_preset_variables(self, preset): self.reload_variables() - - def rgba_from_argb(self, argb, alpha = None) -> str: + def rgba_from_argb(self, argb, alpha=None) -> str: base = "rgba({}, {}, {}, {})" red = redFromArgb(argb) @@ -229,28 +231,22 @@ def rgba_from_argb(self, argb, alpha = None) -> str: def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] - monet_theme = monet_theme.get_string().lower() # dark / light + monet_theme = monet_theme.get_string().lower() # dark / light palette = {} i = 0 for color in palettes.values(): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) - - print(palette) - self.pref_palette_shades["monet"].update_shades(palette) - - print(monet_theme) - print(theme) if monet_theme == "automatic": if self.style_manager.get_dark(): monet_theme = "dark" else: monet_theme = "light" - + if monet_theme == "dark": - dark_theme = theme["schemes"]["dark"] + dark_theme = theme["schemes"]["dark"] variable = { "accent_color": self.rgba_from_argb(dark_theme.primary), "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), @@ -297,8 +293,8 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "shade_color": self.rgba_from_argb(dark_theme.shadow), "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) } - else: # light - light_theme = theme["schemes"]["light"] + else: # light + light_theme = theme["schemes"]["light"] variable = { "accent_color": self.rgba_from_argb(light_theme.primary), "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), @@ -349,7 +345,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): for key in variable.keys(): if key in self.pref_variables: self.pref_variables[key].update_value(variable[key]) - + self.reload_variables() def generate_gtk_css(self, app_type): @@ -419,7 +415,8 @@ def load_preset_action(self, _unused, *args): if args[0].get_string().startswith("custom-"): self.load_preset_from_file( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", args[0].get_string().replace("custom-", "", 1) + ".json", ) @@ -451,7 +448,6 @@ def show_apply_color_scheme_dialog(self, *_args): box.append(label) box.append(switch) - print(dir(switch)) dialog.set_extra_child(box) @@ -478,7 +474,8 @@ def show_save_preset_dialog(self, *_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(self.preset_name) + ".json", ) @@ -501,7 +498,7 @@ def on_preset_entry_change(*_args): dialog.set_body( _( "Saving preset to {0}. If that preset already exists, it will be overwritten!" - ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets")) + ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets")) ) dialog.set_response_enabled("save", False) else: @@ -510,7 +507,8 @@ def on_preset_entry_change(*_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(preset_entry.get_text()) + ".json", ) @@ -529,7 +527,8 @@ def save_preset(self, _unused, response, entry): if response == "save": with open( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(entry.get_text()) + ".json", ), @@ -544,14 +543,15 @@ def save_preset(self, _unused, response, entry): } file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Scheme successfully saved!"))) def apply_color_scheme(self, widget, response, switch): if response == "apply": if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -561,7 +561,7 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -572,7 +572,7 @@ def apply_color_scheme(self, widget, response, switch): else: if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -582,7 +582,7 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -590,30 +590,32 @@ def apply_color_scheme(self, widget, response, switch): os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" ) as file: file.write(gtk3_css) - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): if response == "reset": if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0/gtk.css") ) try: file.delete() except Exception: pass - + if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0/gtk.css") ) try: file.delete() except Exception: pass - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( From 1ee3b7c0bf0d349004c57742ef8498cb4b501df5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:39:52 +0200 Subject: [PATCH 131/149] format --- src/app_type_dialog.py | 23 +++- src/custom_css_group.py | 24 ++-- src/error.py | 9 +- src/main.py | 157 +++++++++++++------------ src/option.py | 27 +++-- src/palette_shades.py | 25 ++-- src/plugin.py | 11 +- src/plugins/__init__.py | 6 +- src/plugins/gtk4.py | 7 +- src/plugins_list.py | 21 ++-- src/setting.py | 7 +- src/settings_schema.py | 251 ++++++++++++++++++++-------------------- src/window.py | 70 ++++++----- 13 files changed, 355 insertions(+), 283 deletions(-) diff --git a/src/app_type_dialog.py b/src/app_type_dialog.py index be2707fe2..f7f88133d 100644 --- a/src/app_type_dialog.py +++ b/src/app_type_dialog.py @@ -7,25 +7,36 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/app_type_dialog.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/app_type_dialog.ui" +) class AdwcustomizerAppTypeDialog(Adw.MessageDialog): - __gtype_name__ = 'AdwcustomizerAppTypeDialog' + __gtype_name__ = "AdwcustomizerAppTypeDialog" gtk4_app_type = Gtk.Template.Child("gtk4-app-type") gtk3_app_type = Gtk.Template.Child("gtk3-app-type") - def __init__(self, heading, body, ok_response_name, ok_response_label, ok_response_appearance, **kwargs): + def __init__( + self, + heading, + body, + ok_response_name, + ok_response_label, + ok_response_appearance, + **kwargs + ): super().__init__(**kwargs) self.set_heading(heading) self.set_body(body) @@ -39,5 +50,5 @@ def __init__(self, heading, body, ok_response_name, ok_response_label, ok_respon def get_app_types(self): return { "gtk4": self.gtk4_app_type.get_active(), - "gtk3": self.gtk3_app_type.get_active() + "gtk3": self.gtk3_app_type.get_active(), } diff --git a/src/custom_css_group.py b/src/custom_css_group.py index 2e2d453bd..1f98ab800 100644 --- a/src/custom_css_group.py +++ b/src/custom_css_group.py @@ -7,20 +7,23 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/custom_css_group.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/custom_css_group.ui" +) class AdwcustomizerCustomCSSGroup(Adw.PreferencesGroup): - __gtype_name__ = 'AdwcustomizerCustomCSSGroup' + __gtype_name__ = "AdwcustomizerCustomCSSGroup" app_type_dropdown = Gtk.Template.Child("app-type-dropdown") custom_css_text_view = Gtk.Template.Child("custom-css-text-view") @@ -31,14 +34,21 @@ def __init__(self, **kwargs): def load_custom_css(self, custom_css): self.custom_css = custom_css - self.custom_css_text_view.get_buffer().set_text(list(self.custom_css.values())[self.app_type_dropdown.get_selected()]) + self.custom_css_text_view.get_buffer().set_text( + list(self.custom_css.values())[self.app_type_dropdown.get_selected()] + ) @Gtk.Template.Callback() def on_custom_css_changed(self, buffer): Gtk.Application.get_default().mark_as_dirty() - Gtk.Application.get_default().update_custom_css_text(list(self.custom_css.keys())[self.app_type_dropdown.get_selected()], buffer.props.text) + Gtk.Application.get_default().update_custom_css_text( + list(self.custom_css.keys())[self.app_type_dropdown.get_selected()], + buffer.props.text, + ) @Gtk.Template.Callback() def on_dropdown_notify(self, _unused, pspec): if pspec.name == "selected": - self.custom_css_text_view.get_buffer().set_text(list(self.custom_css.values())[self.app_type_dropdown.get_selected()]) + self.custom_css_text_view.get_buffer().set_text( + list(self.custom_css.values())[self.app_type_dropdown.get_selected()] + ) diff --git a/src/error.py b/src/error.py index 98fd3fdf1..2760bd544 100644 --- a/src/error.py +++ b/src/error.py @@ -7,20 +7,21 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/error.ui') + +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/error.ui") class AdwcustomizerError(Gtk.ListBoxRow): - __gtype_name__ = 'AdwcustomizerError' + __gtype_name__ = "AdwcustomizerError" error_label = Gtk.Template.Child("error-label") element_label = Gtk.Template.Child("element-label") diff --git a/src/main.py b/src/main.py index 4d4d6f45a..042eaf87b 100644 --- a/src/main.py +++ b/src/main.py @@ -89,10 +89,8 @@ def do_activate(self): GLib.Variant("s", "adwaita"), self.load_preset_action, ) - self.create_action("apply_color_scheme", - self.show_apply_color_scheme_dialog) - self.create_action("reset_color_scheme", - self.show_reset_color_scheme_dialog) + self.create_action("apply_color_scheme", self.show_apply_color_scheme_dialog) + self.create_action("reset_color_scheme", self.show_reset_color_scheme_dialog) self.create_action("save_preset", self.show_save_preset_dialog) self.create_action("about", self.show_about_window) @@ -115,7 +113,9 @@ def reload_user_defined_presets(self): self.props.active_window.presets_menu.remove(1) preset_directory = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), + "presets", + ) if not os.path.exists(preset_directory): os.makedirs(preset_directory) @@ -132,8 +132,7 @@ def reload_user_defined_presets(self): raise KeyError("variables") if preset.get("palette") is None: raise KeyError("palette") - self.custom_presets[file_name.replace( - ".json", "")] = preset["name"] + self.custom_presets[file_name.replace(".json", "")] = preset["name"] except Exception: self.global_errors.append( { @@ -143,7 +142,8 @@ def reload_user_defined_presets(self): } ) self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Failed to load preset"))) + Adw.Toast(title=_("Failed to load preset")) + ) self.props.active_window.update_errors(self.global_errors) @@ -176,8 +176,11 @@ def open_dir_callback(_, result): self.portal.open_uri( parent, - "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), "presets"), + "file://" + + os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), + "presets", + ), Xdp.OpenUriFlags.NONE, None, open_dir_callback, @@ -190,8 +193,7 @@ def load_preset_from_file(self, preset_path): self.load_preset_variables(json.loads(preset_text)) def load_preset_from_resource(self, preset_path): - preset_text = Gio.resources_lookup_data( - preset_path, 0).get_data().decode() + preset_text = Gio.resources_lookup_data(preset_path, 0).get_data().decode() self.load_preset_variables(json.loads(preset_text)) def load_preset_variables(self, preset): @@ -251,47 +253,40 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_color": self.rgba_from_argb(dark_theme.primary), "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), "accent_fg_color": self.rgba_from_argb(dark_theme.onPrimaryContainer), - "destructive_color": self.rgba_from_argb(dark_theme.error), "destructive_bg_color": self.rgba_from_argb(dark_theme.errorContainer), "destructive_fg_color": self.rgba_from_argb(dark_theme.onError), - "success_color": self.rgba_from_argb(dark_theme.tertiary), "success_bg_color": self.rgba_from_argb(dark_theme.onTertiary), "success_fg_color": self.rgba_from_argb(dark_theme.tertiaryContainer), - "warning_color": self.rgba_from_argb(dark_theme.secondaryContainer), "warning_bg_color": self.rgba_from_argb(dark_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": self.rgba_from_argb(dark_theme.error), "error_bg_color": self.rgba_from_argb(dark_theme.errorContainer), "error_fg_color": self.rgba_from_argb(dark_theme.onError), - "window_bg_color": self.rgba_from_argb(dark_theme.surface), "window_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "view_bg_color": self.rgba_from_argb(dark_theme.surface), "view_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_bg_color": self.rgba_from_argb(dark_theme.surface), "headerbar_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), + "headerbar_border_color": self.rgba_from_argb( + dark_theme.primary, "0.8" + ), "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), - "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), "card_shade_color": self.rgba_from_argb(dark_theme.shadow), - "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "popover_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), - "popover_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - + "popover_fg_color": self.rgba_from_argb( + dark_theme.onSecondaryContainer + ), "shade_color": self.rgba_from_argb(dark_theme.shadow), - "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) + "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline), } else: # light light_theme = theme["schemes"]["light"] @@ -299,47 +294,42 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_color": self.rgba_from_argb(light_theme.primary), "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), "accent_fg_color": self.rgba_from_argb(light_theme.onPrimaryContainer), - "destructive_color": self.rgba_from_argb(light_theme.error), "destructive_bg_color": self.rgba_from_argb(light_theme.errorContainer), "destructive_fg_color": self.rgba_from_argb(light_theme.onError), - "success_color": self.rgba_from_argb(light_theme.tertiary), "success_bg_color": self.rgba_from_argb(light_theme.onTertiary), "success_fg_color": self.rgba_from_argb(light_theme.tertiaryContainer), - "warning_color": self.rgba_from_argb(light_theme.secondaryContainer), "warning_bg_color": self.rgba_from_argb(light_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(light_theme.primary, "0.8"), - "error_color": self.rgba_from_argb(light_theme.error), "error_bg_color": self.rgba_from_argb(light_theme.errorContainer), "error_fg_color": self.rgba_from_argb(light_theme.onError), - "window_bg_color": self.rgba_from_argb(light_theme.surface), "window_fg_color": self.rgba_from_argb(light_theme.onSurface), - "view_bg_color": self.rgba_from_argb(light_theme.surface), "view_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_bg_color": self.rgba_from_argb(light_theme.surface), "headerbar_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_border_color": self.rgba_from_argb(light_theme.primary, "0.8"), + "headerbar_border_color": self.rgba_from_argb( + light_theme.primary, "0.8" + ), "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(light_theme.shadow), - "card_bg_color": self.rgba_from_argb(light_theme.primary, "0.05"), "card_fg_color": self.rgba_from_argb(light_theme.surfaceVariant), "card_shade_color": self.rgba_from_argb(light_theme.shadow), - "dialog_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), - "dialog_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - + "dialog_fg_color": self.rgba_from_argb( + light_theme.onSecondaryContainer + ), "popover_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), - "popover_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - + "popover_fg_color": self.rgba_from_argb( + light_theme.onSecondaryContainer + ), "shade_color": self.rgba_from_argb(light_theme.shadow), - "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline) + "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline), } for key in variable.keys(): @@ -395,8 +385,7 @@ def on_error(_, section, error): css_provider.connect("parsing-error", on_error) css_provider.load_from_data(gtk_css.encode()) - self.props.active_window.update_errors( - self.global_errors + parsing_errors) + self.props.active_window.update_errors(self.global_errors + parsing_errors) # loading with the priority above user to override the applied config if self.current_css_provider is not None: Gtk.StyleContext.remove_provider_for_display( @@ -415,8 +404,7 @@ def load_preset_action(self, _unused, *args): if args[0].get_string().startswith("custom-"): self.load_preset_from_file( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", args[0].get_string().replace("custom-", "", 1) + ".json", ) @@ -474,8 +462,7 @@ def show_save_preset_dialog(self, *_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", to_slug_case(self.preset_name) + ".json", ) @@ -485,8 +472,7 @@ def show_save_preset_dialog(self, *_args): dialog.add_response("cancel", _("Cancel")) dialog.add_response("save", _("Save")) - dialog.set_response_appearance( - "save", Adw.ResponseAppearance.SUGGESTED) + dialog.set_response_appearance("save", Adw.ResponseAppearance.SUGGESTED) dialog.set_default_response("cancel") dialog.set_close_response("cancel") @@ -498,7 +484,14 @@ def on_preset_entry_change(*_args): dialog.set_body( _( "Saving preset to {0}. If that preset already exists, it will be overwritten!" - ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets")) + ).format( + os.path.join( + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "presets", + ) + ) ) dialog.set_response_enabled("save", False) else: @@ -507,8 +500,9 @@ def on_preset_entry_change(*_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), "presets", to_slug_case(preset_entry.get_text()) + ".json", ) @@ -527,8 +521,7 @@ def save_preset(self, _unused, response, entry): if response == "save": with open( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", to_slug_case(entry.get_text()) + ".json", ), @@ -544,14 +537,19 @@ def save_preset(self, _unused, response, entry): file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Scheme successfully saved!"))) + Adw.Toast(title=_("Scheme successfully saved!")) + ) def apply_color_scheme(self, widget, response, switch): if response == "apply": if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0", + ) if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -561,7 +559,11 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0", + ) if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -572,7 +574,11 @@ def apply_color_scheme(self, widget, response, switch): else: if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0", + ) if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -582,7 +588,11 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0", + ) if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -591,14 +601,19 @@ def apply_color_scheme(self, widget, response, switch): ) as file: file.write(gtk3_css) self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Scheme set successfully!"))) + Adw.Toast(title=_("Scheme set successfully!")) + ) def reset_color_scheme(self, widget, response): if response == "reset": if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0/gtk.css") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0/gtk.css", + ) ) try: file.delete() @@ -608,14 +623,17 @@ def reset_color_scheme(self, widget, response): if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0/gtk.css") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0/gtk.css", + ) ) try: file.delete() except Exception: pass - self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Reset successfully!"))) + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( @@ -631,12 +649,8 @@ def show_about_window(self, *_args): "0xMRTT https://github.com/0xMRTT", "Verantor https://github.com/Verantor", ], - artists=[ - 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' - ], - designers=[ - 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' - ], + artists=['David "Daudix UFO" Lapshin https://github.com/daudix-UFO'], + designers=['David "Daudix UFO" Lapshin https://github.com/daudix-UFO'], # Translators: This is a place to put your credits (formats: "Name https://example.com" or "Name ", no quotes) and is not meant to be translated literally. translator_credits="""Maxime V https://www.transifex.com/user/profile/Adaoh/ FineFindus https://github.com/FineFindus @@ -676,8 +690,7 @@ def create_stateful_action( self, name, parameter_type, initial_state, callback, shortcuts=None ): """Add a stateful application action.""" - action = Gio.SimpleAction.new_stateful( - name, parameter_type, initial_state) + action = Gio.SimpleAction.new_stateful(name, parameter_type, initial_state) action.connect("activate", callback) self.add_action(action) if shortcuts: diff --git a/src/option.py b/src/option.py index ed98f2d12..885339f22 100644 --- a/src/option.py +++ b/src/option.py @@ -7,20 +7,21 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/option.ui') + +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/option.ui") class AdwcustomizerOption(Adw.ActionRow): - __gtype_name__ = 'AdwcustomizerOption' + __gtype_name__ = "AdwcustomizerOption" color_value = Gtk.Template.Child("color-value") text_value = Gtk.Template.Child("text-value") @@ -42,10 +43,14 @@ def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs): self.warning_button.set_visible(False) elif adw_gtk3_support == "partial": self.warning_button.add_css_class("warning") - self.warning_label.set_label(_("This option is only partially supported by the adw-gtk3 theme.")) + self.warning_label.set_label( + _("This option is only partially supported by the adw-gtk3 theme.") + ) elif adw_gtk3_support == "no": self.warning_button.add_css_class("error") - self.warning_label.set_label(_("This option is not supported by the adw-gtk3 theme.")) + self.warning_label.set_label( + _("This option is not supported by the adw-gtk3 theme.") + ) self.explanation_label.set_label(explanation or "") if explanation is None: @@ -53,7 +58,9 @@ def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs): @Gtk.Template.Callback() def on_color_value_changed(self, *_args): - self.update_value(self.color_value.get_rgba().to_string(), update_from="color_value") + self.update_value( + self.color_value.get_rgba().to_string(), update_from="color_value" + ) @Gtk.Template.Callback() def on_text_value_changed(self, *_args): @@ -86,7 +93,11 @@ def update_value(self, new_value, **kwargs): self.color_value.set_rgba(rgba) self.color_value.set_tooltip_text(_("Not a color, see text value")) - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "text_value" and new_value != "": + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "text_value" + and new_value != "" + ): Gtk.Application.get_default().variables[self.get_name()] = new_value Gtk.Application.get_default().mark_as_dirty() Gtk.Application.get_default().reload_variables() diff --git a/src/palette_shades.py b/src/palette_shades.py index f7eb9bf79..dcb0cc63d 100644 --- a/src/palette_shades.py +++ b/src/palette_shades.py @@ -7,20 +7,23 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/palette_shades.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/palette_shades.ui" +) class AdwcustomizerPaletteShades(Adw.ActionRow): - __gtype_name__ = 'AdwcustomizerPaletteShades' + __gtype_name__ = "AdwcustomizerPaletteShades" def __init__(self, prefix, color_title, n_shades, **kwargs): super().__init__(**kwargs) @@ -52,9 +55,17 @@ def update_shades(self, shades, **kwargs): if new_rgba.parse(shades[str(i)]): self.color_pickers[str(i)].set_rgba(new_rgba) self.color_pickers[str(i)].set_tooltip_text(shades[str(i)]) - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "color_value": - Gtk.Application.get_default().palette[self.prefix][str(i)] = shades[str(i)] + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "color_value" + ): + Gtk.Application.get_default().palette[self.prefix][str(i)] = shades[ + str(i) + ] - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "color_value": + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "color_value" + ): Gtk.Application.get_default().mark_as_dirty() Gtk.Application.get_default().reload_variables() diff --git a/src/plugin.py b/src/plugin.py index 16a234f24..cceb7e014 100644 --- a/src/plugin.py +++ b/src/plugin.py @@ -7,17 +7,18 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from .setting import AdwcustomizerSetting + class AdwcustomizerPlugin: def __init__(self): self.title = None @@ -48,7 +49,9 @@ def get_custom_settings_for_preset(self): def get_alias_values(self): alias_values = {} for key, value in self.alias_dict.items(): - alias_values[key] = self.colors.get(value, self.palette.get(value, self.custom_settings.get(value))) + alias_values[key] = self.colors.get( + value, self.palette.get(value, self.custom_settings.get(value)) + ) return alias_values def validate(self): @@ -58,4 +61,4 @@ def apply(self): raise NotImplementedError() def save(self): - pass \ No newline at end of file + pass diff --git a/src/plugins/__init__.py b/src/plugins/__init__.py index a66319289..f93ffe537 100644 --- a/src/plugins/__init__.py +++ b/src/plugins/__init__.py @@ -7,11 +7,11 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with this program. If not, see . \ No newline at end of file +# along with this program. If not, see . diff --git a/src/plugins/gtk4.py b/src/plugins/gtk4.py index b5a7d14f1..dd5fe68e9 100644 --- a/src/plugins/gtk4.py +++ b/src/plugins/gtk4.py @@ -7,16 +7,17 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from ..plugin import AdwcustomizerPlugin + class AdwcustomizerGtk4Plugin(AdwcustomizerPlugin): - pass \ No newline at end of file + pass diff --git a/src/plugins_list.py b/src/plugins_list.py index 3c7c04b35..d2c14499e 100644 --- a/src/plugins_list.py +++ b/src/plugins_list.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -20,22 +20,27 @@ import os from pathlib import Path import importlib + + class AdwcustomizerPluginsList: def __init__(self): - self.plugins = { # AdwCustomizerTeam plugins - "gtk4": AdwcustomizerGtk4Plugin() - } + self.plugins = {"gtk4": AdwcustomizerGtk4Plugin()} # AdwCustomizerTeam plugins self.add_user_plugins() def add_user_plugins(self): - self.user_plugin_dir = Path(os.environ.get("XDG_DATA_HOME", os.environ["HOME"])) / ".local" / "share" / "AdwCustomizer" / "plugins" + self.user_plugin_dir = ( + Path(os.environ.get("XDG_DATA_HOME", os.environ["HOME"])) + / ".local" + / "share" + / "AdwCustomizer" + / "plugins" + ) if self.user_plugin_dir.exists(): for path, _, name in os.walk(self.user_plugin_dir): print(name[0]) else: print("No plugins dir found") - def load_all_custom_settings(self, settings): for plugin_id, plugin in self.plugins.items(): plugin.load_custom_settings(settings[plugin_id]) @@ -43,4 +48,4 @@ def load_all_custom_settings(self, settings): def get_all_custom_settings_for_preset(self): custom_settings = {} for plugin_id, plugin in self.plugins.items(): - custom_settings[plugin_id] = plugin.get_custom_settings_for_preset() \ No newline at end of file + custom_settings[plugin_id] = plugin.get_custom_settings_for_preset() diff --git a/src/setting.py b/src/setting.py index 9a7492815..a2d3479b5 100644 --- a/src/setting.py +++ b/src/setting.py @@ -7,15 +7,16 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . + class AdwcustomizerSetting: def __init__(self, name, title, value_type, explanation=None, default_value=None): # TODO supported types: @@ -34,4 +35,4 @@ def __init__(self, name, title, value_type, explanation=None, default_value=None def set_value(self, new_value): # TODO checks - self.value = new_value \ No newline at end of file + self.value = new_value diff --git a/src/settings_schema.py b/src/settings_schema.py index ea9317441..ea22ce840 100644 --- a/src/settings_schema.py +++ b/src/settings_schema.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -21,117 +21,137 @@ { "name": "accent_colors", "title": _("Accent Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, and entries, to indicate that a widget is important, interactive, or currently active."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, and entries, to indicate that a widget is important, interactive, or currently active." + ), "variables": [ { "name": "accent_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "accent_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "accent_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "destructive_colors", "title": _("Destructive Colors"), - "description": _("These colors are used for buttons to indicate a dangerous action, such as deleting a file."), + "description": _( + "These colors are used for buttons to indicate a dangerous action, such as deleting a file." + ), "variables": [ { "name": "destructive_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "destructive_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "destructive_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "success_colors", "title": _("Success Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a success or a high level."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a success or a high level." + ), "variables": [ { "name": "success_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "success_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "success_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "warning_colors", "title": _("Warning Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a warning or a low level."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a warning or a low level." + ), "variables": [ { "name": "warning_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "warning_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "warning_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "error_colors", "title": _("Error Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, and entries, to indicate a failure."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, and entries, to indicate a failure." + ), "variables": [ { "name": "error_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "error_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "error_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "window_colors", @@ -141,66 +161,76 @@ { "name": "window_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "window_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "view_colors", "title": _("View Colors"), - "description": _("These colors are used in a variety of widgets, such as text views and entries."), + "description": _( + "These colors are used in a variety of widgets, such as text views and entries." + ), "variables": [ { "name": "view_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "view_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "headerbar_colors", "title": _("Header Bar Colors"), - "description": _("These colors are used for header bars, as well as widgets that are meant to be visually attached to it, such as search bars or tab bars."), + "description": _( + "These colors are used for header bars, as well as widgets that are meant to be visually attached to it, such as search bars or tab bars." + ), "variables": [ { "name": "headerbar_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "headerbar_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "headerbar_border_color", "title": _("Border Color"), - "explanation": _("The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout."), - "adw_gtk3_support": "no" + "explanation": _( + "The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout." + ), + "adw_gtk3_support": "no", }, { "name": "headerbar_backdrop_color", "title": _("Backdrop Color"), - "explanation": _("The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color."), - "adw_gtk3_support": "yes" + "explanation": _( + "The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color." + ), + "adw_gtk3_support": "yes", }, { "name": "headerbar_shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window."), - "adw_gtk3_support": "no" - } - ] + "explanation": _( + "The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window." + ), + "adw_gtk3_support": "no", + }, + ], }, { "name": "card_colors", @@ -210,20 +240,22 @@ { "name": "card_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "card_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "card_shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards."), - "adw_gtk3_support": "no" - } - ] + "explanation": _( + "The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards." + ), + "adw_gtk3_support": "no", + }, + ], }, { "name": "dialog_colors", @@ -233,14 +265,14 @@ { "name": "dialog_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "no" + "adw_gtk3_support": "no", }, { "name": "dialog_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "no" - } - ] + "adw_gtk3_support": "no", + }, + ], }, { "name": "popover_colors", @@ -250,14 +282,14 @@ { "name": "popover_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "popover_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "misc_colors", @@ -267,67 +299,32 @@ { "name": "shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders."), - "adw_gtk3_support": "no" + "explanation": _( + "The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders." + ), + "adw_gtk3_support": "no", }, { "name": "scrollbar_outline_color", "title": _("Scrollbar Outline Color"), - "explanation": _("The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color."), - "adw_gtk3_support": "no" - } - ] - } + "explanation": _( + "The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color." + ), + "adw_gtk3_support": "no", + }, + ], + }, ], "palette": [ - { - "prefix": "blue_", - "title": _("Blue"), - "n_shades": 5 - }, - { - "prefix": "green_", - "title": _("Green"), - "n_shades": 5 - }, - { - "prefix": "yellow_", - "title": _("Yellow"), - "n_shades": 5 - }, - { - "prefix": "orange_", - "title": _("Orange"), - "n_shades": 5 - }, - { - "prefix": "red_", - "title": _("Red"), - "n_shades": 5 - }, - { - "prefix": "purple_", - "title": _("Purple"), - "n_shades": 5 - }, - { - "prefix": "brown_", - "title": _("Brown"), - "n_shades": 5 - }, - { - "prefix": "light_", - "title": _("Light"), - "n_shades": 5 - }, - { - "prefix": "dark_", - "title": _("Dark"), - "n_shades": 5 - } + {"prefix": "blue_", "title": _("Blue"), "n_shades": 5}, + {"prefix": "green_", "title": _("Green"), "n_shades": 5}, + {"prefix": "yellow_", "title": _("Yellow"), "n_shades": 5}, + {"prefix": "orange_", "title": _("Orange"), "n_shades": 5}, + {"prefix": "red_", "title": _("Red"), "n_shades": 5}, + {"prefix": "purple_", "title": _("Purple"), "n_shades": 5}, + {"prefix": "brown_", "title": _("Brown"), "n_shades": 5}, + {"prefix": "light_", "title": _("Light"), "n_shades": 5}, + {"prefix": "dark_", "title": _("Dark"), "n_shades": 5}, ], - "custom_css_app_types": [ - "gtk4", - "gtk3" - ] + "custom_css_app_types": ["gtk4", "gtk3"], } diff --git a/src/window.py b/src/window.py index 1f10d3f0a..25d03cc83 100644 --- a/src/window.py +++ b/src/window.py @@ -36,9 +36,9 @@ from material_color_utilities_python import * -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui") class AdwcustomizerMainWindow(Adw.ApplicationWindow): - __gtype_name__ = 'AdwcustomizerMainWindow' + __gtype_name__ = "AdwcustomizerMainWindow" content = Gtk.Template.Child() toast_overlay = Gtk.Template.Child() @@ -54,14 +54,14 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) self.presets_dropdown.get_popover().connect( - "show", self.on_presets_dropdown_activate) + "show", self.on_presets_dropdown_activate + ) self.setup_monet_page() self.setup_plugins_page() self.setup_colors_page() - self.settings = Gio.Settings( - "com.github.AdwCustomizerTeam.AdwCustomizer") + self.settings = Gio.Settings("com.github.AdwCustomizerTeam.AdwCustomizer") self.settings.bind( "window-width", self, "default-width", Gio.SettingsBindFlags.DEFAULT @@ -93,7 +93,9 @@ def on_monet_file_chooser_response(self, widget, response): self.theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) + self.get_application().update_theme_from_monet( + self.theme, self.tone, self.monet_theme + ) def setup_monet_page(self): @@ -101,7 +103,10 @@ def setup_monet_page(self): self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) self.monet_pref_group.set_description( - _("Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow")) + _( + "Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow" + ) + ) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -111,21 +116,21 @@ def setup_monet_page(self): self.monet_file_chooser_button = Gtk.Button() self.monet_file_chooser_button.set_label(_("Choose a file")) - self.monet_file_chooser_button.set_icon_name( - "folder-pictures-symbolic") + self.monet_file_chooser_button.set_icon_name("folder-pictures-symbolic") self.monet_file_chooser_button.connect( - "clicked", self.on_file_picker_button_clicked) + "clicked", self.on_file_picker_button_clicked + ) self.monet_file_chooser_dialog.connect( - "response", self.on_monet_file_chooser_response) + "response", self.on_monet_file_chooser_response + ) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) self.monet_pref_group.add(self.monet_file_chooser_row) - self.monet_palette_shades = AdwcustomizerPaletteShades("monet", - "Monet Palette", - 6) - self.get_application( - ).pref_palette_shades["monet"] = self.monet_palette_shades + self.monet_palette_shades = AdwcustomizerPaletteShades( + "monet", "Monet Palette", 6 + ) + self.get_application().pref_palette_shades["monet"] = self.monet_palette_shades self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() @@ -168,14 +173,14 @@ def setup_colors_page(self): pref_group.set_description(group["description"]) for variable in group["variables"]: - pref_variable = AdwcustomizerOption(variable["name"], - variable["title"], - variable.get( - "explanation"), - variable["adw_gtk3_support"]) + pref_variable = AdwcustomizerOption( + variable["name"], + variable["title"], + variable.get("explanation"), + variable["adw_gtk3_support"], + ) pref_group.add(pref_variable) - self.get_application( - ).pref_variables[variable["name"]] = pref_variable + self.get_application().pref_variables[variable["name"]] = pref_variable self.content.add(pref_group) @@ -183,14 +188,16 @@ def setup_colors_page(self): palette_pref_group.set_name("palette_colors") palette_pref_group.set_title(_("Palette Colors")) palette_pref_group.set_description( - _("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) + _( + 'Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.' + ) + ) for color in settings_schema["palette"]: - palette_shades = AdwcustomizerPaletteShades(color["prefix"], - color["title"], - color["n_shades"]) + palette_shades = AdwcustomizerPaletteShades( + color["prefix"], color["title"], color["n_shades"] + ) palette_pref_group.add(palette_shades) - self.get_application( - ).pref_palette_shades[color["prefix"]] = palette_shades + self.get_application().pref_palette_shades[color["prefix"]] = palette_shades self.content.add(palette_pref_group) def update_errors(self, errors): @@ -200,8 +207,9 @@ def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) self.errors_button.set_visible(len(errors) > 0) for error in errors: - self.errors_list.append(AdwcustomizerError( - error["error"], error["element"], error["line"])) + self.errors_list.append( + AdwcustomizerError(error["error"], error["element"], error["line"]) + ) def on_presets_dropdown_activate(self, *args): self.get_application().reload_user_defined_presets() From f84080832408da0368c8ff33b488993b9e538235 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:44:51 +0200 Subject: [PATCH 132/149] add version --- meson.build | 6 +++++- src/info.py.in | 2 ++ src/main.py | 3 ++- src/meson.build | 11 +++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/info.py.in diff --git a/meson.build b/meson.build index 36f2ff2f4..e22a4fc1e 100644 --- a/meson.build +++ b/meson.build @@ -1,11 +1,15 @@ project('adwcustomizer', - version: 'git', + version: '0.1.0', meson_version: '>= 0.59.0', default_options: [ 'warning_level=2', 'werror=false', ], ) +dependency('glib-2.0') +dependency('pygobject-3.0') +dependency('libadwaita-1') + i18n = import('i18n') gnome = import('gnome') diff --git a/src/info.py.in b/src/info.py.in new file mode 100644 index 000000000..20fc34949 --- /dev/null +++ b/src/info.py.in @@ -0,0 +1,2 @@ +version = '@version@' +build_type = '@build_type@' \ No newline at end of file diff --git a/src/main.py b/src/main.py index 042eaf87b..142524a33 100644 --- a/src/main.py +++ b/src/main.py @@ -35,7 +35,7 @@ from .app_type_dialog import AdwcustomizerAppTypeDialog from .custom_css_group import AdwcustomizerCustomCSSGroup from .plugins_list import AdwcustomizerPluginsList - +from . import info def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -664,6 +664,7 @@ def show_about_window(self, *_args): Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, + version=f"{info.version}" ) about.present() diff --git a/src/meson.build b/src/meson.build index 7f45b1d13..b395392b1 100644 --- a/src/meson.build +++ b/src/meson.build @@ -40,6 +40,17 @@ configure_file( install_dir: get_option('bindir') ) +configure_file( + input: 'info.py.in', + output: '@BASENAME@', + install: true, + install_dir: python.get_install_dir() / 'adwcustomizer', + configuration: configuration_data({ + 'version': meson.project_version(), + 'build_type': get_option('buildtype'), + }), +) + adwcustomizer_sources = [ '__init__.py', 'settings_schema.py', From c775f93492d60738f4453c7f7323af2b82efabd9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:46:03 +0200 Subject: [PATCH 133/149] update meson build --- src/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index b395392b1..d3e13293a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -44,7 +44,7 @@ configure_file( input: 'info.py.in', output: '@BASENAME@', install: true, - install_dir: python.get_install_dir() / 'adwcustomizer', + install_dir: moduledir, configuration: configuration_data({ 'version': meson.project_version(), 'build_type': get_option('buildtype'), From 30ac48c58b3685a52a4b27b44d61fe2b90477094 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:47:30 +0200 Subject: [PATCH 134/149] format --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 142524a33..4849549f9 100644 --- a/src/main.py +++ b/src/main.py @@ -37,6 +37,7 @@ from .plugins_list import AdwcustomizerPluginsList from . import info + def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -664,7 +665,7 @@ def show_about_window(self, *_args): Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, - version=f"{info.version}" + version=f"{info.version}", ) about.present() From 63d59ffd66ece733b449f914eba171e4c2560345 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:51:30 +0200 Subject: [PATCH 135/149] udpate appstream metadata #77 --- ...github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index 9547dad90..86def6ddf 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -2,8 +2,11 @@ com.github.AdwCustomizerTeam.AdwCustomizer.desktop CC0-1.0 - MIT + GPL-3.0 - Change the look of Adwaita, with ease + Change the look of Adwaita, with ease - + https://github.com/AdwCustomizerTeam/AdwCustomizer/issues + https://github.com/AdwCustomizerTeam/AdwCustomizer + https://www.transifex.com/adwcustomizerteam/adwcustomizer/ + \ No newline at end of file From 6b64caccd48484c845c1c96e1f230fef629360f7 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 19:27:47 +0200 Subject: [PATCH 136/149] move menu button next to close button --- src/ui/window.blp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index 3b3abc816..da2d16a8c 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -45,11 +45,6 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } } - [end] - Gtk.MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } [end] MenuButton errors-button { @@ -58,6 +53,13 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { popover: errors-popover; } + + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + } Gtk.Box { From 2d7e04e3b7e0914df7a2bde1e2c9ffefdcafa9a5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 19:27:57 +0200 Subject: [PATCH 137/149] update appstream metadata --- data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index 86def6ddf..b6b00b08c 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -3,6 +3,8 @@ com.github.AdwCustomizerTeam.AdwCustomizer.desktop CC0-1.0 GPL-3.0 + Adwaita Manager + Change the look of Adwaita, with ease Change the look of Adwaita, with ease From 8d2facab423a51c45a07fd5debeca2b53703528f Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 20:12:34 +0200 Subject: [PATCH 138/149] switch back to main Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index 31be453cf..2bb34ef9d 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -71,7 +71,7 @@ { "type" : "git", "path" : ".", - "branch": "next" + "branch": "main" } ] } From 6405f813075861d95168c8018dba123736d029ed Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 20:13:21 +0200 Subject: [PATCH 139/149] auto instead of automatic Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 25d03cc83..2e35d7f4b 100644 --- a/src/window.py +++ b/src/window.py @@ -149,7 +149,7 @@ def setup_monet_page(self): self.monet_theme_row.set_title(_("Theme")) store = Gtk.StringList() - store.append("Automatic") + store.append("Auto") store.append("Dark") store.append("Light") self.monet_theme_row.set_model(store) From 405ad1d079e59ceaa645b28072ae6ccdd21d1f58 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:25:05 +0200 Subject: [PATCH 140/149] Update POT --- po/AdwCustomizer.pot | 229 +++++++++++++++++++++++++------------------ 1 file changed, 134 insertions(+), 95 deletions(-) diff --git a/po/AdwCustomizer.pot b/po/AdwCustomizer.pot index c45e60352..1d707805a 100644 --- a/po/AdwCustomizer.pot +++ b/po/AdwCustomizer.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-09 22:21+0300\n" +"POT-Creation-Date: 2022-08-12 11:24+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,11 +18,13 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: data/com.github.AdwCustomizerTeam.AdwCustomizer.desktop.in:3 -#: src/ui/window.blp:5 src/main.py:332 +#: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:6 +#: src/ui/window.blp:5 src/main.py:642 msgid "Adwaita Manager" msgstr "" #: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:7 +#: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:9 msgid "Change the look of Adwaita, with ease" msgstr "" @@ -70,225 +72,236 @@ msgstr "" msgid "Toggle Text Value" msgstr "" -#: src/ui/window.blp:13 src/main.py:245 +#: src/ui/window.blp:23 src/main.py:428 msgid "Apply" msgstr "" -#: src/ui/window.blp:20 -msgid "Save Preset" +#: src/ui/window.blp:35 +msgid "Presets" msgstr "" -#: src/ui/window.blp:36 -msgid "Presets" +#: src/ui/window.blp:42 +msgid "Save Preset" msgstr "" -#: src/ui/window.blp:58 +#: src/ui/window.blp:112 msgid "Built-in Presets" msgstr "" -#: src/ui/window.blp:73 +#: src/ui/window.blp:134 +msgid "Release Notes" +msgstr "" + +#: src/ui/window.blp:138 msgid "Reset Applied Color Scheme" msgstr "" -#: src/ui/window.blp:74 +#: src/ui/window.blp:142 msgid "About Adwaita Manager" msgstr "" -#: src/app_type_dialog.py:43 src/main.py:264 +#: src/app_type_dialog.py:44 src/main.py:474 msgid "Cancel" msgstr "" -#: src/main.py:123 +#: src/main.py:140 src/main.py:146 msgid "Failed to load preset" msgstr "" -#: src/main.py:139 +#: src/main.py:163 msgid "Open in File Manager" msgstr "" -#: src/main.py:142 +#: src/main.py:169 msgid "User Defined Presets" msgstr "" -#: src/main.py:203 +#: src/main.py:358 msgid "Unsaved changes" msgstr "" -#: src/main.py:243 +#: src/main.py:423 msgid "Apply this color scheme?" msgstr "" -#: src/main.py:244 +#: src/main.py:425 msgid "" "Warning: any custom CSS files for those app types will be irreversibly " "overwritten!" msgstr "" -#: src/main.py:251 +#: src/main.py:448 msgid "Reset applied color scheme?" msgstr "" -#: src/main.py:252 +#: src/main.py:449 msgid "Make sure you have the current settings saved as a preset." msgstr "" -#: src/main.py:253 +#: src/main.py:451 msgid "Reset" msgstr "" -#: src/main.py:260 +#: src/main.py:461 msgid "Save preset as..." msgstr "" -#: src/main.py:261 src/main.py:274 src/main.py:277 +#: src/main.py:463 src/main.py:487 src/main.py:501 #, python-brace-format msgid "" "Saving preset to {0}. If that preset already exists, it will be " "overwritten!" msgstr "" -#: src/main.py:265 +#: src/main.py:475 msgid "Save" msgstr "" -#: src/main.py:334 -msgid "Adwaita Manager Team" +#: src/main.py:541 +msgid "Scheme successfully saved!" msgstr "" -#. Translators: This is a place to put your credits (formats: "Name https://example.com" or "Name ", no quotes) and is not meant to be translated literally. -#: src/main.py:338 -msgid "translator-credits" +#: src/main.py:605 +msgid "Scheme set successfully!" msgstr "" -#: src/option.py:55 +#: src/main.py:637 +msgid "Reset successfully!" +msgstr "" + +#: src/main.py:644 +msgid "Adwaita Manager Team" +msgstr "" + +#: src/option.py:47 msgid "This option is only partially supported by the adw-gtk3 theme." msgstr "" -#: src/option.py:58 +#: src/option.py:52 msgid "This option is not supported by the adw-gtk3 theme." msgstr "" -#: src/option.py:97 +#: src/option.py:94 msgid "Not a color, see text value" msgstr "" -#: src/settings_schema.py:5 +#: src/settings_schema.py:23 msgid "Accent Colors" msgstr "" -#: src/settings_schema.py:6 +#: src/settings_schema.py:25 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, and entries, to indicate that a widget is important, interactive, or " "currently active." msgstr "" -#: src/settings_schema.py:10 src/settings_schema.py:33 -#: src/settings_schema.py:56 src/settings_schema.py:79 -#: src/settings_schema.py:102 +#: src/settings_schema.py:30 src/settings_schema.py:57 +#: src/settings_schema.py:84 src/settings_schema.py:111 +#: src/settings_schema.py:138 msgid "Standalone Color" msgstr "" -#: src/settings_schema.py:11 src/settings_schema.py:34 -#: src/settings_schema.py:57 src/settings_schema.py:80 -#: src/settings_schema.py:103 +#: src/settings_schema.py:32 src/settings_schema.py:59 +#: src/settings_schema.py:86 src/settings_schema.py:113 +#: src/settings_schema.py:140 msgid "" "The standalone colors are similar to the background ones, but provide better " "contrast when used as foreground color on top of a neutral background - for " "example, colorful text in a window." msgstr "" -#: src/settings_schema.py:16 src/settings_schema.py:39 -#: src/settings_schema.py:62 src/settings_schema.py:85 -#: src/settings_schema.py:108 src/settings_schema.py:125 -#: src/settings_schema.py:142 src/settings_schema.py:159 -#: src/settings_schema.py:194 src/settings_schema.py:217 -#: src/settings_schema.py:234 +#: src/settings_schema.py:38 src/settings_schema.py:65 +#: src/settings_schema.py:92 src/settings_schema.py:119 +#: src/settings_schema.py:146 src/settings_schema.py:163 +#: src/settings_schema.py:182 src/settings_schema.py:201 +#: src/settings_schema.py:242 src/settings_schema.py:267 +#: src/settings_schema.py:284 msgid "Background Color" msgstr "" -#: src/settings_schema.py:21 src/settings_schema.py:44 -#: src/settings_schema.py:67 src/settings_schema.py:90 -#: src/settings_schema.py:113 src/settings_schema.py:130 -#: src/settings_schema.py:147 src/settings_schema.py:164 -#: src/settings_schema.py:199 src/settings_schema.py:222 -#: src/settings_schema.py:239 +#: src/settings_schema.py:43 src/settings_schema.py:70 +#: src/settings_schema.py:97 src/settings_schema.py:124 +#: src/settings_schema.py:151 src/settings_schema.py:168 +#: src/settings_schema.py:187 src/settings_schema.py:206 +#: src/settings_schema.py:247 src/settings_schema.py:272 +#: src/settings_schema.py:289 msgid "Foreground Color" msgstr "" -#: src/settings_schema.py:28 +#: src/settings_schema.py:50 msgid "Destructive Colors" msgstr "" -#: src/settings_schema.py:29 +#: src/settings_schema.py:52 msgid "" "These colors are used for buttons to indicate a dangerous action, such as " "deleting a file." msgstr "" -#: src/settings_schema.py:51 +#: src/settings_schema.py:77 msgid "Success Colors" msgstr "" -#: src/settings_schema.py:52 +#: src/settings_schema.py:79 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, entries, and level bars, to indicate a success or a high level." msgstr "" -#: src/settings_schema.py:74 +#: src/settings_schema.py:104 msgid "Warning Colors" msgstr "" -#: src/settings_schema.py:75 +#: src/settings_schema.py:106 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, entries, and level bars, to indicate a warning or a low level." msgstr "" -#: src/settings_schema.py:97 +#: src/settings_schema.py:131 msgid "Error Colors" msgstr "" -#: src/settings_schema.py:98 +#: src/settings_schema.py:133 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, and entries, to indicate a failure." msgstr "" -#: src/settings_schema.py:120 +#: src/settings_schema.py:158 msgid "Window Colors" msgstr "" -#: src/settings_schema.py:121 +#: src/settings_schema.py:159 msgid "These colors are used primarily for windows." msgstr "" -#: src/settings_schema.py:137 +#: src/settings_schema.py:175 msgid "View Colors" msgstr "" -#: src/settings_schema.py:138 +#: src/settings_schema.py:177 msgid "" "These colors are used in a variety of widgets, such as text views and " "entries." msgstr "" -#: src/settings_schema.py:154 +#: src/settings_schema.py:194 msgid "Header Bar Colors" msgstr "" -#: src/settings_schema.py:155 +#: src/settings_schema.py:196 msgid "" "These colors are used for header bars, as well as widgets that are meant to " "be visually attached to it, such as search bars or tab bars." msgstr "" -#: src/settings_schema.py:169 +#: src/settings_schema.py:211 msgid "Border Color" msgstr "" -#: src/settings_schema.py:170 +#: src/settings_schema.py:213 msgid "" "The border color has the same default value as a foreground color, but " "doesn't change along with it. This can be useful if a light window has a " @@ -297,11 +310,11 @@ msgid "" "example, separators between the two header bars in a split header bar layout." msgstr "" -#: src/settings_schema.py:175 +#: src/settings_schema.py:219 msgid "Backdrop Color" msgstr "" -#: src/settings_schema.py:176 +#: src/settings_schema.py:221 msgid "" "The backdrop color is used instead of the background color when the window " "is not focused. By default it's an alias of the window's background color " @@ -309,113 +322,139 @@ msgid "" "it to a value matching your header bar background color." msgstr "" -#: src/settings_schema.py:181 src/settings_schema.py:204 -#: src/settings_schema.py:251 +#: src/settings_schema.py:227 src/settings_schema.py:252 +#: src/settings_schema.py:301 msgid "Shade Color" msgstr "" -#: src/settings_schema.py:182 +#: src/settings_schema.py:229 msgid "" "The shade color is used to provide a dark border for header bars and similar " "widgets that separates them from the main window." msgstr "" -#: src/settings_schema.py:189 +#: src/settings_schema.py:237 msgid "Card Colors" msgstr "" -#: src/settings_schema.py:190 +#: src/settings_schema.py:238 msgid "These colors are used for cards and boxed lists." msgstr "" -#: src/settings_schema.py:205 +#: src/settings_schema.py:254 msgid "" "The shade color is used for shadows that are used by cards to separate " "themselves from the window background, as well as for row dividers in the " "cards." msgstr "" -#: src/settings_schema.py:212 +#: src/settings_schema.py:262 msgid "Dialog Colors" msgstr "" -#: src/settings_schema.py:213 +#: src/settings_schema.py:263 msgid "These colors are used for message dialogs." msgstr "" -#: src/settings_schema.py:229 +#: src/settings_schema.py:279 msgid "Popover Colors" msgstr "" -#: src/settings_schema.py:230 +#: src/settings_schema.py:280 msgid "These colors are used for popovers." msgstr "" -#: src/settings_schema.py:246 +#: src/settings_schema.py:296 msgid "Miscalleneous Colors" msgstr "" -#: src/settings_schema.py:247 +#: src/settings_schema.py:297 msgid "Colors that don't fit in any particular group." msgstr "" -#: src/settings_schema.py:252 +#: src/settings_schema.py:303 msgid "" "The shade color is used by inline tab bars, as well as the transitions in " "leaflets and flaps, and info bar borders." msgstr "" -#: src/settings_schema.py:257 +#: src/settings_schema.py:309 msgid "Scrollbar Outline Color" msgstr "" -#: src/settings_schema.py:258 +#: src/settings_schema.py:311 msgid "" "The scrollbar outline color is used by scrollbars to ensure that overlay " "scrollbars are visible regardless of the content color." msgstr "" -#: src/settings_schema.py:267 +#: src/settings_schema.py:319 msgid "Blue" msgstr "" -#: src/settings_schema.py:272 +#: src/settings_schema.py:320 msgid "Green" msgstr "" -#: src/settings_schema.py:277 +#: src/settings_schema.py:321 msgid "Yellow" msgstr "" -#: src/settings_schema.py:282 +#: src/settings_schema.py:322 msgid "Orange" msgstr "" -#: src/settings_schema.py:287 +#: src/settings_schema.py:323 msgid "Red" msgstr "" -#: src/settings_schema.py:292 +#: src/settings_schema.py:324 msgid "Purple" msgstr "" -#: src/settings_schema.py:297 +#: src/settings_schema.py:325 msgid "Brown" msgstr "" -#: src/settings_schema.py:302 +#: src/settings_schema.py:326 msgid "Light" msgstr "" -#: src/settings_schema.py:307 +#: src/settings_schema.py:327 msgid "Dark" msgstr "" -#: src/window.py:70 +#: src/window.py:104 +msgid "Monet Engine" +msgstr "" + +#: src/window.py:107 +msgid "" +"Monet is an engine that generates Material Design 3 palette from backgrounds " +"color. The generation can be slow" +msgstr "" + +#: src/window.py:112 +msgid "Background Image" +msgstr "" + +#: src/window.py:118 +msgid "Choose a file" +msgstr "" + +#: src/window.py:137 +msgid "Tone" +msgstr "" + +#: src/window.py:149 +msgid "Theme" +msgstr "" + +#: src/window.py:189 msgid "Palette Colors" msgstr "" -#: src/window.py:71 +#: src/window.py:192 msgid "" "Named palette colors used by some applications. Default colors follow the GNOME Human " From deb7a6f40df1acb07f1d291f3c471dc81fa71cd5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:27:19 +0200 Subject: [PATCH 141/149] add devel flatpak --- .github/workflows/flatpak-nightly.yml | 4 +- ...AdwCustomizerTeam.AdwCustomizer.Devel.json | 82 +++++++++++++++++++ 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index fa297f23a..613457218 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -14,6 +14,6 @@ jobs: uses: actions/checkout@v3.0.2 - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 with: - bundle: com.github.AdwCustomizerTeam.AdwCustomizer.flatpak - manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.json + bundle: com.github.AdwCustomizerTeam.AdwCustomizer.Devel.flatpak + manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json cache-key: flatpak-builder-${{ github.sha }}-nightly \ No newline at end of file diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json b/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json new file mode 100644 index 000000000..31be453cf --- /dev/null +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json @@ -0,0 +1,82 @@ +{ + "app-id" : "com.github.AdwCustomizerTeam.AdwCustomizer", + "runtime" : "org.gnome.Platform", + "runtime-version" : "master", + "sdk" : "org.gnome.Sdk", + "command" : "adwcustomizer", + "finish-args" : [ + "--share=network", + "--share=ipc", + "--socket=fallback-x11", + "--device=dri", + "--socket=wayland", + "--filesystem=xdg-config/gtk-3.0", + "--filesystem=xdg-config/gtk-4.0" + ], + "cleanup" : [ + "/include", + "/lib/pkgconfig", + "/man", + "/share/doc", + "/share/gtk-doc", + "/share/man", + "/share/pkgconfig", + "*.la", + "*.a" + ], + "modules" : [ + "pypi-dependencies.json", + { + "name" : "blueprint-compiler", + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "url" : "https://gitlab.gnome.org/jwestman/blueprint-compiler", + "branch" : "main" + } + ] + }, + { + "name": "libportal", + "buildsystem": "meson", + "config-opts": ["-Ddocs=false", "-Dvapi=false", "-Dbackends=gtk4"], + "sources": [ + { + "type": "git", + "url": "https://github.com/flatpak/libportal", + "branch": "main" + } + ] + }, + { + "name": "material-color-utilities-python", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"material_color_utilities_python~=0.1.0\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "path": "./monet/material_color_utilities_python-0.1.0-py3-none-any.whl", + "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" + } + ] + }, + { + "name" : "adwcustomizer", + "builddir" : true, + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "path" : ".", + "branch": "next" + } + ] + } + ], + "build-options" : { + "env" : { } + } +} From e13af9f723333ad3b2311b4cf9393f2d2a9d37d8 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:28:57 +0200 Subject: [PATCH 142/149] update license --- po/AdwCustomizer.pot | 2 +- po/update_potfile.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/po/AdwCustomizer.pot b/po/AdwCustomizer.pot index 1d707805a..13f7a243a 100644 --- a/po/AdwCustomizer.pot +++ b/po/AdwCustomizer.pot @@ -1,6 +1,6 @@ # Adwaita Manager POT file # Copyright (C) 2022 Adwaita Manager Team -# This file is distributed under the MIT/X11 license. +# This file is distributed under the GNU GPLv3 license. # Adwaita Manager Team, 2022. # #, fuzzy diff --git a/po/update_potfile.sh b/po/update_potfile.sh index b20cc2c9e..8c9c7f35f 100755 --- a/po/update_potfile.sh +++ b/po/update_potfile.sh @@ -3,7 +3,7 @@ po_dir=$(dirname "$(realpath "$0")") xgettext -f "$po_dir"/POTFILES -o "$po_dir"/AdwCustomizer.pot --add-comments=Translators --keyword=_ --keyword=C_1c,2 --from-code=UTF-8 sed -i "s/SOME DESCRIPTIVE TITLE./Adwaita Manager POT file/" "$po_dir"/AdwCustomizer.pot sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/$(date +%Y) Adwaita Manager Team/" "$po_dir"/AdwCustomizer.pot -sed -i "s@same license as the PACKAGE package.@MIT/X11 license.@" "$po_dir"/AdwCustomizer.pot +sed -i "s@same license as the PACKAGE package.@GNU GPLv3 license.@" "$po_dir"/AdwCustomizer.pot sed -i "s/FIRST AUTHOR , YEAR./Adwaita Manager Team, $(date +%Y)./" "$po_dir"/AdwCustomizer.pot regex="$po_dir/([a-zA-Z_]*).po" From a9fe0b768dc3df47b20f63c3697a1b0e79e8efa4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:30:51 +0200 Subject: [PATCH 143/149] reverse button order --- src/ui/window.blp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index da2d16a8c..ba11eeb97 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -29,6 +29,12 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { stack: view_stack; } + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + [end] MenuButton presets-dropdown { menu-model: presets-menu; @@ -54,11 +60,6 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } - [end] - Gtk.MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } } From b23768a060e4f8cdae68493158d5342a0c17eaa4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:38:35 +0200 Subject: [PATCH 144/149] change card fg color --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 4849549f9..50f452655 100644 --- a/src/main.py +++ b/src/main.py @@ -278,7 +278,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), - "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), + "card_fg_color": self.rgba_from_argb(dark_theme.onSurface), "card_shade_color": self.rgba_from_argb(dark_theme.shadow), "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), From 36ec03fe62cfd1a38580200a8c55bdd2404a7939 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:49:29 +0200 Subject: [PATCH 145/149] update releases notes --- ...ustomizerTeam.AdwCustomizer.appdata.xml.in | 16 +++++++++ src/main.py | 34 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index b431f38a0..f75d2b327 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -104,6 +104,22 @@ First release of Adwaita Manager. + + Add AdwViewSwitcher in the header bar. + Move CSS to the "Advanced" tab + Move the rest to the "Colours" tab + Add Monet tab which generates a theme from a background + Add disk saved and disk unsaved icon in the header bar + Update about dialog + Change license to GNU GPLv3 + Begin plugin support + Move preset selector to a drop-down called palette (icon palette) + Add ability to apply the theme onlyfor dark theme or oy for light theme + Automaticly use Adwaita-dark preset if the user prefered scheme is dark. + Added Flatpak CI build + Added issue template for bug and feature request + `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch + diff --git a/src/main.py b/src/main.py index 50f452655..bed21e1f7 100644 --- a/src/main.py +++ b/src/main.py @@ -666,6 +666,40 @@ def show_about_window(self, *_args): copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, version=f"{info.version}", + release_notes=""" + + + Add AdwViewSwitcher in the header bar. + Move CSS to the "Advanced" tab + Move the rest to the "Colours" tab + Add Monet tab which generates a theme from a background + Add disk saved and disk unsaved icon in the header bar + Update about dialog + Change license to GNU GPLv3 + Begin plugin support + Move preset selector to a drop-down called palette (icon palette) + Add ability to apply the theme onlyfor dark theme or oy for light theme + Automaticly use Adwaita-dark preset if the user prefered scheme is dark. + Added Flatpak CI build + Added issue template for bug and feature request + `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch + + + """, + comments=""" + + Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. + + With Adwaita Manager you can: + + Change any color of Adwaita theme + Apply Material 3 colors from wallaper + Use other users presets + Change advanced options with CSS + Extend functionality using plugins + + This app is written in Python and uses GTK 4 and libadwaita. + """ ) about.present() From 262a690da3ab80eb3ca9bed8fff6b358ee981864 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:54:45 +0200 Subject: [PATCH 146/149] remove markup --- src/main.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index bed21e1f7..1f93c3fb5 100644 --- a/src/main.py +++ b/src/main.py @@ -667,7 +667,6 @@ def show_about_window(self, *_args): license_type=Gtk.License.GPL_3_0, version=f"{info.version}", release_notes=""" - Add AdwViewSwitcher in the header bar. Move CSS to the "Advanced" tab @@ -684,13 +683,11 @@ def show_about_window(self, *_args): Added issue template for bug and feature request `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch - """, comments=""" - + Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. - - With Adwaita Manager you can: +With Adwaita Manager you can: Change any color of Adwaita theme Apply Material 3 colors from wallaper @@ -698,7 +695,7 @@ def show_about_window(self, *_args): Change advanced options with CSS Extend functionality using plugins - This app is written in Python and uses GTK 4 and libadwaita. + This app is written in Python and uses GTK 4 and libadwaita. """ ) about.present() From 0afaf852d61223ed36bbf8c4eb322dbc4e3c9397 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:55:46 +0200 Subject: [PATCH 147/149] update markups --- src/main.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main.py b/src/main.py index 1f93c3fb5..027696cd3 100644 --- a/src/main.py +++ b/src/main.py @@ -685,16 +685,15 @@ def show_about_window(self, *_args): """, comments=""" - Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. With Adwaita Manager you can: - - Change any color of Adwaita theme - Apply Material 3 colors from wallaper - Use other users presets - Change advanced options with CSS - Extend functionality using plugins - + + Change any color of Adwaita theme + Apply Material 3 colors from wallaper + Use other users presets + Change advanced options with CSS + Extend functionality using plugins + This app is written in Python and uses GTK 4 and libadwaita. """ ) From 9530bbaa83a49692b2f135661095690c17c748bd Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:56:35 +0200 Subject: [PATCH 148/149] update comments --- src/main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.py b/src/main.py index 027696cd3..e4b37a242 100644 --- a/src/main.py +++ b/src/main.py @@ -685,16 +685,16 @@ def show_about_window(self, *_args): """, comments=""" - Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. +Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. With Adwaita Manager you can: - Change any color of Adwaita theme - Apply Material 3 colors from wallaper - Use other users presets - Change advanced options with CSS - Extend functionality using plugins + - Change any color of Adwaita theme + - Apply Material 3 colors from wallaper + - Use other users presets + - Change advanced options with CSS + - Extend functionality using plugins - This app is written in Python and uses GTK 4 and libadwaita. +This app is written in Python and uses GTK 4 and libadwaita. """ ) about.present() From 9c627ec3f5812e9303bbfac90502294466b72349 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:57:13 +0200 Subject: [PATCH 149/149] update markups --- src/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index e4b37a242..acd4983cc 100644 --- a/src/main.py +++ b/src/main.py @@ -689,10 +689,10 @@ def show_about_window(self, *_args): With Adwaita Manager you can: - Change any color of Adwaita theme - - Apply Material 3 colors from wallaper - - Use other users presets - - Change advanced options with CSS - - Extend functionality using plugins + - Apply Material 3 colors from wallaper + - Use other users presets + - Change advanced options with CSS + - Extend functionality using plugins This app is written in Python and uses GTK 4 and libadwaita. """
AxNIP$DP`^K2Xpr5sqt=dyE-0yE5jZ> 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 sp!jKhc**ke5dMpW&Ger) Date: Thu, 11 Aug 2022 11:29:51 +0200 Subject: [PATCH 064/149] use local file --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index d162543b7..31be453cf 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -57,7 +57,7 @@ ], "sources": [ { - "type": "url", + "type": "file", "path": "./monet/material_color_utilities_python-0.1.0-py3-none-any.whl", "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" } From 4d74bc5cf92bbe1813f5b1e6e5e0e51a72558831 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 11:49:04 +0200 Subject: [PATCH 065/149] add tone row --- src/window.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 3a705f98a..11b6724fc 100644 --- a/src/window.py +++ b/src/window.py @@ -81,11 +81,16 @@ def on_file_picker_button_clicked(self, *args): def on_monet_file_chooser_response(self, widget, response): if response == Gtk.ResponseType.ACCEPT: - image_file = self.monet_file_chooser_dialog.get_file() - image_basename = image_file.get_basename() + self.monet_image_file = self.monet_file_chooser_dialog.get_file() + image_basename = self.monet_image_file.get_basename() self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() + self.monet_img = Image.open(self.monet_image_file) + self.monet_theme = themeFromImage(self.monet_img) + self.monet_palette = self.monet_theme["palette"] + self.get_application().update_theme_from_monet(self.monet_theme) + def setup_monet_page(self): @@ -126,6 +131,10 @@ def setup_monet_page(self): self.content_monet.add(monet_pref_group) + self.tone_row = Adw.ComboRow() + self.tone_row.set_title(_("Tone")) + print(dir(self.tone_row)) + def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() for app_type in settings_schema["custom_css_app_types"]: From aad88ff496f9aa86a198cc763b40fb002d9356aa Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:03:21 +0200 Subject: [PATCH 066/149] add tone row --- src/window.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 11b6724fc..19122fad4 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] - self.get_application().update_theme_from_monet(self.monet_theme) + #self.get_application().update_theme_from_monet(self.monet_theme, self.tone_row.get_selected_item()) def setup_monet_page(self): @@ -133,6 +133,22 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) + + store = Gtk.ListStore(str) + store_values = [ + "1", + "5", + "10", + "15", + "20", + "25", + "United Kingdom", + "United States of America", + "Uruguay", + ] + for v in store_values: + store.append([v]) + self.tone_row.set_list_factory(store) print(dir(self.tone_row)) def setup_plugins_page(self): From 07e22ed96ec3235362fe97b9eba18dc42d3e7607 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:04:09 +0200 Subject: [PATCH 067/149] update list factory --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 19122fad4..f84a5318a 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListStore(str) + store = Gtk.ListItemFactory(str) store_values = [ "1", "5", From e1ff0aa84875576437f24bf4eb582d27a9d37b03 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:04:34 +0200 Subject: [PATCH 068/149] fix bug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index f84a5318a..8353a828f 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListItemFactory(str) + store = Gtk.ListItemFactory() store_values = [ "1", "5", From ce2067fd00189e92983b24011ea4127c983e9300 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:05:14 +0200 Subject: [PATCH 069/149] add debug info --- src/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window.py b/src/window.py index 8353a828f..7bc102f3e 100644 --- a/src/window.py +++ b/src/window.py @@ -135,6 +135,7 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.ListItemFactory() + print(dir(store)) store_values = [ "1", "5", From 11448c487a8b9a63e843163b5332e1438e99268b Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:06:23 +0200 Subject: [PATCH 070/149] update tone row --- src/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 7bc102f3e..a99b42d00 100644 --- a/src/window.py +++ b/src/window.py @@ -147,8 +147,7 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - for v in store_values: - store.append([v]) + store.set_data(store_values) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From c81d7af57511aa01501975cab814d9d510c70e0d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:07:34 +0200 Subject: [PATCH 071/149] update tone row --- src/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index a99b42d00..0e61c581d 100644 --- a/src/window.py +++ b/src/window.py @@ -147,7 +147,8 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - store.set_data(store_values) + store.replace_qdata(store_values) + store.replace_data(store_values) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From 352ae0c33575f76f96b6c8371f7aa79153cafcef Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:09:18 +0200 Subject: [PATCH 072/149] use GtkStringList --- src/window.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/window.py b/src/window.py index 0e61c581d..b35550b53 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListItemFactory() + store = Gtk.StringList() print(dir(store)) store_values = [ "1", @@ -147,8 +147,8 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - store.replace_qdata(store_values) - store.replace_data(store_values) + for v in store_values: + store.append([v]) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From c50cb8d000238e685bab787f1ad7518763088934 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:09:42 +0200 Subject: [PATCH 073/149] fix error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b35550b53..b28bac1d1 100644 --- a/src/window.py +++ b/src/window.py @@ -148,7 +148,7 @@ def setup_monet_page(self): "Uruguay", ] for v in store_values: - store.append([v]) + store.append(v) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From 5744873bb80e64db6949e5ac5bff2e2f9a2df308 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:10:26 +0200 Subject: [PATCH 074/149] use set_model --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b28bac1d1..258025af3 100644 --- a/src/window.py +++ b/src/window.py @@ -149,7 +149,7 @@ def setup_monet_page(self): ] for v in store_values: store.append(v) - self.tone_row.set_list_factory(store) + self.tone_row.set_model(store) print(dir(self.tone_row)) def setup_plugins_page(self): From 35f78ffb9cfdbac53cd1468e2eb3ab99dc17db9c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:11:07 +0200 Subject: [PATCH 075/149] add tone row to the page --- src/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 258025af3..434c417a6 100644 --- a/src/window.py +++ b/src/window.py @@ -135,7 +135,6 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - print(dir(store)) store_values = [ "1", "5", @@ -150,7 +149,7 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - print(dir(self.tone_row)) + self.content_monet.add(self.tone_row) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From d3d5c3987e153922a51467b62499900a522b5895 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:11:47 +0200 Subject: [PATCH 076/149] update pref group --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 434c417a6..7ce2b1cf8 100644 --- a/src/window.py +++ b/src/window.py @@ -129,7 +129,6 @@ def setup_monet_page(self): self.palette_picker.add_suffix(picker) monet_pref_group.add(self.palette_picker) - self.content_monet.add(monet_pref_group) self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) @@ -149,7 +148,8 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - self.content_monet.add(self.tone_row) + monet_pref_group.add(self.tone_row) + self.content_monet.add(monet_pref_group) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From 7c50a5dc38c068761ecb9e509f6a62b7e301988e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:19:28 +0200 Subject: [PATCH 077/149] set colorpalette --- src/window.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/window.py b/src/window.py index 7ce2b1cf8..4ae21ec71 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,25 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] - #self.get_application().update_theme_from_monet(self.monet_theme, self.tone_row.get_selected_item()) + self.tone = self.tone_row.get_selected_item() + + i = 0 + """ + {'primary': , + 'secondary': , + 'tertiary': , + 'neutral': , + 'neutralVariant': , + 'error': } + """ + print(self.monet_palette) + print(self.monet_theme) + for color in self.monet_palette.values(): + i+=1 + color = color.tone(self.tone) + self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + + #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): @@ -119,7 +137,7 @@ def setup_monet_page(self): self.palette_picker.set_title(_("Monet Palette")) self.palette_picker self.palette_pickers = {} - for i in range(5): + for i in range(6): i = i+1 picker = Gtk.ColorButton() picker.set_name(str(i)) @@ -141,9 +159,7 @@ def setup_monet_page(self): "15", "20", "25", - "United Kingdom", - "United States of America", - "Uruguay", + "30" ] for v in store_values: store.append(v) From b2a5ddd77d5096076242d8cf9192f9079b8181ae Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:20:34 +0200 Subject: [PATCH 078/149] add debug --- src/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window.py b/src/window.py index 4ae21ec71..b554ae472 100644 --- a/src/window.py +++ b/src/window.py @@ -86,6 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() + dir(self.monet_img) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From 26a74fe18f7075f6733f52b76da136449ff534db Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:21:09 +0200 Subject: [PATCH 079/149] fix bug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b554ae472..fb291e46c 100644 --- a/src/window.py +++ b/src/window.py @@ -86,7 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - dir(self.monet_img) + dir(self.monet_image_file) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From f3755eb8a1dc1dc32a0820af5b3ae53cbba5a0da Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:21:48 +0200 Subject: [PATCH 080/149] print debug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index fb291e46c..de17ed356 100644 --- a/src/window.py +++ b/src/window.py @@ -86,7 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - dir(self.monet_image_file) + print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From dbff368414eb89e07e9d65a284aad21806b23ef0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:24:58 +0200 Subject: [PATCH 081/149] use path instead of g object --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index de17ed356..83dec7b83 100644 --- a/src/window.py +++ b/src/window.py @@ -87,7 +87,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() print(dir(self.monet_image_file)) - self.monet_img = Image.open(self.monet_image_file) + self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] self.tone = self.tone_row.get_selected_item() From 028bad472421942cd85ece601bfe80362dfccb8e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:25:47 +0200 Subject: [PATCH 082/149] fix typo error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 83dec7b83..4780fa299 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,7 @@ def on_monet_file_chooser_response(self, widget, response): print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) - self.monet_palette = self.monet_theme["palette"] + self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() i = 0 From d1aa1a93cd637ad3b5cdb7a573c21a5e2e459c29 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:27:07 +0200 Subject: [PATCH 083/149] convert into int --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 4780fa299..4f5d6a4c8 100644 --- a/src/window.py +++ b/src/window.py @@ -86,11 +86,11 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() + print(dir(self.tone)) i = 0 """ @@ -105,7 +105,7 @@ def on_monet_file_chooser_response(self, widget, response): print(self.monet_theme) for color in self.monet_palette.values(): i+=1 - color = color.tone(self.tone) + color = color.tone(int(self.tone)) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) From d08f4acba7bd2fa80014900ad50437f8b8b3df31 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:28:31 +0200 Subject: [PATCH 084/149] fix error --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 4f5d6a4c8..275917824 100644 --- a/src/window.py +++ b/src/window.py @@ -90,7 +90,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - print(dir(self.tone)) + print(dir(self.tone.get_string())) i = 0 """ @@ -105,7 +105,7 @@ def on_monet_file_chooser_response(self, widget, response): print(self.monet_theme) for color in self.monet_palette.values(): i+=1 - color = color.tone(int(self.tone)) + color = color.tone(int(self.tone.get_string())) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) From 20d21ba39cd6a7c521ba1004e13a1f550b1bd4f5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:29:49 +0200 Subject: [PATCH 085/149] print debug --- src/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 275917824..866929fe4 100644 --- a/src/window.py +++ b/src/window.py @@ -90,7 +90,6 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - print(dir(self.tone.get_string())) i = 0 """ @@ -106,8 +105,10 @@ def on_monet_file_chooser_response(self, widget, response): for color in self.monet_palette.values(): i+=1 color = color.tone(int(self.tone.get_string())) + print(color) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + self.palette_pickers["1"].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): From fd5e7ac4994d76520564c938527751523d7b26bb Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:38:57 +0200 Subject: [PATCH 086/149] add toast when reset --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index e94f41da8..3b2e0e9a2 100644 --- a/src/main.py +++ b/src/main.py @@ -433,6 +433,7 @@ def reset_color_scheme(self, widget, response): file.delete() except Exception: pass + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( From 071bcaf2145fbdd43adb394cd8083e9ebf43dfff Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:44:22 +0200 Subject: [PATCH 087/149] update palette --- src/window.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/window.py b/src/window.py index 866929fe4..0c2b77390 100644 --- a/src/window.py +++ b/src/window.py @@ -102,22 +102,33 @@ def on_monet_file_chooser_response(self, widget, response): """ print(self.monet_palette) print(self.monet_theme) + self.monet_pref_group.remove(self.palette_picker) + + self.palette_picker = Adw.ActionRow() + self.palette_picker.set_name("monet_palette") + self.palette_picker.set_title(_("Monet Palette")) + self.palette_picker + self.palette_pickers = {} + i = 0 for color in self.monet_palette.values(): - i+=1 + i = i+1 + picker = Gtk.ColorButton() + picker.set_name(str(i)) color = color.tone(int(self.tone.get_string())) - print(color) - self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) - - self.palette_pickers["1"].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + picker.set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + picker.set_valign(Gtk.Align.CENTER) + self.palette_pickers[str(i)] = picker + self.palette_picker.add_suffix(picker) + self.monet_pref_group.add(self.palette_picker) #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): - monet_pref_group = Adw.PreferencesGroup() - monet_pref_group.set_name("monet") - monet_pref_group.set_title(_("Monet Engine")) - monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + self.monet_pref_group = Adw.PreferencesGroup() + self.monet_pref_group.set_name("monet") + self.monet_pref_group.set_title(_("Monet Engine")) + self.monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -132,7 +143,7 @@ def setup_monet_page(self): self.monet_file_chooser_button.connect("clicked", self.on_file_picker_button_clicked ) self.monet_file_chooser_dialog.connect("response", self.on_monet_file_chooser_response ) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) - monet_pref_group.add(self.monet_file_chooser_row) + self.monet_pref_group.add(self.monet_file_chooser_row) self.palette_picker = Adw.ActionRow() self.palette_picker.set_name("monet_palette") @@ -147,7 +158,7 @@ def setup_monet_page(self): picker.set_valign(Gtk.Align.CENTER) self.palette_pickers[str(i)] = picker self.palette_picker.add_suffix(picker) - monet_pref_group.add(self.palette_picker) + self.monet_pref_group.add(self.palette_picker) self.tone_row = Adw.ComboRow() From 2257a5afeea8c505e8d005afa551eda5d0c3c41a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:45:10 +0200 Subject: [PATCH 088/149] fix bug --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 0c2b77390..07e160ed9 100644 --- a/src/window.py +++ b/src/window.py @@ -177,8 +177,8 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - monet_pref_group.add(self.tone_row) - self.content_monet.add(monet_pref_group) + self.monet_pref_group.add(self.tone_row) + self.content_monet.add(self.monet_pref_group) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From 160e46863ad81602915df718ee421f17772bca09 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:55:12 +0200 Subject: [PATCH 089/149] update tone generation --- src/main.py | 3 ++ src/window.py | 99 ++++++++++++++++----------------------------------- 2 files changed, 33 insertions(+), 69 deletions(-) diff --git a/src/main.py b/src/main.py index 3b2e0e9a2..cb961f23a 100644 --- a/src/main.py +++ b/src/main.py @@ -206,6 +206,9 @@ def load_preset_variables(self, preset): self.reload_variables() + def update_theme_from_monet(self, theme, tone): + pass + def generate_gtk_css(self, app_type): final_css = "" for key in self.variables.keys(): diff --git a/src/window.py b/src/window.py index 07e160ed9..394b64723 100644 --- a/src/window.py +++ b/src/window.py @@ -35,6 +35,7 @@ from .custom_css_group import AdwcustomizerCustomCSSGroup from material_color_utilities_python import * + @Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') class AdwcustomizerMainWindow(Adw.ApplicationWindow): __gtype_name__ = 'AdwcustomizerMainWindow' @@ -52,7 +53,8 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) - self.presets_dropdown.get_popover().connect("show", self.on_presets_dropdown_activate) + self.presets_dropdown.get_popover().connect( + "show", self.on_presets_dropdown_activate) self.setup_monet_page() self.setup_plugins_page() @@ -81,99 +83,54 @@ def on_file_picker_button_clicked(self, *args): def on_monet_file_chooser_response(self, widget, response): if response == Gtk.ResponseType.ACCEPT: - self.monet_image_file = self.monet_file_chooser_dialog.get_file() + self.monet_image_file = self.monet_file_chooser_dialog.get_file() image_basename = self.monet_image_file.get_basename() self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) - self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - - i = 0 - """ - {'primary': , - 'secondary': , - 'tertiary': , - 'neutral': , - 'neutralVariant': , - 'error': } - """ - print(self.monet_palette) - print(self.monet_theme) - self.monet_pref_group.remove(self.palette_picker) - - self.palette_picker = Adw.ActionRow() - self.palette_picker.set_name("monet_palette") - self.palette_picker.set_title(_("Monet Palette")) - self.palette_picker - self.palette_pickers = {} - i = 0 - for color in self.monet_palette.values(): - i = i+1 - picker = Gtk.ColorButton() - picker.set_name(str(i)) - color = color.tone(int(self.tone.get_string())) - picker.set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) - picker.set_valign(Gtk.Align.CENTER) - self.palette_pickers[str(i)] = picker - self.palette_picker.add_suffix(picker) - self.monet_pref_group.add(self.palette_picker) - #self.get_application().update_theme_from_monet(self.monet_theme) + self.get_application().update_theme_from_monet(self.monet_theme, self.tone) def setup_monet_page(self): - self.monet_pref_group = Adw.PreferencesGroup() self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) - self.monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + self.monet_pref_group.set_description( + _("Monet is an engine that generates Material Design 3 palette from backgrounds color")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) - + self.monet_file_chooser_dialog = Gtk.FileChooserNative() self.monet_file_chooser_dialog.set_transient_for(self) self.monet_file_chooser_button = Gtk.Button() self.monet_file_chooser_button.set_label(_("Choose a file")) - self.monet_file_chooser_button.set_icon_name("folder-pictures-symbolic") + self.monet_file_chooser_button.set_icon_name( + "folder-pictures-symbolic") - self.monet_file_chooser_button.connect("clicked", self.on_file_picker_button_clicked ) - self.monet_file_chooser_dialog.connect("response", self.on_monet_file_chooser_response ) + self.monet_file_chooser_button.connect( + "clicked", self.on_file_picker_button_clicked) + self.monet_file_chooser_dialog.connect( + "response", self.on_monet_file_chooser_response) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) self.monet_pref_group.add(self.monet_file_chooser_row) - self.palette_picker = Adw.ActionRow() - self.palette_picker.set_name("monet_palette") - self.palette_picker.set_title(_("Monet Palette")) - self.palette_picker - self.palette_pickers = {} - for i in range(6): - i = i+1 - picker = Gtk.ColorButton() - picker.set_name(str(i)) - picker.set_rgba(Gdk.RGBA(red=0, green=0, blue=0, alpha=0)) - picker.set_valign(Gtk.Align.CENTER) - self.palette_pickers[str(i)] = picker - self.palette_picker.add_suffix(picker) + self.monet_palette_shades = AdwcustomizerPaletteShades("monet", + "Monet Palette", + 6) self.monet_pref_group.add(self.palette_picker) - self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - store_values = [ - "1", - "5", - "10", - "15", - "20", - "25", - "30" - ] + store_values = ["1"] + for i in range(5, 100, 5): + store_values.append(str(i)) for v in store_values: store.append(v) self.tone_row.set_model(store) @@ -198,26 +155,29 @@ def setup_colors_page(self): for variable in group["variables"]: pref_variable = AdwcustomizerOption(variable["name"], variable["title"], - variable.get("explanation"), + variable.get( + "explanation"), variable["adw_gtk3_support"]) pref_group.add(pref_variable) - self.get_application().pref_variables[variable["name"]] = pref_variable + self.get_application( + ).pref_variables[variable["name"]] = pref_variable self.content.add(pref_group) palette_pref_group = Adw.PreferencesGroup() palette_pref_group.set_name("palette_colors") palette_pref_group.set_title(_("Palette Colors")) - palette_pref_group.set_description(_("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) + palette_pref_group.set_description( + _("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) for color in settings_schema["palette"]: palette_shades = AdwcustomizerPaletteShades(color["prefix"], color["title"], color["n_shades"]) palette_pref_group.add(palette_shades) - self.get_application().pref_palette_shades[color["prefix"]] = palette_shades + self.get_application( + ).pref_palette_shades[color["prefix"]] = palette_shades self.content.add(palette_pref_group) - def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) while child is not None: @@ -225,7 +185,8 @@ def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) self.errors_button.set_visible(len(errors) > 0) for error in errors: - self.errors_list.append(AdwcustomizerError(error["error"], error["element"], error["line"])) + self.errors_list.append(AdwcustomizerError( + error["error"], error["element"], error["line"])) def on_presets_dropdown_activate(self, *args): self.get_application().reload_user_defined_presets() From 5d6f4697e512f1016f194709edbd054e00694e87 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:55:49 +0200 Subject: [PATCH 090/149] fix error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 394b64723..67ca2771b 100644 --- a/src/window.py +++ b/src/window.py @@ -122,7 +122,7 @@ def setup_monet_page(self): self.monet_palette_shades = AdwcustomizerPaletteShades("monet", "Monet Palette", 6) - self.monet_pref_group.add(self.palette_picker) + self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) From 93f07e1ff673d3c187ddc776cc3fef445807cd58 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:57:29 +0200 Subject: [PATCH 091/149] add 0xMRTT as translator --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index cb961f23a..a8671c20e 100644 --- a/src/main.py +++ b/src/main.py @@ -449,8 +449,8 @@ def show_about_window(self, *_args): issue_url="https://github.com/AdwCustomizerTeam/AdwCustomizer/issues", developers=[ 'Artyom "ArtyIF" Fomin https://github.com/ArtyIF', - "Verantor https://github.com/Verantor", "0xMRTT https://github.com/0xMRTT", + "Verantor https://github.com/Verantor", ], artists=[ 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' @@ -466,6 +466,7 @@ def show_about_window(self, *_args): Renato Corrêa https://www.transifex.com/user/profile/renatocrrs/ Aggelos Tselios https://www.transifex.com/user/profile/AndroGR/ David "Daudix UFO" Lapshin https://github.com/daudix-UFO' + 0xMRTT https://github.com/0xMRTT Juanjo Cillero https://www.transifex.com/user/profile/renux918/ Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", From f390b01cda4ac7e39caccb1433dcca37a8dc9ec4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 13:02:13 +0200 Subject: [PATCH 092/149] remove PR --- .github/workflows/flatpak-nightly.yml | 1 - .github/workflows/flatpak.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index e05befe07..fa297f23a 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -2,7 +2,6 @@ name: Build flatpak nightly on: push: branches: [next] - pull_request: jobs: flatpak: name: "Flatpak" diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 8d1b02d48..69360a41c 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -2,7 +2,6 @@ name: Build flatpak on: push: branches: [main] - pull_request: jobs: flatpak: name: "Flatpak" From 9aae287cb07333be89d0374f74bed067f8a56366 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:22:08 +0200 Subject: [PATCH 093/149] use palette shades --- src/main.py | 11 ++++++++++- src/window.py | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a8671c20e..f4c360cdd 100644 --- a/src/main.py +++ b/src/main.py @@ -26,6 +26,7 @@ import gi from gi.repository import Gtk, Gdk, Gio, Adw, GLib, Xdp, XdpGtk4 +from material_color_utilities_python import * from .settings_schema import settings_schema from .window import AdwcustomizerMainWindow @@ -207,7 +208,15 @@ def load_preset_variables(self, preset): self.reload_variables() def update_theme_from_monet(self, theme, tone): - pass + palettes = theme["palettes"] + + palette = {} + i = 0 + for color in palettes.values(): + i += 1 + palette[str(i)] = hexFromArgb(color.tone(tone)) + + self.pref_palette_shades["monet"].update_shades() def generate_gtk_css(self, app_type): final_css = "" diff --git a/src/window.py b/src/window.py index 67ca2771b..b92e6eeed 100644 --- a/src/window.py +++ b/src/window.py @@ -122,6 +122,8 @@ def setup_monet_page(self): self.monet_palette_shades = AdwcustomizerPaletteShades("monet", "Monet Palette", 6) + self.get_application( + ).pref_palette_shades["monet"] = self.monet_palette_shades self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() From 91d7e5f7bb578df08e07bcb1e326e332b8a108bc Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:23:31 +0200 Subject: [PATCH 094/149] fix error --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index f4c360cdd..274dae147 100644 --- a/src/main.py +++ b/src/main.py @@ -214,7 +214,7 @@ def update_theme_from_monet(self, theme, tone): i = 0 for color in palettes.values(): i += 1 - palette[str(i)] = hexFromArgb(color.tone(tone)) + palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) self.pref_palette_shades["monet"].update_shades() From c98f8df6101f5fad3639dc9f3423073d85837eac Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:24:16 +0200 Subject: [PATCH 095/149] add missin arg --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 274dae147..fbaf678a4 100644 --- a/src/main.py +++ b/src/main.py @@ -216,7 +216,7 @@ def update_theme_from_monet(self, theme, tone): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) - self.pref_palette_shades["monet"].update_shades() + self.pref_palette_shades["monet"].update_shades(palette) def generate_gtk_css(self, app_type): final_css = "" From 3ad2ebc2586d394dcb40e421a4270512f7f36226 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:25:48 +0200 Subject: [PATCH 096/149] add debug --- src/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.py b/src/main.py index fbaf678a4..ff7dceddf 100644 --- a/src/main.py +++ b/src/main.py @@ -216,6 +216,8 @@ def update_theme_from_monet(self, theme, tone): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) + print(palette) + self.pref_palette_shades["monet"].update_shades(palette) def generate_gtk_css(self, app_type): From b26d9a8df76e83ad27f41280a857f60f40273644 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:45:45 +0200 Subject: [PATCH 097/149] remove tone 1 --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b92e6eeed..efc166bea 100644 --- a/src/window.py +++ b/src/window.py @@ -130,7 +130,7 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - store_values = ["1"] + store_values = [] for i in range(5, 100, 5): store_values.append(str(i)) for v in store_values: From d5bce25c1e699e947049bfa4af0c4e1159fa006d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:55:00 +0200 Subject: [PATCH 098/149] add theme row --- src/window.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/window.py b/src/window.py index efc166bea..5bfb54f19 100644 --- a/src/window.py +++ b/src/window.py @@ -137,6 +137,16 @@ def setup_monet_page(self): store.append(v) self.tone_row.set_model(store) self.monet_pref_group.add(self.tone_row) + + self.monet_theme_row = Adw.ComboRow() + self.monet_theme_row.set_title(_("Theme")) + + store = Gtk.StringList() + store.append("Dark") + store.append("Light") + self.monet_theme_row.set_model(store) + self.monet_pref_group.add(self.monet_theme_row) + self.content_monet.add(self.monet_pref_group) def setup_plugins_page(self): From e2c9b1717836ff21233cecb7e7b102fedc181f08 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:00:07 +0200 Subject: [PATCH 099/149] add monet theme selector --- src/main.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++- src/window.py | 3 ++- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index ff7dceddf..a37cd3993 100644 --- a/src/main.py +++ b/src/main.py @@ -207,9 +207,11 @@ def load_preset_variables(self, preset): self.reload_variables() - def update_theme_from_monet(self, theme, tone): + def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] + monet_theme = monet_theme.get_string() + palette = {} i = 0 for color in palettes.values(): @@ -220,6 +222,56 @@ def update_theme_from_monet(self, theme, tone): self.pref_palette_shades["monet"].update_shades(palette) + print(theme) + + self.variable = { + "accent_color": theme["schemes"]["light"]["primary"], + "accent_bg_color": theme["schemes"]["light"]["primaryContainer"], + "accent_fg_color": theme["schemes"]["light"]["onPrimaryContainer"], + + "destructive_color": theme["schemes"]["light"][""], + "destructive_bg_color": theme["schemes"]["light"][""], + "destructive_fg_color": theme["schemes"]["light"][""], + + "success_color": theme["schemes"]["light"][""], + "success_bg_color": theme["schemes"]["light"][""], + "success_fg_color": theme["schemes"]["light"][""], + + "warning_color": theme["schemes"]["light"][""], + "warning_bg_color": theme["schemes"]["light"][""], + "warning_fg_color": "rgba(0, 0, 0, 0.8)", + + "error_color": theme["schemes"]["light"][""], + "error_bg_color": theme["schemes"]["light"][""], + "error_fg_color": theme["schemes"]["light"][""], + + "window_bg_color": theme["schemes"]["light"][""], + "window_fg_color": theme["schemes"]["light"][""], + + "view_bg_color": theme["schemes"]["light"][""], + "view_fg_color": theme["schemes"]["light"][""], + + "headerbar_bg_color": theme["schemes"]["light"][""], + "headerbar_fg_color": "rgba(0, 0, 0, 0.8)", + "headerbar_border_color": "rgba(0, 0, 0, 0.8)", + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": "rgba(0, 0, 0, 0.07)", + + "card_bg_color": theme["schemes"]["light"][""], + "card_fg_color": "rgba(0, 0, 0, 0.8)", + "card_shade_color": "rgba(0, 0, 0, 0.07)", + + "dialog_bg_color": theme["schemes"]["light"][""], + "dialog_fg_color": "rgba(0, 0, 0, 0.8)", + + "popover_bg_color": theme["schemes"]["light"][""], + "popover_fg_color": "rgba(0, 0, 0, 0.8)", + + "shade_color": theme["schemes"]["light"][""], + "scrollbar_outline_color": theme["schemes"]["light"][""] + } + + def generate_gtk_css(self, app_type): final_css = "" for key in self.variables.keys(): diff --git a/src/window.py b/src/window.py index 5bfb54f19..d38272320 100644 --- a/src/window.py +++ b/src/window.py @@ -91,7 +91,8 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() - self.get_application().update_theme_from_monet(self.monet_theme, self.tone) + self.monet_theme = self.monet_theme_row.get_selected_item() + self.get_application().update_theme_from_monet(self.monet_theme, self.tone, self.monet_theme) def setup_monet_page(self): From d2bde49e06d23a38d29d181bd8d80c38e56e9f68 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:00:33 +0200 Subject: [PATCH 100/149] add debug info --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index a37cd3993..c0d609958 100644 --- a/src/main.py +++ b/src/main.py @@ -222,6 +222,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): self.pref_palette_shades["monet"].update_shades(palette) + print(monet_theme) print(theme) self.variable = { From 47c4218523062b457958d1a3048eca133d6084fa Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:03:57 +0200 Subject: [PATCH 101/149] fix duplicated name --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index d38272320..08e14604d 100644 --- a/src/window.py +++ b/src/window.py @@ -89,10 +89,10 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() self.monet_img = Image.open(self.monet_image_file.get_path()) - self.monet_theme = themeFromImage(self.monet_img) + self.theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.monet_theme, self.tone, self.monet_theme) + self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) def setup_monet_page(self): From f5f8580b2e1a5ba31ea2dc6079ff7dcc1a498705 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:39:31 +0200 Subject: [PATCH 102/149] add automatic theme generation. Need test --- src/main.py | 137 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 101 insertions(+), 36 deletions(-) diff --git a/src/main.py b/src/main.py index c0d609958..314d21aeb 100644 --- a/src/main.py +++ b/src/main.py @@ -207,10 +207,22 @@ def load_preset_variables(self, preset): self.reload_variables() + + def rgba_from_argb(self, argb, alpha = None) -> str: + base = "rgba({}, {}, {}, {})" + + red = redFromArgb(argb) + green = greenFromArgb(argb) + blue = blueFromArgb(argb) + if not alpha: + alpha = alphaFromArgb(argb) + + return base.format(red, green, blue, alpha) + def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] - monet_theme = monet_theme.get_string() + monet_theme = monet_theme.get_string().lower() # dark / light palette = {} i = 0 @@ -225,53 +237,106 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(monet_theme) print(theme) - self.variable = { - "accent_color": theme["schemes"]["light"]["primary"], - "accent_bg_color": theme["schemes"]["light"]["primaryContainer"], - "accent_fg_color": theme["schemes"]["light"]["onPrimaryContainer"], + if monet_theme == "dark": + dark_theme = theme["schemes"]["dark"].toJSON() + self.variable = { + "accent_color": dark_theme["primary"], + "accent_bg_color": dark_theme["primaryContainer"], + "accent_fg_color": dark_theme["onPrimaryContainer"], + + "destructive_color": dark_theme["error"], + "destructive_bg_color": dark_theme["errorContainer"], + "destructive_fg_color": dark_theme["onError"], + + "success_color": dark_theme["tertiary"], + "success_bg_color": dark_theme["onTertiary"], + "success_fg_color": dark_theme["tertiaryContainer"], + + "warning_color": dark_theme["secondaryContainer"], + "warning_bg_color": dark_theme["inversePrimary"], + "warning_fg_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + + "error_color": dark_theme["error"], + "error_bg_color": dark_theme["errorContainer"], + "error_fg_color": dark_theme["onError"], + + "window_bg_color": dark_theme["surface"], + "window_fg_color": dark_theme["onSurface"], - "destructive_color": theme["schemes"]["light"][""], - "destructive_bg_color": theme["schemes"]["light"][""], - "destructive_fg_color": theme["schemes"]["light"][""], + "view_bg_color": dark_theme["surface"], + "view_fg_color": dark_theme["onSurface"], - "success_color": theme["schemes"]["light"][""], - "success_bg_color": theme["schemes"]["light"][""], - "success_fg_color": theme["schemes"]["light"][""], + "headerbar_bg_color": dark_theme["surface"], + "headerbar_fg_color": dark_theme["onSurface"], + "headerbar_border_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": dark_theme["shadow"], - "warning_color": theme["schemes"]["light"][""], - "warning_bg_color": theme["schemes"]["light"][""], - "warning_fg_color": "rgba(0, 0, 0, 0.8)", + "card_bg_color": self.rgba_from_argb(dark_theme["primary"], "0.05"), + "card_fg_color": dark_theme["surfaceVariant"], + "card_shade_color": dark_theme["shadow"], - "error_color": theme["schemes"]["light"][""], - "error_bg_color": theme["schemes"]["light"][""], - "error_fg_color": theme["schemes"]["light"][""], + "dialog_bg_color": dark_theme["secondaryContainer"], + "dialog_fg_color": dark_theme["onSecondaryContainer"], - "window_bg_color": theme["schemes"]["light"][""], - "window_fg_color": theme["schemes"]["light"][""], + "popover_bg_color": dark_theme["secondaryContainer"], + "popover_fg_color": dark_theme["onSecondaryContainer"], - "view_bg_color": theme["schemes"]["light"][""], - "view_fg_color": theme["schemes"]["light"][""], + "shade_color": dark_theme["shadow"], + "scrollbar_outline_color": dark_theme["outline"] + } + else: # light + light_theme = theme["schemes"]["light"].toJSON() + self.variable = { + "accent_color": light_theme["primary"], + "accent_bg_color": light_theme["primaryContainer"], + "accent_fg_color": light_theme["onPrimaryContainer"], - "headerbar_bg_color": theme["schemes"]["light"][""], - "headerbar_fg_color": "rgba(0, 0, 0, 0.8)", - "headerbar_border_color": "rgba(0, 0, 0, 0.8)", - "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": "rgba(0, 0, 0, 0.07)", + "destructive_color": light_theme["error"], + "destructive_bg_color": light_theme["errorContainer"], + "destructive_fg_color": light_theme["onError"], - "card_bg_color": theme["schemes"]["light"][""], - "card_fg_color": "rgba(0, 0, 0, 0.8)", - "card_shade_color": "rgba(0, 0, 0, 0.07)", + "success_color": light_theme["tertiary"], + "success_bg_color": light_theme["onTertiary"], + "success_fg_color": light_theme["tertiaryContainer"], - "dialog_bg_color": theme["schemes"]["light"][""], - "dialog_fg_color": "rgba(0, 0, 0, 0.8)", + "warning_color": light_theme["secondaryContainer"], + "warning_bg_color": light_theme["inversePrimary"], + "warning_fg_color": self.rgba_from_argb(light_theme["primary"], "0.8"), - "popover_bg_color": theme["schemes"]["light"][""], - "popover_fg_color": "rgba(0, 0, 0, 0.8)", + "error_color": light_theme["error"], + "error_bg_color": light_theme["errorContainer"], + "error_fg_color": light_theme["onError"], - "shade_color": theme["schemes"]["light"][""], - "scrollbar_outline_color": theme["schemes"]["light"][""] - } + "window_bg_color": light_theme["surface"], + "window_fg_color": light_theme["onSurface"], + "view_bg_color": light_theme["surface"], + "view_fg_color": light_theme["onSurface"], + + "headerbar_bg_color": light_theme["surface"], + "headerbar_fg_color": light_theme["onSurface"], + "headerbar_border_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": light_theme["shadow"], + + "card_bg_color": self.rgba_from_argb(light_theme["primary"], "0.05"), + "card_fg_color": light_theme["surfaceVariant"], + "card_shade_color": light_theme["shadow"], + + "dialog_bg_color": light_theme["secondaryContainer"], + "dialog_fg_color": light_theme["onSecondaryContainer"], + + "popover_bg_color": light_theme["secondaryContainer"], + "popover_fg_color": light_theme["onSecondaryContainer"], + + "shade_color": light_theme["shadow"], + "scrollbar_outline_color": light_theme["outline"] + } + + for key in self.variables.keys(): + if key in self.pref_variables: + self.pref_variables[key].update_value(self.variables[key]) def generate_gtk_css(self, app_type): final_css = "" From eb52f52fbb6c7fe4dc92771af839a39776c0e840 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:41:46 +0200 Subject: [PATCH 103/149] fix error --- src/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 314d21aeb..9e08e3b0d 100644 --- a/src/main.py +++ b/src/main.py @@ -239,7 +239,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"].toJSON() - self.variable = { + variable = { "accent_color": dark_theme["primary"], "accent_bg_color": dark_theme["primaryContainer"], "accent_fg_color": dark_theme["onPrimaryContainer"], @@ -287,7 +287,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): } else: # light light_theme = theme["schemes"]["light"].toJSON() - self.variable = { + variable = { "accent_color": light_theme["primary"], "accent_bg_color": light_theme["primaryContainer"], "accent_fg_color": light_theme["onPrimaryContainer"], @@ -334,9 +334,9 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "scrollbar_outline_color": light_theme["outline"] } - for key in self.variables.keys(): + for key in variables.keys(): if key in self.pref_variables: - self.pref_variables[key].update_value(self.variables[key]) + self.pref_variables[key].update_value(variables[key]) def generate_gtk_css(self, app_type): final_css = "" From 8c25c94e9545968462508b63e50772cff267050c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:44:12 +0200 Subject: [PATCH 104/149] add reload --- src/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.py b/src/main.py index 9e08e3b0d..0dab116bd 100644 --- a/src/main.py +++ b/src/main.py @@ -337,6 +337,8 @@ def update_theme_from_monet(self, theme, tone, monet_theme): for key in variables.keys(): if key in self.pref_variables: self.pref_variables[key].update_value(variables[key]) + + self.reload_variables() def generate_gtk_css(self, app_type): final_css = "" From aada5ae201fd69e6ec9a7e8458eda551b912f6f0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:46:00 +0200 Subject: [PATCH 105/149] add conditon --- src/window.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/window.py b/src/window.py index 08e14604d..205942adc 100644 --- a/src/window.py +++ b/src/window.py @@ -88,11 +88,12 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - self.monet_img = Image.open(self.monet_image_file.get_path()) - self.theme = themeFromImage(self.monet_img) - self.tone = self.tone_row.get_selected_item() - self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) + if response == Gtk.ResponseType.ACCEPT: + self.monet_img = Image.open(self.monet_image_file.get_path()) + self.theme = themeFromImage(self.monet_img) + self.tone = self.tone_row.get_selected_item() + self.monet_theme = self.monet_theme_row.get_selected_item() + self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) def setup_monet_page(self): From df673661572dccafe6ee7d0aad165b7e7905d29c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:57:41 +0200 Subject: [PATCH 106/149] fix error --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 0dab116bd..4089c2bb2 100644 --- a/src/main.py +++ b/src/main.py @@ -240,7 +240,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"].toJSON() variable = { - "accent_color": dark_theme["primary"], + "accent_color": dark_theme.primary, "accent_bg_color": dark_theme["primaryContainer"], "accent_fg_color": dark_theme["onPrimaryContainer"], @@ -334,9 +334,9 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "scrollbar_outline_color": light_theme["outline"] } - for key in variables.keys(): + for key in variable.keys(): if key in self.pref_variables: - self.pref_variables[key].update_value(variables[key]) + self.pref_variables[key].update_value(variable[key]) self.reload_variables() From 686035177b84911702658937f9e43bcbee7e2173 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:58:53 +0200 Subject: [PATCH 107/149] fix bug --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 4089c2bb2..a8870f66b 100644 --- a/src/main.py +++ b/src/main.py @@ -238,11 +238,11 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(theme) if monet_theme == "dark": - dark_theme = theme["schemes"]["dark"].toJSON() + dark_theme = theme["schemes"]["dark"] variable = { "accent_color": dark_theme.primary, - "accent_bg_color": dark_theme["primaryContainer"], - "accent_fg_color": dark_theme["onPrimaryContainer"], + "accent_bg_color": dark_theme.primaryContainer, + "accent_fg_color": dark_theme.onPrimaryContainer, "destructive_color": dark_theme["error"], "destructive_bg_color": dark_theme["errorContainer"], From a4f48a11b44b4d988423015097f967923932c390 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:03:34 +0200 Subject: [PATCH 108/149] update dark sheme --- src/main.py | 60 ++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/main.py b/src/main.py index a8870f66b..143e5d934 100644 --- a/src/main.py +++ b/src/main.py @@ -244,49 +244,49 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_bg_color": dark_theme.primaryContainer, "accent_fg_color": dark_theme.onPrimaryContainer, - "destructive_color": dark_theme["error"], - "destructive_bg_color": dark_theme["errorContainer"], - "destructive_fg_color": dark_theme["onError"], + "destructive_color": dark_theme.error, + "destructive_bg_color": dark_theme.errorContainer, + "destructive_fg_color": dark_theme.onError, - "success_color": dark_theme["tertiary"], - "success_bg_color": dark_theme["onTertiary"], - "success_fg_color": dark_theme["tertiaryContainer"], + "success_color": dark_theme.tertiary, + "success_bg_color": dark_theme.onTertiary, + "success_fg_color": dark_theme.tertiaryContainer, - "warning_color": dark_theme["secondaryContainer"], - "warning_bg_color": dark_theme["inversePrimary"], - "warning_fg_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "warning_color": dark_theme.secondaryContainer, + "warning_bg_color": dark_theme.inversePrimary, + "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": dark_theme["error"], - "error_bg_color": dark_theme["errorContainer"], - "error_fg_color": dark_theme["onError"], + "error_color": dark_theme.error, + "error_bg_color": dark_theme.errorContainer, + "error_fg_color": dark_theme.onError, - "window_bg_color": dark_theme["surface"], - "window_fg_color": dark_theme["onSurface"], + "window_bg_color": dark_theme.surface, + "window_fg_color": dark_theme.onSurface, - "view_bg_color": dark_theme["surface"], - "view_fg_color": dark_theme["onSurface"], + "view_bg_color": dark_theme.surface, + "view_fg_color": dark_theme.onSurface, - "headerbar_bg_color": dark_theme["surface"], - "headerbar_fg_color": dark_theme["onSurface"], - "headerbar_border_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "headerbar_bg_color": dark_theme.surface, + "headerbar_fg_color": dark_theme.onSurface, + "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": dark_theme["shadow"], + "headerbar_shade_color": dark_theme.shadow, - "card_bg_color": self.rgba_from_argb(dark_theme["primary"], "0.05"), - "card_fg_color": dark_theme["surfaceVariant"], - "card_shade_color": dark_theme["shadow"], + "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), + "card_fg_color": dark_theme.surfaceVariant, + "card_shade_color": dark_theme.shadow, - "dialog_bg_color": dark_theme["secondaryContainer"], - "dialog_fg_color": dark_theme["onSecondaryContainer"], + "dialog_bg_color": dark_theme.secondaryContainer, + "dialog_fg_color": dark_theme.onSecondaryContainer, - "popover_bg_color": dark_theme["secondaryContainer"], - "popover_fg_color": dark_theme["onSecondaryContainer"], + "popover_bg_color": dark_theme.secondaryContainer, + "popover_fg_color": dark_theme.onSecondaryContainer, - "shade_color": dark_theme["shadow"], - "scrollbar_outline_color": dark_theme["outline"] + "shade_color": dark_theme.shadow, + "scrollbar_outline_color": dark_theme.outline } else: # light - light_theme = theme["schemes"]["light"].toJSON() + light_theme = theme["schemes"]["light"] variable = { "accent_color": light_theme["primary"], "accent_bg_color": light_theme["primaryContainer"], From 2382062177dc2b6be2ec8508a9adac34753d51c0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:06:55 +0200 Subject: [PATCH 109/149] convert to rgba --- src/main.py | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/main.py b/src/main.py index 143e5d934..c7231e161 100644 --- a/src/main.py +++ b/src/main.py @@ -240,50 +240,50 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"] variable = { - "accent_color": dark_theme.primary, - "accent_bg_color": dark_theme.primaryContainer, - "accent_fg_color": dark_theme.onPrimaryContainer, + "accent_color": self.rgba_from_argb(dark_theme.primary), + "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), + "accent_fg_color": self.rgba_from_argb(dark_theme.onPrimaryContainer), - "destructive_color": dark_theme.error, - "destructive_bg_color": dark_theme.errorContainer, - "destructive_fg_color": dark_theme.onError, + "destructive_color": self.rgba_from_argb(dark_theme.error), + "destructive_bg_color": self.rgba_from_argb(dark_theme.errorContainer), + "destructive_fg_color": self.rgba_from_argb(dark_theme.onError), - "success_color": dark_theme.tertiary, - "success_bg_color": dark_theme.onTertiary, - "success_fg_color": dark_theme.tertiaryContainer, + "success_color": self.rgba_from_argb(dark_theme.tertiary), + "success_bg_color": self.rgba_from_argb(dark_theme.onTertiary), + "success_fg_color": self.rgba_from_argb(dark_theme.tertiaryContainer), - "warning_color": dark_theme.secondaryContainer, - "warning_bg_color": dark_theme.inversePrimary, + "warning_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "warning_bg_color": self.rgba_from_argb(dark_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": dark_theme.error, - "error_bg_color": dark_theme.errorContainer, - "error_fg_color": dark_theme.onError, + "error_color": self.rgba_from_argb(dark_theme.error), + "error_bg_color": self.rgba_from_argb(dark_theme.errorContainer), + "error_fg_color": self.rgba_from_argb(dark_theme.onError), - "window_bg_color": dark_theme.surface, - "window_fg_color": dark_theme.onSurface, + "window_bg_color": self.rgba_from_argb(dark_theme.surface), + "window_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "view_bg_color": dark_theme.surface, - "view_fg_color": dark_theme.onSurface, + "view_bg_color": self.rgba_from_argb(dark_theme.surface), + "view_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_bg_color": dark_theme.surface, - "headerbar_fg_color": dark_theme.onSurface, + "headerbar_bg_color": self.rgba_from_argb(dark_theme.surface), + "headerbar_fg_color": self.rgba_from_argb(dark_theme.onSurface), "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": dark_theme.shadow, + "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), - "card_fg_color": dark_theme.surfaceVariant, - "card_shade_color": dark_theme.shadow, + "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), + "card_shade_color": self.rgba_from_argb(dark_theme.shadow), - "dialog_bg_color": dark_theme.secondaryContainer, - "dialog_fg_color": dark_theme.onSecondaryContainer, + "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "popover_bg_color": dark_theme.secondaryContainer, - "popover_fg_color": dark_theme.onSecondaryContainer, + "popover_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "popover_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "shade_color": dark_theme.shadow, - "scrollbar_outline_color": dark_theme.outline + "shade_color": self.rgba_from_argb(dark_theme.shadow), + "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) } else: # light light_theme = theme["schemes"]["light"] From 1b12e486244c38b0a0d14f59cd01be66825e4cd0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:17:35 +0200 Subject: [PATCH 110/149] update tones --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 205942adc..e5f413426 100644 --- a/src/window.py +++ b/src/window.py @@ -101,7 +101,7 @@ def setup_monet_page(self): self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) self.monet_pref_group.set_description( - _("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + _("Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -133,7 +133,7 @@ def setup_monet_page(self): store = Gtk.StringList() store_values = [] - for i in range(5, 100, 5): + for i in range(20, 80, 5): store_values.append(str(i)) for v in store_values: store.append(v) From 0324b9575947bacabbf1099c2107cd3e5491dc08 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:22:34 +0200 Subject: [PATCH 111/149] add automatic preset load --- src/main.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index c7231e161..92fa90dd4 100644 --- a/src/main.py +++ b/src/main.py @@ -96,9 +96,17 @@ def do_activate(self): self.create_action("about", self.show_about_window) self.reload_user_defined_presets() - self.load_preset_from_resource( - "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita.json" - ) + + self.style_manager = Adw.StyleManager.get_default() + + if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: + self.load_preset_from_resource( + "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" + ) + else: + self.load_preset_from_resource( + "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita.json" + ) self.win.present() From f996aeeaccec757a7cca2cadf3826a373f770b92 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:23:08 +0200 Subject: [PATCH 112/149] add debug --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index 92fa90dd4..3a430c01d 100644 --- a/src/main.py +++ b/src/main.py @@ -99,6 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() + print(self.style_manager.get_color_scheme()) if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From 7bf5edf685f16b39bc8870924be508fca5278e34 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:24:40 +0200 Subject: [PATCH 113/149] add more debug --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 3a430c01d..661823e7f 100644 --- a/src/main.py +++ b/src/main.py @@ -98,8 +98,9 @@ def do_activate(self): self.reload_user_defined_presets() self.style_manager = Adw.StyleManager.get_default() - + print(dir(self.style_manager)) print(self.style_manager.get_color_scheme()) + print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From e939dcdd1722e8790964544e8665721ec61e793d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:25:41 +0200 Subject: [PATCH 114/149] fix bug --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 661823e7f..8a2c5bc14 100644 --- a/src/main.py +++ b/src/main.py @@ -99,9 +99,10 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) + print(self.style_manager.get_default()) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) - if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: + if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" ) From 004bf83923814f8d75d30179de80a9f2b12d76b5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:26:48 +0200 Subject: [PATCH 115/149] add debug --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 8a2c5bc14..e7c33d578 100644 --- a/src/main.py +++ b/src/main.py @@ -99,7 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) - print(self.style_manager.get_default()) + print(dir(self.style_manager.get_default())) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: From 3339808f0a28dd33710138e43516508069c986d0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:28:27 +0200 Subject: [PATCH 116/149] add debug --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index e7c33d578..4eceea150 100644 --- a/src/main.py +++ b/src/main.py @@ -100,6 +100,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) print(dir(self.style_manager.get_default())) + print(self.style_manager.get_default().get_color_scheme()) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: From aff7cf44f647e3d2fd89dfeabaf543c03f5f4198 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:33:27 +0200 Subject: [PATCH 117/149] fix style manager --- src/main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 4eceea150..e19935439 100644 --- a/src/main.py +++ b/src/main.py @@ -99,10 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) - print(dir(self.style_manager.get_default())) - print(self.style_manager.get_default().get_color_scheme()) - print(self.style_manager.get_color_scheme()) - print(dir(self.style_manager.get_color_scheme())) + print(self.style_manager.get_dark()) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From 8f2b40d01fe75f1ef4b3c412829d396d1f4e7568 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:34:28 +0200 Subject: [PATCH 118/149] add automatic preset choice if dark or ligjt --- src/main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index e19935439..a6578d3e4 100644 --- a/src/main.py +++ b/src/main.py @@ -98,9 +98,7 @@ def do_activate(self): self.reload_user_defined_presets() self.style_manager = Adw.StyleManager.get_default() - print(dir(self.style_manager)) - print(self.style_manager.get_dark()) - if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: + if self.style_manager.get_dark(): self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" ) From 9f222bd06e2a5db7cec0593cf79bef2e4957d300 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:37:03 +0200 Subject: [PATCH 119/149] add automatic color choice for monet --- src/main.py | 7 ++++++- src/window.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a6578d3e4..4868c1575 100644 --- a/src/main.py +++ b/src/main.py @@ -243,7 +243,12 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(monet_theme) print(theme) - + if monet_theme == "automatic": + if self.style_manager.get_dark(): + monet_theme = "dark" + else: + monet_theme = "light" + if monet_theme == "dark": dark_theme = theme["schemes"]["dark"] variable = { diff --git a/src/window.py b/src/window.py index e5f413426..1f10d3f0a 100644 --- a/src/window.py +++ b/src/window.py @@ -144,6 +144,7 @@ def setup_monet_page(self): self.monet_theme_row.set_title(_("Theme")) store = Gtk.StringList() + store.append("Automatic") store.append("Dark") store.append("Light") self.monet_theme_row.set_model(store) From 28e6218038ed4f67c50b67d3bc350d704a748c76 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:39:34 +0200 Subject: [PATCH 120/149] update light theme scheme --- src/main.py | 64 ++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/main.py b/src/main.py index 4868c1575..6aa3b4843 100644 --- a/src/main.py +++ b/src/main.py @@ -300,50 +300,50 @@ def update_theme_from_monet(self, theme, tone, monet_theme): else: # light light_theme = theme["schemes"]["light"] variable = { - "accent_color": light_theme["primary"], - "accent_bg_color": light_theme["primaryContainer"], - "accent_fg_color": light_theme["onPrimaryContainer"], + "accent_color": self.rgba_from_argb(light_theme.primary), + "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), + "accent_fg_color": self.rgba_from_argb(light_theme.onPrimaryContainer), - "destructive_color": light_theme["error"], - "destructive_bg_color": light_theme["errorContainer"], - "destructive_fg_color": light_theme["onError"], + "destructive_color": self.rgba_from_argb(light_theme.error), + "destructive_bg_color": self.rgba_from_argb(light_theme.errorContainer), + "destructive_fg_color": self.rgba_from_argb(light_theme.onError), - "success_color": light_theme["tertiary"], - "success_bg_color": light_theme["onTertiary"], - "success_fg_color": light_theme["tertiaryContainer"], + "success_color": self.rgba_from_argb(light_theme.tertiary), + "success_bg_color": self.rgba_from_argb(light_theme.onTertiary), + "success_fg_color": self.rgba_from_argb(light_theme.tertiaryContainer), - "warning_color": light_theme["secondaryContainer"], - "warning_bg_color": light_theme["inversePrimary"], - "warning_fg_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "warning_color": self.rgba_from_argb(light_theme.secondaryContainer), + "warning_bg_color": self.rgba_from_argb(light_theme.inversePrimary), + "warning_fg_color": self.rgba_from_argb(light_theme.primary, "0.8"), - "error_color": light_theme["error"], - "error_bg_color": light_theme["errorContainer"], - "error_fg_color": light_theme["onError"], + "error_color": self.rgba_from_argb(light_theme.error), + "error_bg_color": self.rgba_from_argb(light_theme.errorContainer), + "error_fg_color": self.rgba_from_argb(light_theme.onError), - "window_bg_color": light_theme["surface"], - "window_fg_color": light_theme["onSurface"], + "window_bg_color": self.rgba_from_argb(light_theme.surface), + "window_fg_color": self.rgba_from_argb(light_theme.onSurface), - "view_bg_color": light_theme["surface"], - "view_fg_color": light_theme["onSurface"], + "view_bg_color": self.rgba_from_argb(light_theme.surface), + "view_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_bg_color": light_theme["surface"], - "headerbar_fg_color": light_theme["onSurface"], - "headerbar_border_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "headerbar_bg_color": self.rgba_from_argb(light_theme.surface), + "headerbar_fg_color": self.rgba_from_argb(light_theme.onSurface), + "headerbar_border_color": self.rgba_from_argb(light_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": light_theme["shadow"], + "headerbar_shade_color": self.rgba_from_argb(light_theme.shadow), - "card_bg_color": self.rgba_from_argb(light_theme["primary"], "0.05"), - "card_fg_color": light_theme["surfaceVariant"], - "card_shade_color": light_theme["shadow"], + "card_bg_color": self.rgba_from_argb(light_theme.primary, "0.05"), + "card_fg_color": self.rgba_from_argb(light_theme.surfaceVariant), + "card_shade_color": self.rgba_from_argb(light_theme.shadow), - "dialog_bg_color": light_theme["secondaryContainer"], - "dialog_fg_color": light_theme["onSecondaryContainer"], + "dialog_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), + "dialog_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - "popover_bg_color": light_theme["secondaryContainer"], - "popover_fg_color": light_theme["onSecondaryContainer"], + "popover_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), + "popover_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - "shade_color": light_theme["shadow"], - "scrollbar_outline_color": light_theme["outline"] + "shade_color": self.rgba_from_argb(light_theme.shadow), + "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline) } for key in variable.keys(): From 8e51c880acbddaf88d0f68b1940931835a57e6b2 Mon Sep 17 00:00:00 2001 From: David Lapshin Date: Thu, 11 Aug 2022 17:48:22 +0300 Subject: [PATCH 121/149] Fix missing settings-symbolic & open-menu-symbolic --- src/adwcustomizer.gresource.xml | 8 ++++++-- ...thub.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg | 2 -- ...AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg | 8 ++++++++ ....AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg | 2 ++ src/ui/window.blp | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) delete mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg diff --git a/src/adwcustomizer.gresource.xml b/src/adwcustomizer.gresource.xml index dc6a30581..fa71a5932 100644 --- a/src/adwcustomizer.gresource.xml +++ b/src/adwcustomizer.gresource.xml @@ -42,11 +42,15 @@ >icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg + alias="open-menu-symbolic.svg" + >icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-fill-symbolic.svg + icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg deleted file mode 100644 index 50b8a3c4d..000000000 --- a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg new file mode 100644 index 000000000..7f4474335 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg new file mode 100644 index 000000000..408d7e5d4 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/src/ui/window.blp b/src/ui/window.blp index e9e6deb74..3b3abc816 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -47,7 +47,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { [end] Gtk.MenuButton { - icon-name: "menu-symbolic"; + icon-name: "open-menu-symbolic"; menu-model: main-menu; } From 84dda5f78d499801a49c20ed7163bfec4854f006 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:53:41 +0200 Subject: [PATCH 122/149] add switch to select dark or light apply --- src/main.py | 72 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/src/main.py b/src/main.py index 6aa3b4843..819f4dd10 100644 --- a/src/main.py +++ b/src/main.py @@ -443,7 +443,13 @@ def show_apply_color_scheme_dialog(self, *_args): Adw.ResponseAppearance.SUGGESTED, transient_for=self.props.active_window, ) - dialog.connect("response", self.apply_color_scheme) + + switch = Gtk.Switch() + print(dir(switch)) + + dialog.set_extra_child(switch) + + dialog.connect("response", self.apply_color_scheme, switch) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -534,28 +540,50 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response): + def apply_color_scheme(self, widget, response, switch): if response == "apply": - if widget.get_app_types()["gtk4"]: - gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") - if not os.path.exists(gtk4_dir): - os.makedirs(gtk4_dir) - gtk4_css = self.generate_gtk_css("gtk4") - with open( - os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8" - ) as file: - file.write(gtk4_css) - if widget.get_app_types()["gtk3"]: - gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") - if not os.path.exists(gtk3_dir): - os.makedirs(gtk3_dir) - gtk3_css = self.generate_gtk_css("gtk3") - with open( - os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" - ) as file: - file.write(gtk3_css) + if switch.get_active(): + if widget.get_app_types()["gtk4"]: + gtk4_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + if not os.path.exists(gtk4_dir): + os.makedirs(gtk4_dir) + gtk4_css = self.generate_gtk_css("gtk4") + with open( + os.path.join(gtk4_dir, "gtk-dark.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk4_css) + if widget.get_app_types()["gtk3"]: + gtk3_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + if not os.path.exists(gtk3_dir): + os.makedirs(gtk3_dir) + gtk3_css = self.generate_gtk_css("gtk3") + with open( + os.path.join(gtk3_dir, "gtk-dark.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk3_css) + else: + if widget.get_app_types()["gtk4"]: + gtk4_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + if not os.path.exists(gtk4_dir): + os.makedirs(gtk4_dir) + gtk4_css = self.generate_gtk_css("gtk4") + with open( + os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk4_css) + if widget.get_app_types()["gtk3"]: + gtk3_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + if not os.path.exists(gtk3_dir): + os.makedirs(gtk3_dir) + gtk3_css = self.generate_gtk_css("gtk3") + with open( + os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk3_css) self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): From 5e96066b9c4b1578a159c564f9931efeacbd0c19 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 17:57:02 +0200 Subject: [PATCH 123/149] change license Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 819f4dd10..a8e7e471a 100644 --- a/src/main.py +++ b/src/main.py @@ -641,7 +641,7 @@ def show_about_window(self, *_args): Juanjo Cillero https://www.transifex.com/user/profile/renux918/ Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", - license_type=Gtk.License.MIT_X11, + license_type=Gtk.License.GPL_3_0, ) about.present() From f054988887d13b1517b79cba8f9a69957d671ad4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:21:13 +0200 Subject: [PATCH 124/149] rework apply --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a8e7e471a..fc68884de 100644 --- a/src/main.py +++ b/src/main.py @@ -444,7 +444,7 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - switch = Gtk.Switch() + switch = Adw.ActionRow() print(dir(switch)) dialog.set_extra_child(switch) From 7639f5313c1e8a1d031adcbb3bed350edb153cf9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:24:37 +0200 Subject: [PATCH 125/149] update comborow --- src/main.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index fc68884de..04ac224e6 100644 --- a/src/main.py +++ b/src/main.py @@ -444,12 +444,18 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - switch = Adw.ActionRow() - print(dir(switch)) + comborow = Adw.ComboRow() + comborow.set_title(_("Apply as dark theme")) - dialog.set_extra_child(switch) + store = Gtk.StringList() + store.append("Dark") + store.append("Light") + comborow.set_model(store) + print(dir(comborow)) - dialog.connect("response", self.apply_color_scheme, switch) + dialog.set_extra_child(comborow) + + dialog.connect("response", self.apply_color_scheme, comborow) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -540,9 +546,9 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response, switch): + def apply_color_scheme(self, widget, response, comborow): if response == "apply": - if switch.get_active(): + if comborow.get_string().lower() == "dark": if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") From ac53e2e876add0dad2e4871bd7b3a66ea0ab0df7 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:31:44 +0200 Subject: [PATCH 126/149] use switch instead --- src/main.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main.py b/src/main.py index 04ac224e6..f76002025 100644 --- a/src/main.py +++ b/src/main.py @@ -444,18 +444,18 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - comborow = Adw.ComboRow() - comborow.set_title(_("Apply as dark theme")) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - store = Gtk.StringList() - store.append("Dark") - store.append("Light") - comborow.set_model(store) - print(dir(comborow)) + label = Gtk.Label(text="Export as Dark theme") + switch = Gtk.Switch() - dialog.set_extra_child(comborow) + box.append(label) + box.append(switch) + print(dir(switch)) - dialog.connect("response", self.apply_color_scheme, comborow) + dialog.set_extra_child(box) + + dialog.connect("response", self.apply_color_scheme, switch) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -546,9 +546,9 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response, comborow): + def apply_color_scheme(self, widget, response, switch): if response == "apply": - if comborow.get_string().lower() == "dark": + if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") From 4278e213228f94e38423a59aa46942ed2b00b4db Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:32:46 +0200 Subject: [PATCH 127/149] fix bug --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index f76002025..b681a0398 100644 --- a/src/main.py +++ b/src/main.py @@ -446,7 +446,7 @@ def show_apply_color_scheme_dialog(self, *_args): box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - label = Gtk.Label(text="Export as Dark theme") + label = Gtk.Label(label="Export as Dark theme") switch = Gtk.Switch() box.append(label) From 18bb8725ee3e5420d4b5d249e344699b7c1ea30a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:35:23 +0200 Subject: [PATCH 128/149] increase spacing --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index b681a0398..959b83397 100644 --- a/src/main.py +++ b/src/main.py @@ -444,7 +444,7 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=30) label = Gtk.Label(label="Export as Dark theme") switch = Gtk.Switch() From b6105f6302a28c6ad4f2f6b9b033b6e2e8ca59cf Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:38:00 +0200 Subject: [PATCH 129/149] update label --- src/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 959b83397..8595303d5 100644 --- a/src/main.py +++ b/src/main.py @@ -444,9 +444,9 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=30) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - label = Gtk.Label(label="Export as Dark theme") + label = Gtk.Label(label="Apply as Dark theme") switch = Gtk.Switch() box.append(label) From b7c6be25e731b205bf7a8c7ecb45bee60a10b014 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:39:24 +0200 Subject: [PATCH 130/149] format --- src/main.py | 72 +++++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/main.py b/src/main.py index 8595303d5..4d4d6f45a 100644 --- a/src/main.py +++ b/src/main.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -36,6 +36,7 @@ from .custom_css_group import AdwcustomizerCustomCSSGroup from .plugins_list import AdwcustomizerPluginsList + def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -114,7 +115,7 @@ def reload_user_defined_presets(self): self.props.active_window.presets_menu.remove(1) preset_directory = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets") if not os.path.exists(preset_directory): os.makedirs(preset_directory) @@ -141,7 +142,8 @@ def reload_user_defined_presets(self): "line": traceback.format_exc().strip(), } ) - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Failed to load preset"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Failed to load preset"))) self.props.active_window.update_errors(self.global_errors) @@ -174,7 +176,8 @@ def open_dir_callback(_, result): self.portal.open_uri( parent, - "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets"), + "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets"), Xdp.OpenUriFlags.NONE, None, open_dir_callback, @@ -214,8 +217,7 @@ def load_preset_variables(self, preset): self.reload_variables() - - def rgba_from_argb(self, argb, alpha = None) -> str: + def rgba_from_argb(self, argb, alpha=None) -> str: base = "rgba({}, {}, {}, {})" red = redFromArgb(argb) @@ -229,28 +231,22 @@ def rgba_from_argb(self, argb, alpha = None) -> str: def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] - monet_theme = monet_theme.get_string().lower() # dark / light + monet_theme = monet_theme.get_string().lower() # dark / light palette = {} i = 0 for color in palettes.values(): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) - - print(palette) - self.pref_palette_shades["monet"].update_shades(palette) - - print(monet_theme) - print(theme) if monet_theme == "automatic": if self.style_manager.get_dark(): monet_theme = "dark" else: monet_theme = "light" - + if monet_theme == "dark": - dark_theme = theme["schemes"]["dark"] + dark_theme = theme["schemes"]["dark"] variable = { "accent_color": self.rgba_from_argb(dark_theme.primary), "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), @@ -297,8 +293,8 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "shade_color": self.rgba_from_argb(dark_theme.shadow), "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) } - else: # light - light_theme = theme["schemes"]["light"] + else: # light + light_theme = theme["schemes"]["light"] variable = { "accent_color": self.rgba_from_argb(light_theme.primary), "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), @@ -349,7 +345,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): for key in variable.keys(): if key in self.pref_variables: self.pref_variables[key].update_value(variable[key]) - + self.reload_variables() def generate_gtk_css(self, app_type): @@ -419,7 +415,8 @@ def load_preset_action(self, _unused, *args): if args[0].get_string().startswith("custom-"): self.load_preset_from_file( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", args[0].get_string().replace("custom-", "", 1) + ".json", ) @@ -451,7 +448,6 @@ def show_apply_color_scheme_dialog(self, *_args): box.append(label) box.append(switch) - print(dir(switch)) dialog.set_extra_child(box) @@ -478,7 +474,8 @@ def show_save_preset_dialog(self, *_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(self.preset_name) + ".json", ) @@ -501,7 +498,7 @@ def on_preset_entry_change(*_args): dialog.set_body( _( "Saving preset to {0}. If that preset already exists, it will be overwritten!" - ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets")) + ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets")) ) dialog.set_response_enabled("save", False) else: @@ -510,7 +507,8 @@ def on_preset_entry_change(*_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(preset_entry.get_text()) + ".json", ) @@ -529,7 +527,8 @@ def save_preset(self, _unused, response, entry): if response == "save": with open( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(entry.get_text()) + ".json", ), @@ -544,14 +543,15 @@ def save_preset(self, _unused, response, entry): } file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Scheme successfully saved!"))) def apply_color_scheme(self, widget, response, switch): if response == "apply": if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -561,7 +561,7 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -572,7 +572,7 @@ def apply_color_scheme(self, widget, response, switch): else: if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -582,7 +582,7 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -590,30 +590,32 @@ def apply_color_scheme(self, widget, response, switch): os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" ) as file: file.write(gtk3_css) - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): if response == "reset": if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0/gtk.css") ) try: file.delete() except Exception: pass - + if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0/gtk.css") ) try: file.delete() except Exception: pass - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( From 1ee3b7c0bf0d349004c57742ef8498cb4b501df5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:39:52 +0200 Subject: [PATCH 131/149] format --- src/app_type_dialog.py | 23 +++- src/custom_css_group.py | 24 ++-- src/error.py | 9 +- src/main.py | 157 +++++++++++++------------ src/option.py | 27 +++-- src/palette_shades.py | 25 ++-- src/plugin.py | 11 +- src/plugins/__init__.py | 6 +- src/plugins/gtk4.py | 7 +- src/plugins_list.py | 21 ++-- src/setting.py | 7 +- src/settings_schema.py | 251 ++++++++++++++++++++-------------------- src/window.py | 70 ++++++----- 13 files changed, 355 insertions(+), 283 deletions(-) diff --git a/src/app_type_dialog.py b/src/app_type_dialog.py index be2707fe2..f7f88133d 100644 --- a/src/app_type_dialog.py +++ b/src/app_type_dialog.py @@ -7,25 +7,36 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/app_type_dialog.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/app_type_dialog.ui" +) class AdwcustomizerAppTypeDialog(Adw.MessageDialog): - __gtype_name__ = 'AdwcustomizerAppTypeDialog' + __gtype_name__ = "AdwcustomizerAppTypeDialog" gtk4_app_type = Gtk.Template.Child("gtk4-app-type") gtk3_app_type = Gtk.Template.Child("gtk3-app-type") - def __init__(self, heading, body, ok_response_name, ok_response_label, ok_response_appearance, **kwargs): + def __init__( + self, + heading, + body, + ok_response_name, + ok_response_label, + ok_response_appearance, + **kwargs + ): super().__init__(**kwargs) self.set_heading(heading) self.set_body(body) @@ -39,5 +50,5 @@ def __init__(self, heading, body, ok_response_name, ok_response_label, ok_respon def get_app_types(self): return { "gtk4": self.gtk4_app_type.get_active(), - "gtk3": self.gtk3_app_type.get_active() + "gtk3": self.gtk3_app_type.get_active(), } diff --git a/src/custom_css_group.py b/src/custom_css_group.py index 2e2d453bd..1f98ab800 100644 --- a/src/custom_css_group.py +++ b/src/custom_css_group.py @@ -7,20 +7,23 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/custom_css_group.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/custom_css_group.ui" +) class AdwcustomizerCustomCSSGroup(Adw.PreferencesGroup): - __gtype_name__ = 'AdwcustomizerCustomCSSGroup' + __gtype_name__ = "AdwcustomizerCustomCSSGroup" app_type_dropdown = Gtk.Template.Child("app-type-dropdown") custom_css_text_view = Gtk.Template.Child("custom-css-text-view") @@ -31,14 +34,21 @@ def __init__(self, **kwargs): def load_custom_css(self, custom_css): self.custom_css = custom_css - self.custom_css_text_view.get_buffer().set_text(list(self.custom_css.values())[self.app_type_dropdown.get_selected()]) + self.custom_css_text_view.get_buffer().set_text( + list(self.custom_css.values())[self.app_type_dropdown.get_selected()] + ) @Gtk.Template.Callback() def on_custom_css_changed(self, buffer): Gtk.Application.get_default().mark_as_dirty() - Gtk.Application.get_default().update_custom_css_text(list(self.custom_css.keys())[self.app_type_dropdown.get_selected()], buffer.props.text) + Gtk.Application.get_default().update_custom_css_text( + list(self.custom_css.keys())[self.app_type_dropdown.get_selected()], + buffer.props.text, + ) @Gtk.Template.Callback() def on_dropdown_notify(self, _unused, pspec): if pspec.name == "selected": - self.custom_css_text_view.get_buffer().set_text(list(self.custom_css.values())[self.app_type_dropdown.get_selected()]) + self.custom_css_text_view.get_buffer().set_text( + list(self.custom_css.values())[self.app_type_dropdown.get_selected()] + ) diff --git a/src/error.py b/src/error.py index 98fd3fdf1..2760bd544 100644 --- a/src/error.py +++ b/src/error.py @@ -7,20 +7,21 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/error.ui') + +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/error.ui") class AdwcustomizerError(Gtk.ListBoxRow): - __gtype_name__ = 'AdwcustomizerError' + __gtype_name__ = "AdwcustomizerError" error_label = Gtk.Template.Child("error-label") element_label = Gtk.Template.Child("element-label") diff --git a/src/main.py b/src/main.py index 4d4d6f45a..042eaf87b 100644 --- a/src/main.py +++ b/src/main.py @@ -89,10 +89,8 @@ def do_activate(self): GLib.Variant("s", "adwaita"), self.load_preset_action, ) - self.create_action("apply_color_scheme", - self.show_apply_color_scheme_dialog) - self.create_action("reset_color_scheme", - self.show_reset_color_scheme_dialog) + self.create_action("apply_color_scheme", self.show_apply_color_scheme_dialog) + self.create_action("reset_color_scheme", self.show_reset_color_scheme_dialog) self.create_action("save_preset", self.show_save_preset_dialog) self.create_action("about", self.show_about_window) @@ -115,7 +113,9 @@ def reload_user_defined_presets(self): self.props.active_window.presets_menu.remove(1) preset_directory = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), + "presets", + ) if not os.path.exists(preset_directory): os.makedirs(preset_directory) @@ -132,8 +132,7 @@ def reload_user_defined_presets(self): raise KeyError("variables") if preset.get("palette") is None: raise KeyError("palette") - self.custom_presets[file_name.replace( - ".json", "")] = preset["name"] + self.custom_presets[file_name.replace(".json", "")] = preset["name"] except Exception: self.global_errors.append( { @@ -143,7 +142,8 @@ def reload_user_defined_presets(self): } ) self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Failed to load preset"))) + Adw.Toast(title=_("Failed to load preset")) + ) self.props.active_window.update_errors(self.global_errors) @@ -176,8 +176,11 @@ def open_dir_callback(_, result): self.portal.open_uri( parent, - "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), "presets"), + "file://" + + os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), + "presets", + ), Xdp.OpenUriFlags.NONE, None, open_dir_callback, @@ -190,8 +193,7 @@ def load_preset_from_file(self, preset_path): self.load_preset_variables(json.loads(preset_text)) def load_preset_from_resource(self, preset_path): - preset_text = Gio.resources_lookup_data( - preset_path, 0).get_data().decode() + preset_text = Gio.resources_lookup_data(preset_path, 0).get_data().decode() self.load_preset_variables(json.loads(preset_text)) def load_preset_variables(self, preset): @@ -251,47 +253,40 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_color": self.rgba_from_argb(dark_theme.primary), "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), "accent_fg_color": self.rgba_from_argb(dark_theme.onPrimaryContainer), - "destructive_color": self.rgba_from_argb(dark_theme.error), "destructive_bg_color": self.rgba_from_argb(dark_theme.errorContainer), "destructive_fg_color": self.rgba_from_argb(dark_theme.onError), - "success_color": self.rgba_from_argb(dark_theme.tertiary), "success_bg_color": self.rgba_from_argb(dark_theme.onTertiary), "success_fg_color": self.rgba_from_argb(dark_theme.tertiaryContainer), - "warning_color": self.rgba_from_argb(dark_theme.secondaryContainer), "warning_bg_color": self.rgba_from_argb(dark_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": self.rgba_from_argb(dark_theme.error), "error_bg_color": self.rgba_from_argb(dark_theme.errorContainer), "error_fg_color": self.rgba_from_argb(dark_theme.onError), - "window_bg_color": self.rgba_from_argb(dark_theme.surface), "window_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "view_bg_color": self.rgba_from_argb(dark_theme.surface), "view_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_bg_color": self.rgba_from_argb(dark_theme.surface), "headerbar_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), + "headerbar_border_color": self.rgba_from_argb( + dark_theme.primary, "0.8" + ), "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), - "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), "card_shade_color": self.rgba_from_argb(dark_theme.shadow), - "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "popover_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), - "popover_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - + "popover_fg_color": self.rgba_from_argb( + dark_theme.onSecondaryContainer + ), "shade_color": self.rgba_from_argb(dark_theme.shadow), - "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) + "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline), } else: # light light_theme = theme["schemes"]["light"] @@ -299,47 +294,42 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_color": self.rgba_from_argb(light_theme.primary), "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), "accent_fg_color": self.rgba_from_argb(light_theme.onPrimaryContainer), - "destructive_color": self.rgba_from_argb(light_theme.error), "destructive_bg_color": self.rgba_from_argb(light_theme.errorContainer), "destructive_fg_color": self.rgba_from_argb(light_theme.onError), - "success_color": self.rgba_from_argb(light_theme.tertiary), "success_bg_color": self.rgba_from_argb(light_theme.onTertiary), "success_fg_color": self.rgba_from_argb(light_theme.tertiaryContainer), - "warning_color": self.rgba_from_argb(light_theme.secondaryContainer), "warning_bg_color": self.rgba_from_argb(light_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(light_theme.primary, "0.8"), - "error_color": self.rgba_from_argb(light_theme.error), "error_bg_color": self.rgba_from_argb(light_theme.errorContainer), "error_fg_color": self.rgba_from_argb(light_theme.onError), - "window_bg_color": self.rgba_from_argb(light_theme.surface), "window_fg_color": self.rgba_from_argb(light_theme.onSurface), - "view_bg_color": self.rgba_from_argb(light_theme.surface), "view_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_bg_color": self.rgba_from_argb(light_theme.surface), "headerbar_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_border_color": self.rgba_from_argb(light_theme.primary, "0.8"), + "headerbar_border_color": self.rgba_from_argb( + light_theme.primary, "0.8" + ), "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(light_theme.shadow), - "card_bg_color": self.rgba_from_argb(light_theme.primary, "0.05"), "card_fg_color": self.rgba_from_argb(light_theme.surfaceVariant), "card_shade_color": self.rgba_from_argb(light_theme.shadow), - "dialog_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), - "dialog_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - + "dialog_fg_color": self.rgba_from_argb( + light_theme.onSecondaryContainer + ), "popover_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), - "popover_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - + "popover_fg_color": self.rgba_from_argb( + light_theme.onSecondaryContainer + ), "shade_color": self.rgba_from_argb(light_theme.shadow), - "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline) + "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline), } for key in variable.keys(): @@ -395,8 +385,7 @@ def on_error(_, section, error): css_provider.connect("parsing-error", on_error) css_provider.load_from_data(gtk_css.encode()) - self.props.active_window.update_errors( - self.global_errors + parsing_errors) + self.props.active_window.update_errors(self.global_errors + parsing_errors) # loading with the priority above user to override the applied config if self.current_css_provider is not None: Gtk.StyleContext.remove_provider_for_display( @@ -415,8 +404,7 @@ def load_preset_action(self, _unused, *args): if args[0].get_string().startswith("custom-"): self.load_preset_from_file( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", args[0].get_string().replace("custom-", "", 1) + ".json", ) @@ -474,8 +462,7 @@ def show_save_preset_dialog(self, *_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", to_slug_case(self.preset_name) + ".json", ) @@ -485,8 +472,7 @@ def show_save_preset_dialog(self, *_args): dialog.add_response("cancel", _("Cancel")) dialog.add_response("save", _("Save")) - dialog.set_response_appearance( - "save", Adw.ResponseAppearance.SUGGESTED) + dialog.set_response_appearance("save", Adw.ResponseAppearance.SUGGESTED) dialog.set_default_response("cancel") dialog.set_close_response("cancel") @@ -498,7 +484,14 @@ def on_preset_entry_change(*_args): dialog.set_body( _( "Saving preset to {0}. If that preset already exists, it will be overwritten!" - ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets")) + ).format( + os.path.join( + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "presets", + ) + ) ) dialog.set_response_enabled("save", False) else: @@ -507,8 +500,9 @@ def on_preset_entry_change(*_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), "presets", to_slug_case(preset_entry.get_text()) + ".json", ) @@ -527,8 +521,7 @@ def save_preset(self, _unused, response, entry): if response == "save": with open( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", to_slug_case(entry.get_text()) + ".json", ), @@ -544,14 +537,19 @@ def save_preset(self, _unused, response, entry): file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Scheme successfully saved!"))) + Adw.Toast(title=_("Scheme successfully saved!")) + ) def apply_color_scheme(self, widget, response, switch): if response == "apply": if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0", + ) if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -561,7 +559,11 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0", + ) if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -572,7 +574,11 @@ def apply_color_scheme(self, widget, response, switch): else: if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0", + ) if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -582,7 +588,11 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0", + ) if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -591,14 +601,19 @@ def apply_color_scheme(self, widget, response, switch): ) as file: file.write(gtk3_css) self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Scheme set successfully!"))) + Adw.Toast(title=_("Scheme set successfully!")) + ) def reset_color_scheme(self, widget, response): if response == "reset": if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0/gtk.css") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0/gtk.css", + ) ) try: file.delete() @@ -608,14 +623,17 @@ def reset_color_scheme(self, widget, response): if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0/gtk.css") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0/gtk.css", + ) ) try: file.delete() except Exception: pass - self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Reset successfully!"))) + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( @@ -631,12 +649,8 @@ def show_about_window(self, *_args): "0xMRTT https://github.com/0xMRTT", "Verantor https://github.com/Verantor", ], - artists=[ - 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' - ], - designers=[ - 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' - ], + artists=['David "Daudix UFO" Lapshin https://github.com/daudix-UFO'], + designers=['David "Daudix UFO" Lapshin https://github.com/daudix-UFO'], # Translators: This is a place to put your credits (formats: "Name https://example.com" or "Name ", no quotes) and is not meant to be translated literally. translator_credits="""Maxime V https://www.transifex.com/user/profile/Adaoh/ FineFindus https://github.com/FineFindus @@ -676,8 +690,7 @@ def create_stateful_action( self, name, parameter_type, initial_state, callback, shortcuts=None ): """Add a stateful application action.""" - action = Gio.SimpleAction.new_stateful( - name, parameter_type, initial_state) + action = Gio.SimpleAction.new_stateful(name, parameter_type, initial_state) action.connect("activate", callback) self.add_action(action) if shortcuts: diff --git a/src/option.py b/src/option.py index ed98f2d12..885339f22 100644 --- a/src/option.py +++ b/src/option.py @@ -7,20 +7,21 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/option.ui') + +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/option.ui") class AdwcustomizerOption(Adw.ActionRow): - __gtype_name__ = 'AdwcustomizerOption' + __gtype_name__ = "AdwcustomizerOption" color_value = Gtk.Template.Child("color-value") text_value = Gtk.Template.Child("text-value") @@ -42,10 +43,14 @@ def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs): self.warning_button.set_visible(False) elif adw_gtk3_support == "partial": self.warning_button.add_css_class("warning") - self.warning_label.set_label(_("This option is only partially supported by the adw-gtk3 theme.")) + self.warning_label.set_label( + _("This option is only partially supported by the adw-gtk3 theme.") + ) elif adw_gtk3_support == "no": self.warning_button.add_css_class("error") - self.warning_label.set_label(_("This option is not supported by the adw-gtk3 theme.")) + self.warning_label.set_label( + _("This option is not supported by the adw-gtk3 theme.") + ) self.explanation_label.set_label(explanation or "") if explanation is None: @@ -53,7 +58,9 @@ def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs): @Gtk.Template.Callback() def on_color_value_changed(self, *_args): - self.update_value(self.color_value.get_rgba().to_string(), update_from="color_value") + self.update_value( + self.color_value.get_rgba().to_string(), update_from="color_value" + ) @Gtk.Template.Callback() def on_text_value_changed(self, *_args): @@ -86,7 +93,11 @@ def update_value(self, new_value, **kwargs): self.color_value.set_rgba(rgba) self.color_value.set_tooltip_text(_("Not a color, see text value")) - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "text_value" and new_value != "": + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "text_value" + and new_value != "" + ): Gtk.Application.get_default().variables[self.get_name()] = new_value Gtk.Application.get_default().mark_as_dirty() Gtk.Application.get_default().reload_variables() diff --git a/src/palette_shades.py b/src/palette_shades.py index f7eb9bf79..dcb0cc63d 100644 --- a/src/palette_shades.py +++ b/src/palette_shades.py @@ -7,20 +7,23 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/palette_shades.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/palette_shades.ui" +) class AdwcustomizerPaletteShades(Adw.ActionRow): - __gtype_name__ = 'AdwcustomizerPaletteShades' + __gtype_name__ = "AdwcustomizerPaletteShades" def __init__(self, prefix, color_title, n_shades, **kwargs): super().__init__(**kwargs) @@ -52,9 +55,17 @@ def update_shades(self, shades, **kwargs): if new_rgba.parse(shades[str(i)]): self.color_pickers[str(i)].set_rgba(new_rgba) self.color_pickers[str(i)].set_tooltip_text(shades[str(i)]) - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "color_value": - Gtk.Application.get_default().palette[self.prefix][str(i)] = shades[str(i)] + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "color_value" + ): + Gtk.Application.get_default().palette[self.prefix][str(i)] = shades[ + str(i) + ] - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "color_value": + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "color_value" + ): Gtk.Application.get_default().mark_as_dirty() Gtk.Application.get_default().reload_variables() diff --git a/src/plugin.py b/src/plugin.py index 16a234f24..cceb7e014 100644 --- a/src/plugin.py +++ b/src/plugin.py @@ -7,17 +7,18 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from .setting import AdwcustomizerSetting + class AdwcustomizerPlugin: def __init__(self): self.title = None @@ -48,7 +49,9 @@ def get_custom_settings_for_preset(self): def get_alias_values(self): alias_values = {} for key, value in self.alias_dict.items(): - alias_values[key] = self.colors.get(value, self.palette.get(value, self.custom_settings.get(value))) + alias_values[key] = self.colors.get( + value, self.palette.get(value, self.custom_settings.get(value)) + ) return alias_values def validate(self): @@ -58,4 +61,4 @@ def apply(self): raise NotImplementedError() def save(self): - pass \ No newline at end of file + pass diff --git a/src/plugins/__init__.py b/src/plugins/__init__.py index a66319289..f93ffe537 100644 --- a/src/plugins/__init__.py +++ b/src/plugins/__init__.py @@ -7,11 +7,11 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with this program. If not, see . \ No newline at end of file +# along with this program. If not, see . diff --git a/src/plugins/gtk4.py b/src/plugins/gtk4.py index b5a7d14f1..dd5fe68e9 100644 --- a/src/plugins/gtk4.py +++ b/src/plugins/gtk4.py @@ -7,16 +7,17 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from ..plugin import AdwcustomizerPlugin + class AdwcustomizerGtk4Plugin(AdwcustomizerPlugin): - pass \ No newline at end of file + pass diff --git a/src/plugins_list.py b/src/plugins_list.py index 3c7c04b35..d2c14499e 100644 --- a/src/plugins_list.py +++ b/src/plugins_list.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -20,22 +20,27 @@ import os from pathlib import Path import importlib + + class AdwcustomizerPluginsList: def __init__(self): - self.plugins = { # AdwCustomizerTeam plugins - "gtk4": AdwcustomizerGtk4Plugin() - } + self.plugins = {"gtk4": AdwcustomizerGtk4Plugin()} # AdwCustomizerTeam plugins self.add_user_plugins() def add_user_plugins(self): - self.user_plugin_dir = Path(os.environ.get("XDG_DATA_HOME", os.environ["HOME"])) / ".local" / "share" / "AdwCustomizer" / "plugins" + self.user_plugin_dir = ( + Path(os.environ.get("XDG_DATA_HOME", os.environ["HOME"])) + / ".local" + / "share" + / "AdwCustomizer" + / "plugins" + ) if self.user_plugin_dir.exists(): for path, _, name in os.walk(self.user_plugin_dir): print(name[0]) else: print("No plugins dir found") - def load_all_custom_settings(self, settings): for plugin_id, plugin in self.plugins.items(): plugin.load_custom_settings(settings[plugin_id]) @@ -43,4 +48,4 @@ def load_all_custom_settings(self, settings): def get_all_custom_settings_for_preset(self): custom_settings = {} for plugin_id, plugin in self.plugins.items(): - custom_settings[plugin_id] = plugin.get_custom_settings_for_preset() \ No newline at end of file + custom_settings[plugin_id] = plugin.get_custom_settings_for_preset() diff --git a/src/setting.py b/src/setting.py index 9a7492815..a2d3479b5 100644 --- a/src/setting.py +++ b/src/setting.py @@ -7,15 +7,16 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . + class AdwcustomizerSetting: def __init__(self, name, title, value_type, explanation=None, default_value=None): # TODO supported types: @@ -34,4 +35,4 @@ def __init__(self, name, title, value_type, explanation=None, default_value=None def set_value(self, new_value): # TODO checks - self.value = new_value \ No newline at end of file + self.value = new_value diff --git a/src/settings_schema.py b/src/settings_schema.py index ea9317441..ea22ce840 100644 --- a/src/settings_schema.py +++ b/src/settings_schema.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -21,117 +21,137 @@ { "name": "accent_colors", "title": _("Accent Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, and entries, to indicate that a widget is important, interactive, or currently active."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, and entries, to indicate that a widget is important, interactive, or currently active." + ), "variables": [ { "name": "accent_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "accent_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "accent_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "destructive_colors", "title": _("Destructive Colors"), - "description": _("These colors are used for buttons to indicate a dangerous action, such as deleting a file."), + "description": _( + "These colors are used for buttons to indicate a dangerous action, such as deleting a file." + ), "variables": [ { "name": "destructive_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "destructive_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "destructive_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "success_colors", "title": _("Success Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a success or a high level."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a success or a high level." + ), "variables": [ { "name": "success_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "success_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "success_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "warning_colors", "title": _("Warning Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a warning or a low level."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a warning or a low level." + ), "variables": [ { "name": "warning_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "warning_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "warning_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "error_colors", "title": _("Error Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, and entries, to indicate a failure."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, and entries, to indicate a failure." + ), "variables": [ { "name": "error_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "error_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "error_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "window_colors", @@ -141,66 +161,76 @@ { "name": "window_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "window_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "view_colors", "title": _("View Colors"), - "description": _("These colors are used in a variety of widgets, such as text views and entries."), + "description": _( + "These colors are used in a variety of widgets, such as text views and entries." + ), "variables": [ { "name": "view_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "view_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "headerbar_colors", "title": _("Header Bar Colors"), - "description": _("These colors are used for header bars, as well as widgets that are meant to be visually attached to it, such as search bars or tab bars."), + "description": _( + "These colors are used for header bars, as well as widgets that are meant to be visually attached to it, such as search bars or tab bars." + ), "variables": [ { "name": "headerbar_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "headerbar_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "headerbar_border_color", "title": _("Border Color"), - "explanation": _("The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout."), - "adw_gtk3_support": "no" + "explanation": _( + "The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout." + ), + "adw_gtk3_support": "no", }, { "name": "headerbar_backdrop_color", "title": _("Backdrop Color"), - "explanation": _("The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color."), - "adw_gtk3_support": "yes" + "explanation": _( + "The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color." + ), + "adw_gtk3_support": "yes", }, { "name": "headerbar_shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window."), - "adw_gtk3_support": "no" - } - ] + "explanation": _( + "The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window." + ), + "adw_gtk3_support": "no", + }, + ], }, { "name": "card_colors", @@ -210,20 +240,22 @@ { "name": "card_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "card_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "card_shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards."), - "adw_gtk3_support": "no" - } - ] + "explanation": _( + "The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards." + ), + "adw_gtk3_support": "no", + }, + ], }, { "name": "dialog_colors", @@ -233,14 +265,14 @@ { "name": "dialog_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "no" + "adw_gtk3_support": "no", }, { "name": "dialog_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "no" - } - ] + "adw_gtk3_support": "no", + }, + ], }, { "name": "popover_colors", @@ -250,14 +282,14 @@ { "name": "popover_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "popover_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "misc_colors", @@ -267,67 +299,32 @@ { "name": "shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders."), - "adw_gtk3_support": "no" + "explanation": _( + "The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders." + ), + "adw_gtk3_support": "no", }, { "name": "scrollbar_outline_color", "title": _("Scrollbar Outline Color"), - "explanation": _("The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color."), - "adw_gtk3_support": "no" - } - ] - } + "explanation": _( + "The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color." + ), + "adw_gtk3_support": "no", + }, + ], + }, ], "palette": [ - { - "prefix": "blue_", - "title": _("Blue"), - "n_shades": 5 - }, - { - "prefix": "green_", - "title": _("Green"), - "n_shades": 5 - }, - { - "prefix": "yellow_", - "title": _("Yellow"), - "n_shades": 5 - }, - { - "prefix": "orange_", - "title": _("Orange"), - "n_shades": 5 - }, - { - "prefix": "red_", - "title": _("Red"), - "n_shades": 5 - }, - { - "prefix": "purple_", - "title": _("Purple"), - "n_shades": 5 - }, - { - "prefix": "brown_", - "title": _("Brown"), - "n_shades": 5 - }, - { - "prefix": "light_", - "title": _("Light"), - "n_shades": 5 - }, - { - "prefix": "dark_", - "title": _("Dark"), - "n_shades": 5 - } + {"prefix": "blue_", "title": _("Blue"), "n_shades": 5}, + {"prefix": "green_", "title": _("Green"), "n_shades": 5}, + {"prefix": "yellow_", "title": _("Yellow"), "n_shades": 5}, + {"prefix": "orange_", "title": _("Orange"), "n_shades": 5}, + {"prefix": "red_", "title": _("Red"), "n_shades": 5}, + {"prefix": "purple_", "title": _("Purple"), "n_shades": 5}, + {"prefix": "brown_", "title": _("Brown"), "n_shades": 5}, + {"prefix": "light_", "title": _("Light"), "n_shades": 5}, + {"prefix": "dark_", "title": _("Dark"), "n_shades": 5}, ], - "custom_css_app_types": [ - "gtk4", - "gtk3" - ] + "custom_css_app_types": ["gtk4", "gtk3"], } diff --git a/src/window.py b/src/window.py index 1f10d3f0a..25d03cc83 100644 --- a/src/window.py +++ b/src/window.py @@ -36,9 +36,9 @@ from material_color_utilities_python import * -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui") class AdwcustomizerMainWindow(Adw.ApplicationWindow): - __gtype_name__ = 'AdwcustomizerMainWindow' + __gtype_name__ = "AdwcustomizerMainWindow" content = Gtk.Template.Child() toast_overlay = Gtk.Template.Child() @@ -54,14 +54,14 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) self.presets_dropdown.get_popover().connect( - "show", self.on_presets_dropdown_activate) + "show", self.on_presets_dropdown_activate + ) self.setup_monet_page() self.setup_plugins_page() self.setup_colors_page() - self.settings = Gio.Settings( - "com.github.AdwCustomizerTeam.AdwCustomizer") + self.settings = Gio.Settings("com.github.AdwCustomizerTeam.AdwCustomizer") self.settings.bind( "window-width", self, "default-width", Gio.SettingsBindFlags.DEFAULT @@ -93,7 +93,9 @@ def on_monet_file_chooser_response(self, widget, response): self.theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) + self.get_application().update_theme_from_monet( + self.theme, self.tone, self.monet_theme + ) def setup_monet_page(self): @@ -101,7 +103,10 @@ def setup_monet_page(self): self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) self.monet_pref_group.set_description( - _("Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow")) + _( + "Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow" + ) + ) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -111,21 +116,21 @@ def setup_monet_page(self): self.monet_file_chooser_button = Gtk.Button() self.monet_file_chooser_button.set_label(_("Choose a file")) - self.monet_file_chooser_button.set_icon_name( - "folder-pictures-symbolic") + self.monet_file_chooser_button.set_icon_name("folder-pictures-symbolic") self.monet_file_chooser_button.connect( - "clicked", self.on_file_picker_button_clicked) + "clicked", self.on_file_picker_button_clicked + ) self.monet_file_chooser_dialog.connect( - "response", self.on_monet_file_chooser_response) + "response", self.on_monet_file_chooser_response + ) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) self.monet_pref_group.add(self.monet_file_chooser_row) - self.monet_palette_shades = AdwcustomizerPaletteShades("monet", - "Monet Palette", - 6) - self.get_application( - ).pref_palette_shades["monet"] = self.monet_palette_shades + self.monet_palette_shades = AdwcustomizerPaletteShades( + "monet", "Monet Palette", 6 + ) + self.get_application().pref_palette_shades["monet"] = self.monet_palette_shades self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() @@ -168,14 +173,14 @@ def setup_colors_page(self): pref_group.set_description(group["description"]) for variable in group["variables"]: - pref_variable = AdwcustomizerOption(variable["name"], - variable["title"], - variable.get( - "explanation"), - variable["adw_gtk3_support"]) + pref_variable = AdwcustomizerOption( + variable["name"], + variable["title"], + variable.get("explanation"), + variable["adw_gtk3_support"], + ) pref_group.add(pref_variable) - self.get_application( - ).pref_variables[variable["name"]] = pref_variable + self.get_application().pref_variables[variable["name"]] = pref_variable self.content.add(pref_group) @@ -183,14 +188,16 @@ def setup_colors_page(self): palette_pref_group.set_name("palette_colors") palette_pref_group.set_title(_("Palette Colors")) palette_pref_group.set_description( - _("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) + _( + 'Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.' + ) + ) for color in settings_schema["palette"]: - palette_shades = AdwcustomizerPaletteShades(color["prefix"], - color["title"], - color["n_shades"]) + palette_shades = AdwcustomizerPaletteShades( + color["prefix"], color["title"], color["n_shades"] + ) palette_pref_group.add(palette_shades) - self.get_application( - ).pref_palette_shades[color["prefix"]] = palette_shades + self.get_application().pref_palette_shades[color["prefix"]] = palette_shades self.content.add(palette_pref_group) def update_errors(self, errors): @@ -200,8 +207,9 @@ def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) self.errors_button.set_visible(len(errors) > 0) for error in errors: - self.errors_list.append(AdwcustomizerError( - error["error"], error["element"], error["line"])) + self.errors_list.append( + AdwcustomizerError(error["error"], error["element"], error["line"]) + ) def on_presets_dropdown_activate(self, *args): self.get_application().reload_user_defined_presets() From f84080832408da0368c8ff33b488993b9e538235 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:44:51 +0200 Subject: [PATCH 132/149] add version --- meson.build | 6 +++++- src/info.py.in | 2 ++ src/main.py | 3 ++- src/meson.build | 11 +++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/info.py.in diff --git a/meson.build b/meson.build index 36f2ff2f4..e22a4fc1e 100644 --- a/meson.build +++ b/meson.build @@ -1,11 +1,15 @@ project('adwcustomizer', - version: 'git', + version: '0.1.0', meson_version: '>= 0.59.0', default_options: [ 'warning_level=2', 'werror=false', ], ) +dependency('glib-2.0') +dependency('pygobject-3.0') +dependency('libadwaita-1') + i18n = import('i18n') gnome = import('gnome') diff --git a/src/info.py.in b/src/info.py.in new file mode 100644 index 000000000..20fc34949 --- /dev/null +++ b/src/info.py.in @@ -0,0 +1,2 @@ +version = '@version@' +build_type = '@build_type@' \ No newline at end of file diff --git a/src/main.py b/src/main.py index 042eaf87b..142524a33 100644 --- a/src/main.py +++ b/src/main.py @@ -35,7 +35,7 @@ from .app_type_dialog import AdwcustomizerAppTypeDialog from .custom_css_group import AdwcustomizerCustomCSSGroup from .plugins_list import AdwcustomizerPluginsList - +from . import info def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -664,6 +664,7 @@ def show_about_window(self, *_args): Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, + version=f"{info.version}" ) about.present() diff --git a/src/meson.build b/src/meson.build index 7f45b1d13..b395392b1 100644 --- a/src/meson.build +++ b/src/meson.build @@ -40,6 +40,17 @@ configure_file( install_dir: get_option('bindir') ) +configure_file( + input: 'info.py.in', + output: '@BASENAME@', + install: true, + install_dir: python.get_install_dir() / 'adwcustomizer', + configuration: configuration_data({ + 'version': meson.project_version(), + 'build_type': get_option('buildtype'), + }), +) + adwcustomizer_sources = [ '__init__.py', 'settings_schema.py', From c775f93492d60738f4453c7f7323af2b82efabd9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:46:03 +0200 Subject: [PATCH 133/149] update meson build --- src/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index b395392b1..d3e13293a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -44,7 +44,7 @@ configure_file( input: 'info.py.in', output: '@BASENAME@', install: true, - install_dir: python.get_install_dir() / 'adwcustomizer', + install_dir: moduledir, configuration: configuration_data({ 'version': meson.project_version(), 'build_type': get_option('buildtype'), From 30ac48c58b3685a52a4b27b44d61fe2b90477094 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:47:30 +0200 Subject: [PATCH 134/149] format --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 142524a33..4849549f9 100644 --- a/src/main.py +++ b/src/main.py @@ -37,6 +37,7 @@ from .plugins_list import AdwcustomizerPluginsList from . import info + def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -664,7 +665,7 @@ def show_about_window(self, *_args): Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, - version=f"{info.version}" + version=f"{info.version}", ) about.present() From 63d59ffd66ece733b449f914eba171e4c2560345 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:51:30 +0200 Subject: [PATCH 135/149] udpate appstream metadata #77 --- ...github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index 9547dad90..86def6ddf 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -2,8 +2,11 @@ com.github.AdwCustomizerTeam.AdwCustomizer.desktop CC0-1.0 - MIT + GPL-3.0 - Change the look of Adwaita, with ease + Change the look of Adwaita, with ease - + https://github.com/AdwCustomizerTeam/AdwCustomizer/issues + https://github.com/AdwCustomizerTeam/AdwCustomizer + https://www.transifex.com/adwcustomizerteam/adwcustomizer/ + \ No newline at end of file From 6b64caccd48484c845c1c96e1f230fef629360f7 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 19:27:47 +0200 Subject: [PATCH 136/149] move menu button next to close button --- src/ui/window.blp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index 3b3abc816..da2d16a8c 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -45,11 +45,6 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } } - [end] - Gtk.MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } [end] MenuButton errors-button { @@ -58,6 +53,13 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { popover: errors-popover; } + + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + } Gtk.Box { From 2d7e04e3b7e0914df7a2bde1e2c9ffefdcafa9a5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 19:27:57 +0200 Subject: [PATCH 137/149] update appstream metadata --- data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index 86def6ddf..b6b00b08c 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -3,6 +3,8 @@ com.github.AdwCustomizerTeam.AdwCustomizer.desktop CC0-1.0 GPL-3.0 + Adwaita Manager + Change the look of Adwaita, with ease Change the look of Adwaita, with ease From 8d2facab423a51c45a07fd5debeca2b53703528f Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 20:12:34 +0200 Subject: [PATCH 138/149] switch back to main Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index 31be453cf..2bb34ef9d 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -71,7 +71,7 @@ { "type" : "git", "path" : ".", - "branch": "next" + "branch": "main" } ] } From 6405f813075861d95168c8018dba123736d029ed Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 20:13:21 +0200 Subject: [PATCH 139/149] auto instead of automatic Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 25d03cc83..2e35d7f4b 100644 --- a/src/window.py +++ b/src/window.py @@ -149,7 +149,7 @@ def setup_monet_page(self): self.monet_theme_row.set_title(_("Theme")) store = Gtk.StringList() - store.append("Automatic") + store.append("Auto") store.append("Dark") store.append("Light") self.monet_theme_row.set_model(store) From 405ad1d079e59ceaa645b28072ae6ccdd21d1f58 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:25:05 +0200 Subject: [PATCH 140/149] Update POT --- po/AdwCustomizer.pot | 229 +++++++++++++++++++++++++------------------ 1 file changed, 134 insertions(+), 95 deletions(-) diff --git a/po/AdwCustomizer.pot b/po/AdwCustomizer.pot index c45e60352..1d707805a 100644 --- a/po/AdwCustomizer.pot +++ b/po/AdwCustomizer.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-09 22:21+0300\n" +"POT-Creation-Date: 2022-08-12 11:24+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,11 +18,13 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: data/com.github.AdwCustomizerTeam.AdwCustomizer.desktop.in:3 -#: src/ui/window.blp:5 src/main.py:332 +#: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:6 +#: src/ui/window.blp:5 src/main.py:642 msgid "Adwaita Manager" msgstr "" #: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:7 +#: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:9 msgid "Change the look of Adwaita, with ease" msgstr "" @@ -70,225 +72,236 @@ msgstr "" msgid "Toggle Text Value" msgstr "" -#: src/ui/window.blp:13 src/main.py:245 +#: src/ui/window.blp:23 src/main.py:428 msgid "Apply" msgstr "" -#: src/ui/window.blp:20 -msgid "Save Preset" +#: src/ui/window.blp:35 +msgid "Presets" msgstr "" -#: src/ui/window.blp:36 -msgid "Presets" +#: src/ui/window.blp:42 +msgid "Save Preset" msgstr "" -#: src/ui/window.blp:58 +#: src/ui/window.blp:112 msgid "Built-in Presets" msgstr "" -#: src/ui/window.blp:73 +#: src/ui/window.blp:134 +msgid "Release Notes" +msgstr "" + +#: src/ui/window.blp:138 msgid "Reset Applied Color Scheme" msgstr "" -#: src/ui/window.blp:74 +#: src/ui/window.blp:142 msgid "About Adwaita Manager" msgstr "" -#: src/app_type_dialog.py:43 src/main.py:264 +#: src/app_type_dialog.py:44 src/main.py:474 msgid "Cancel" msgstr "" -#: src/main.py:123 +#: src/main.py:140 src/main.py:146 msgid "Failed to load preset" msgstr "" -#: src/main.py:139 +#: src/main.py:163 msgid "Open in File Manager" msgstr "" -#: src/main.py:142 +#: src/main.py:169 msgid "User Defined Presets" msgstr "" -#: src/main.py:203 +#: src/main.py:358 msgid "Unsaved changes" msgstr "" -#: src/main.py:243 +#: src/main.py:423 msgid "Apply this color scheme?" msgstr "" -#: src/main.py:244 +#: src/main.py:425 msgid "" "Warning: any custom CSS files for those app types will be irreversibly " "overwritten!" msgstr "" -#: src/main.py:251 +#: src/main.py:448 msgid "Reset applied color scheme?" msgstr "" -#: src/main.py:252 +#: src/main.py:449 msgid "Make sure you have the current settings saved as a preset." msgstr "" -#: src/main.py:253 +#: src/main.py:451 msgid "Reset" msgstr "" -#: src/main.py:260 +#: src/main.py:461 msgid "Save preset as..." msgstr "" -#: src/main.py:261 src/main.py:274 src/main.py:277 +#: src/main.py:463 src/main.py:487 src/main.py:501 #, python-brace-format msgid "" "Saving preset to {0}. If that preset already exists, it will be " "overwritten!" msgstr "" -#: src/main.py:265 +#: src/main.py:475 msgid "Save" msgstr "" -#: src/main.py:334 -msgid "Adwaita Manager Team" +#: src/main.py:541 +msgid "Scheme successfully saved!" msgstr "" -#. Translators: This is a place to put your credits (formats: "Name https://example.com" or "Name ", no quotes) and is not meant to be translated literally. -#: src/main.py:338 -msgid "translator-credits" +#: src/main.py:605 +msgid "Scheme set successfully!" msgstr "" -#: src/option.py:55 +#: src/main.py:637 +msgid "Reset successfully!" +msgstr "" + +#: src/main.py:644 +msgid "Adwaita Manager Team" +msgstr "" + +#: src/option.py:47 msgid "This option is only partially supported by the adw-gtk3 theme." msgstr "" -#: src/option.py:58 +#: src/option.py:52 msgid "This option is not supported by the adw-gtk3 theme." msgstr "" -#: src/option.py:97 +#: src/option.py:94 msgid "Not a color, see text value" msgstr "" -#: src/settings_schema.py:5 +#: src/settings_schema.py:23 msgid "Accent Colors" msgstr "" -#: src/settings_schema.py:6 +#: src/settings_schema.py:25 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, and entries, to indicate that a widget is important, interactive, or " "currently active." msgstr "" -#: src/settings_schema.py:10 src/settings_schema.py:33 -#: src/settings_schema.py:56 src/settings_schema.py:79 -#: src/settings_schema.py:102 +#: src/settings_schema.py:30 src/settings_schema.py:57 +#: src/settings_schema.py:84 src/settings_schema.py:111 +#: src/settings_schema.py:138 msgid "Standalone Color" msgstr "" -#: src/settings_schema.py:11 src/settings_schema.py:34 -#: src/settings_schema.py:57 src/settings_schema.py:80 -#: src/settings_schema.py:103 +#: src/settings_schema.py:32 src/settings_schema.py:59 +#: src/settings_schema.py:86 src/settings_schema.py:113 +#: src/settings_schema.py:140 msgid "" "The standalone colors are similar to the background ones, but provide better " "contrast when used as foreground color on top of a neutral background - for " "example, colorful text in a window." msgstr "" -#: src/settings_schema.py:16 src/settings_schema.py:39 -#: src/settings_schema.py:62 src/settings_schema.py:85 -#: src/settings_schema.py:108 src/settings_schema.py:125 -#: src/settings_schema.py:142 src/settings_schema.py:159 -#: src/settings_schema.py:194 src/settings_schema.py:217 -#: src/settings_schema.py:234 +#: src/settings_schema.py:38 src/settings_schema.py:65 +#: src/settings_schema.py:92 src/settings_schema.py:119 +#: src/settings_schema.py:146 src/settings_schema.py:163 +#: src/settings_schema.py:182 src/settings_schema.py:201 +#: src/settings_schema.py:242 src/settings_schema.py:267 +#: src/settings_schema.py:284 msgid "Background Color" msgstr "" -#: src/settings_schema.py:21 src/settings_schema.py:44 -#: src/settings_schema.py:67 src/settings_schema.py:90 -#: src/settings_schema.py:113 src/settings_schema.py:130 -#: src/settings_schema.py:147 src/settings_schema.py:164 -#: src/settings_schema.py:199 src/settings_schema.py:222 -#: src/settings_schema.py:239 +#: src/settings_schema.py:43 src/settings_schema.py:70 +#: src/settings_schema.py:97 src/settings_schema.py:124 +#: src/settings_schema.py:151 src/settings_schema.py:168 +#: src/settings_schema.py:187 src/settings_schema.py:206 +#: src/settings_schema.py:247 src/settings_schema.py:272 +#: src/settings_schema.py:289 msgid "Foreground Color" msgstr "" -#: src/settings_schema.py:28 +#: src/settings_schema.py:50 msgid "Destructive Colors" msgstr "" -#: src/settings_schema.py:29 +#: src/settings_schema.py:52 msgid "" "These colors are used for buttons to indicate a dangerous action, such as " "deleting a file." msgstr "" -#: src/settings_schema.py:51 +#: src/settings_schema.py:77 msgid "Success Colors" msgstr "" -#: src/settings_schema.py:52 +#: src/settings_schema.py:79 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, entries, and level bars, to indicate a success or a high level." msgstr "" -#: src/settings_schema.py:74 +#: src/settings_schema.py:104 msgid "Warning Colors" msgstr "" -#: src/settings_schema.py:75 +#: src/settings_schema.py:106 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, entries, and level bars, to indicate a warning or a low level." msgstr "" -#: src/settings_schema.py:97 +#: src/settings_schema.py:131 msgid "Error Colors" msgstr "" -#: src/settings_schema.py:98 +#: src/settings_schema.py:133 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, and entries, to indicate a failure." msgstr "" -#: src/settings_schema.py:120 +#: src/settings_schema.py:158 msgid "Window Colors" msgstr "" -#: src/settings_schema.py:121 +#: src/settings_schema.py:159 msgid "These colors are used primarily for windows." msgstr "" -#: src/settings_schema.py:137 +#: src/settings_schema.py:175 msgid "View Colors" msgstr "" -#: src/settings_schema.py:138 +#: src/settings_schema.py:177 msgid "" "These colors are used in a variety of widgets, such as text views and " "entries." msgstr "" -#: src/settings_schema.py:154 +#: src/settings_schema.py:194 msgid "Header Bar Colors" msgstr "" -#: src/settings_schema.py:155 +#: src/settings_schema.py:196 msgid "" "These colors are used for header bars, as well as widgets that are meant to " "be visually attached to it, such as search bars or tab bars." msgstr "" -#: src/settings_schema.py:169 +#: src/settings_schema.py:211 msgid "Border Color" msgstr "" -#: src/settings_schema.py:170 +#: src/settings_schema.py:213 msgid "" "The border color has the same default value as a foreground color, but " "doesn't change along with it. This can be useful if a light window has a " @@ -297,11 +310,11 @@ msgid "" "example, separators between the two header bars in a split header bar layout." msgstr "" -#: src/settings_schema.py:175 +#: src/settings_schema.py:219 msgid "Backdrop Color" msgstr "" -#: src/settings_schema.py:176 +#: src/settings_schema.py:221 msgid "" "The backdrop color is used instead of the background color when the window " "is not focused. By default it's an alias of the window's background color " @@ -309,113 +322,139 @@ msgid "" "it to a value matching your header bar background color." msgstr "" -#: src/settings_schema.py:181 src/settings_schema.py:204 -#: src/settings_schema.py:251 +#: src/settings_schema.py:227 src/settings_schema.py:252 +#: src/settings_schema.py:301 msgid "Shade Color" msgstr "" -#: src/settings_schema.py:182 +#: src/settings_schema.py:229 msgid "" "The shade color is used to provide a dark border for header bars and similar " "widgets that separates them from the main window." msgstr "" -#: src/settings_schema.py:189 +#: src/settings_schema.py:237 msgid "Card Colors" msgstr "" -#: src/settings_schema.py:190 +#: src/settings_schema.py:238 msgid "These colors are used for cards and boxed lists." msgstr "" -#: src/settings_schema.py:205 +#: src/settings_schema.py:254 msgid "" "The shade color is used for shadows that are used by cards to separate " "themselves from the window background, as well as for row dividers in the " "cards." msgstr "" -#: src/settings_schema.py:212 +#: src/settings_schema.py:262 msgid "Dialog Colors" msgstr "" -#: src/settings_schema.py:213 +#: src/settings_schema.py:263 msgid "These colors are used for message dialogs." msgstr "" -#: src/settings_schema.py:229 +#: src/settings_schema.py:279 msgid "Popover Colors" msgstr "" -#: src/settings_schema.py:230 +#: src/settings_schema.py:280 msgid "These colors are used for popovers." msgstr "" -#: src/settings_schema.py:246 +#: src/settings_schema.py:296 msgid "Miscalleneous Colors" msgstr "" -#: src/settings_schema.py:247 +#: src/settings_schema.py:297 msgid "Colors that don't fit in any particular group." msgstr "" -#: src/settings_schema.py:252 +#: src/settings_schema.py:303 msgid "" "The shade color is used by inline tab bars, as well as the transitions in " "leaflets and flaps, and info bar borders." msgstr "" -#: src/settings_schema.py:257 +#: src/settings_schema.py:309 msgid "Scrollbar Outline Color" msgstr "" -#: src/settings_schema.py:258 +#: src/settings_schema.py:311 msgid "" "The scrollbar outline color is used by scrollbars to ensure that overlay " "scrollbars are visible regardless of the content color." msgstr "" -#: src/settings_schema.py:267 +#: src/settings_schema.py:319 msgid "Blue" msgstr "" -#: src/settings_schema.py:272 +#: src/settings_schema.py:320 msgid "Green" msgstr "" -#: src/settings_schema.py:277 +#: src/settings_schema.py:321 msgid "Yellow" msgstr "" -#: src/settings_schema.py:282 +#: src/settings_schema.py:322 msgid "Orange" msgstr "" -#: src/settings_schema.py:287 +#: src/settings_schema.py:323 msgid "Red" msgstr "" -#: src/settings_schema.py:292 +#: src/settings_schema.py:324 msgid "Purple" msgstr "" -#: src/settings_schema.py:297 +#: src/settings_schema.py:325 msgid "Brown" msgstr "" -#: src/settings_schema.py:302 +#: src/settings_schema.py:326 msgid "Light" msgstr "" -#: src/settings_schema.py:307 +#: src/settings_schema.py:327 msgid "Dark" msgstr "" -#: src/window.py:70 +#: src/window.py:104 +msgid "Monet Engine" +msgstr "" + +#: src/window.py:107 +msgid "" +"Monet is an engine that generates Material Design 3 palette from backgrounds " +"color. The generation can be slow" +msgstr "" + +#: src/window.py:112 +msgid "Background Image" +msgstr "" + +#: src/window.py:118 +msgid "Choose a file" +msgstr "" + +#: src/window.py:137 +msgid "Tone" +msgstr "" + +#: src/window.py:149 +msgid "Theme" +msgstr "" + +#: src/window.py:189 msgid "Palette Colors" msgstr "" -#: src/window.py:71 +#: src/window.py:192 msgid "" "Named palette colors used by some applications. Default colors follow the GNOME Human " From deb7a6f40df1acb07f1d291f3c471dc81fa71cd5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:27:19 +0200 Subject: [PATCH 141/149] add devel flatpak --- .github/workflows/flatpak-nightly.yml | 4 +- ...AdwCustomizerTeam.AdwCustomizer.Devel.json | 82 +++++++++++++++++++ 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index fa297f23a..613457218 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -14,6 +14,6 @@ jobs: uses: actions/checkout@v3.0.2 - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 with: - bundle: com.github.AdwCustomizerTeam.AdwCustomizer.flatpak - manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.json + bundle: com.github.AdwCustomizerTeam.AdwCustomizer.Devel.flatpak + manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json cache-key: flatpak-builder-${{ github.sha }}-nightly \ No newline at end of file diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json b/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json new file mode 100644 index 000000000..31be453cf --- /dev/null +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json @@ -0,0 +1,82 @@ +{ + "app-id" : "com.github.AdwCustomizerTeam.AdwCustomizer", + "runtime" : "org.gnome.Platform", + "runtime-version" : "master", + "sdk" : "org.gnome.Sdk", + "command" : "adwcustomizer", + "finish-args" : [ + "--share=network", + "--share=ipc", + "--socket=fallback-x11", + "--device=dri", + "--socket=wayland", + "--filesystem=xdg-config/gtk-3.0", + "--filesystem=xdg-config/gtk-4.0" + ], + "cleanup" : [ + "/include", + "/lib/pkgconfig", + "/man", + "/share/doc", + "/share/gtk-doc", + "/share/man", + "/share/pkgconfig", + "*.la", + "*.a" + ], + "modules" : [ + "pypi-dependencies.json", + { + "name" : "blueprint-compiler", + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "url" : "https://gitlab.gnome.org/jwestman/blueprint-compiler", + "branch" : "main" + } + ] + }, + { + "name": "libportal", + "buildsystem": "meson", + "config-opts": ["-Ddocs=false", "-Dvapi=false", "-Dbackends=gtk4"], + "sources": [ + { + "type": "git", + "url": "https://github.com/flatpak/libportal", + "branch": "main" + } + ] + }, + { + "name": "material-color-utilities-python", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"material_color_utilities_python~=0.1.0\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "path": "./monet/material_color_utilities_python-0.1.0-py3-none-any.whl", + "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" + } + ] + }, + { + "name" : "adwcustomizer", + "builddir" : true, + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "path" : ".", + "branch": "next" + } + ] + } + ], + "build-options" : { + "env" : { } + } +} From e13af9f723333ad3b2311b4cf9393f2d2a9d37d8 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:28:57 +0200 Subject: [PATCH 142/149] update license --- po/AdwCustomizer.pot | 2 +- po/update_potfile.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/po/AdwCustomizer.pot b/po/AdwCustomizer.pot index 1d707805a..13f7a243a 100644 --- a/po/AdwCustomizer.pot +++ b/po/AdwCustomizer.pot @@ -1,6 +1,6 @@ # Adwaita Manager POT file # Copyright (C) 2022 Adwaita Manager Team -# This file is distributed under the MIT/X11 license. +# This file is distributed under the GNU GPLv3 license. # Adwaita Manager Team, 2022. # #, fuzzy diff --git a/po/update_potfile.sh b/po/update_potfile.sh index b20cc2c9e..8c9c7f35f 100755 --- a/po/update_potfile.sh +++ b/po/update_potfile.sh @@ -3,7 +3,7 @@ po_dir=$(dirname "$(realpath "$0")") xgettext -f "$po_dir"/POTFILES -o "$po_dir"/AdwCustomizer.pot --add-comments=Translators --keyword=_ --keyword=C_1c,2 --from-code=UTF-8 sed -i "s/SOME DESCRIPTIVE TITLE./Adwaita Manager POT file/" "$po_dir"/AdwCustomizer.pot sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/$(date +%Y) Adwaita Manager Team/" "$po_dir"/AdwCustomizer.pot -sed -i "s@same license as the PACKAGE package.@MIT/X11 license.@" "$po_dir"/AdwCustomizer.pot +sed -i "s@same license as the PACKAGE package.@GNU GPLv3 license.@" "$po_dir"/AdwCustomizer.pot sed -i "s/FIRST AUTHOR , YEAR./Adwaita Manager Team, $(date +%Y)./" "$po_dir"/AdwCustomizer.pot regex="$po_dir/([a-zA-Z_]*).po" From a9fe0b768dc3df47b20f63c3697a1b0e79e8efa4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:30:51 +0200 Subject: [PATCH 143/149] reverse button order --- src/ui/window.blp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index da2d16a8c..ba11eeb97 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -29,6 +29,12 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { stack: view_stack; } + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + [end] MenuButton presets-dropdown { menu-model: presets-menu; @@ -54,11 +60,6 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } - [end] - Gtk.MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } } From b23768a060e4f8cdae68493158d5342a0c17eaa4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:38:35 +0200 Subject: [PATCH 144/149] change card fg color --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 4849549f9..50f452655 100644 --- a/src/main.py +++ b/src/main.py @@ -278,7 +278,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), - "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), + "card_fg_color": self.rgba_from_argb(dark_theme.onSurface), "card_shade_color": self.rgba_from_argb(dark_theme.shadow), "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), From 36ec03fe62cfd1a38580200a8c55bdd2404a7939 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:49:29 +0200 Subject: [PATCH 145/149] update releases notes --- ...ustomizerTeam.AdwCustomizer.appdata.xml.in | 16 +++++++++ src/main.py | 34 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index b431f38a0..f75d2b327 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -104,6 +104,22 @@ First release of Adwaita Manager. + + Add AdwViewSwitcher in the header bar. + Move CSS to the "Advanced" tab + Move the rest to the "Colours" tab + Add Monet tab which generates a theme from a background + Add disk saved and disk unsaved icon in the header bar + Update about dialog + Change license to GNU GPLv3 + Begin plugin support + Move preset selector to a drop-down called palette (icon palette) + Add ability to apply the theme onlyfor dark theme or oy for light theme + Automaticly use Adwaita-dark preset if the user prefered scheme is dark. + Added Flatpak CI build + Added issue template for bug and feature request + `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch + diff --git a/src/main.py b/src/main.py index 50f452655..bed21e1f7 100644 --- a/src/main.py +++ b/src/main.py @@ -666,6 +666,40 @@ def show_about_window(self, *_args): copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, version=f"{info.version}", + release_notes=""" + + + Add AdwViewSwitcher in the header bar. + Move CSS to the "Advanced" tab + Move the rest to the "Colours" tab + Add Monet tab which generates a theme from a background + Add disk saved and disk unsaved icon in the header bar + Update about dialog + Change license to GNU GPLv3 + Begin plugin support + Move preset selector to a drop-down called palette (icon palette) + Add ability to apply the theme onlyfor dark theme or oy for light theme + Automaticly use Adwaita-dark preset if the user prefered scheme is dark. + Added Flatpak CI build + Added issue template for bug and feature request + `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch + + + """, + comments=""" + + Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. + + With Adwaita Manager you can: + + Change any color of Adwaita theme + Apply Material 3 colors from wallaper + Use other users presets + Change advanced options with CSS + Extend functionality using plugins + + This app is written in Python and uses GTK 4 and libadwaita. + """ ) about.present() From 262a690da3ab80eb3ca9bed8fff6b358ee981864 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:54:45 +0200 Subject: [PATCH 146/149] remove markup --- src/main.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index bed21e1f7..1f93c3fb5 100644 --- a/src/main.py +++ b/src/main.py @@ -667,7 +667,6 @@ def show_about_window(self, *_args): license_type=Gtk.License.GPL_3_0, version=f"{info.version}", release_notes=""" - Add AdwViewSwitcher in the header bar. Move CSS to the "Advanced" tab @@ -684,13 +683,11 @@ def show_about_window(self, *_args): Added issue template for bug and feature request `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch - """, comments=""" - + Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. - - With Adwaita Manager you can: +With Adwaita Manager you can: Change any color of Adwaita theme Apply Material 3 colors from wallaper @@ -698,7 +695,7 @@ def show_about_window(self, *_args): Change advanced options with CSS Extend functionality using plugins - This app is written in Python and uses GTK 4 and libadwaita. + This app is written in Python and uses GTK 4 and libadwaita. """ ) about.present() From 0afaf852d61223ed36bbf8c4eb322dbc4e3c9397 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:55:46 +0200 Subject: [PATCH 147/149] update markups --- src/main.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main.py b/src/main.py index 1f93c3fb5..027696cd3 100644 --- a/src/main.py +++ b/src/main.py @@ -685,16 +685,15 @@ def show_about_window(self, *_args): """, comments=""" - Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. With Adwaita Manager you can: - - Change any color of Adwaita theme - Apply Material 3 colors from wallaper - Use other users presets - Change advanced options with CSS - Extend functionality using plugins - + + Change any color of Adwaita theme + Apply Material 3 colors from wallaper + Use other users presets + Change advanced options with CSS + Extend functionality using plugins + This app is written in Python and uses GTK 4 and libadwaita. """ ) From 9530bbaa83a49692b2f135661095690c17c748bd Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:56:35 +0200 Subject: [PATCH 148/149] update comments --- src/main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.py b/src/main.py index 027696cd3..e4b37a242 100644 --- a/src/main.py +++ b/src/main.py @@ -685,16 +685,16 @@ def show_about_window(self, *_args): """, comments=""" - Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. +Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. With Adwaita Manager you can: - Change any color of Adwaita theme - Apply Material 3 colors from wallaper - Use other users presets - Change advanced options with CSS - Extend functionality using plugins + - Change any color of Adwaita theme + - Apply Material 3 colors from wallaper + - Use other users presets + - Change advanced options with CSS + - Extend functionality using plugins - This app is written in Python and uses GTK 4 and libadwaita. +This app is written in Python and uses GTK 4 and libadwaita. """ ) about.present() From 9c627ec3f5812e9303bbfac90502294466b72349 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:57:13 +0200 Subject: [PATCH 149/149] update markups --- src/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index e4b37a242..acd4983cc 100644 --- a/src/main.py +++ b/src/main.py @@ -689,10 +689,10 @@ def show_about_window(self, *_args): With Adwaita Manager you can: - Change any color of Adwaita theme - - Apply Material 3 colors from wallaper - - Use other users presets - - Change advanced options with CSS - - Extend functionality using plugins + - Apply Material 3 colors from wallaper + - Use other users presets + - Change advanced options with CSS + - Extend functionality using plugins This app is written in Python and uses GTK 4 and libadwaita. """
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 sp!jKhc**ke5dMpW&Ger) Date: Thu, 11 Aug 2022 11:29:51 +0200 Subject: [PATCH 064/149] use local file --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index d162543b7..31be453cf 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -57,7 +57,7 @@ ], "sources": [ { - "type": "url", + "type": "file", "path": "./monet/material_color_utilities_python-0.1.0-py3-none-any.whl", "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" } From 4d74bc5cf92bbe1813f5b1e6e5e0e51a72558831 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 11:49:04 +0200 Subject: [PATCH 065/149] add tone row --- src/window.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 3a705f98a..11b6724fc 100644 --- a/src/window.py +++ b/src/window.py @@ -81,11 +81,16 @@ def on_file_picker_button_clicked(self, *args): def on_monet_file_chooser_response(self, widget, response): if response == Gtk.ResponseType.ACCEPT: - image_file = self.monet_file_chooser_dialog.get_file() - image_basename = image_file.get_basename() + self.monet_image_file = self.monet_file_chooser_dialog.get_file() + image_basename = self.monet_image_file.get_basename() self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() + self.monet_img = Image.open(self.monet_image_file) + self.monet_theme = themeFromImage(self.monet_img) + self.monet_palette = self.monet_theme["palette"] + self.get_application().update_theme_from_monet(self.monet_theme) + def setup_monet_page(self): @@ -126,6 +131,10 @@ def setup_monet_page(self): self.content_monet.add(monet_pref_group) + self.tone_row = Adw.ComboRow() + self.tone_row.set_title(_("Tone")) + print(dir(self.tone_row)) + def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() for app_type in settings_schema["custom_css_app_types"]: From aad88ff496f9aa86a198cc763b40fb002d9356aa Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:03:21 +0200 Subject: [PATCH 066/149] add tone row --- src/window.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 11b6724fc..19122fad4 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] - self.get_application().update_theme_from_monet(self.monet_theme) + #self.get_application().update_theme_from_monet(self.monet_theme, self.tone_row.get_selected_item()) def setup_monet_page(self): @@ -133,6 +133,22 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) + + store = Gtk.ListStore(str) + store_values = [ + "1", + "5", + "10", + "15", + "20", + "25", + "United Kingdom", + "United States of America", + "Uruguay", + ] + for v in store_values: + store.append([v]) + self.tone_row.set_list_factory(store) print(dir(self.tone_row)) def setup_plugins_page(self): From 07e22ed96ec3235362fe97b9eba18dc42d3e7607 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:04:09 +0200 Subject: [PATCH 067/149] update list factory --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 19122fad4..f84a5318a 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListStore(str) + store = Gtk.ListItemFactory(str) store_values = [ "1", "5", From e1ff0aa84875576437f24bf4eb582d27a9d37b03 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:04:34 +0200 Subject: [PATCH 068/149] fix bug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index f84a5318a..8353a828f 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListItemFactory(str) + store = Gtk.ListItemFactory() store_values = [ "1", "5", From ce2067fd00189e92983b24011ea4127c983e9300 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:05:14 +0200 Subject: [PATCH 069/149] add debug info --- src/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window.py b/src/window.py index 8353a828f..7bc102f3e 100644 --- a/src/window.py +++ b/src/window.py @@ -135,6 +135,7 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.ListItemFactory() + print(dir(store)) store_values = [ "1", "5", From 11448c487a8b9a63e843163b5332e1438e99268b Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:06:23 +0200 Subject: [PATCH 070/149] update tone row --- src/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 7bc102f3e..a99b42d00 100644 --- a/src/window.py +++ b/src/window.py @@ -147,8 +147,7 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - for v in store_values: - store.append([v]) + store.set_data(store_values) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From c81d7af57511aa01501975cab814d9d510c70e0d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:07:34 +0200 Subject: [PATCH 071/149] update tone row --- src/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index a99b42d00..0e61c581d 100644 --- a/src/window.py +++ b/src/window.py @@ -147,7 +147,8 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - store.set_data(store_values) + store.replace_qdata(store_values) + store.replace_data(store_values) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From 352ae0c33575f76f96b6c8371f7aa79153cafcef Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:09:18 +0200 Subject: [PATCH 072/149] use GtkStringList --- src/window.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/window.py b/src/window.py index 0e61c581d..b35550b53 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListItemFactory() + store = Gtk.StringList() print(dir(store)) store_values = [ "1", @@ -147,8 +147,8 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - store.replace_qdata(store_values) - store.replace_data(store_values) + for v in store_values: + store.append([v]) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From c50cb8d000238e685bab787f1ad7518763088934 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:09:42 +0200 Subject: [PATCH 073/149] fix error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b35550b53..b28bac1d1 100644 --- a/src/window.py +++ b/src/window.py @@ -148,7 +148,7 @@ def setup_monet_page(self): "Uruguay", ] for v in store_values: - store.append([v]) + store.append(v) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From 5744873bb80e64db6949e5ac5bff2e2f9a2df308 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:10:26 +0200 Subject: [PATCH 074/149] use set_model --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b28bac1d1..258025af3 100644 --- a/src/window.py +++ b/src/window.py @@ -149,7 +149,7 @@ def setup_monet_page(self): ] for v in store_values: store.append(v) - self.tone_row.set_list_factory(store) + self.tone_row.set_model(store) print(dir(self.tone_row)) def setup_plugins_page(self): From 35f78ffb9cfdbac53cd1468e2eb3ab99dc17db9c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:11:07 +0200 Subject: [PATCH 075/149] add tone row to the page --- src/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 258025af3..434c417a6 100644 --- a/src/window.py +++ b/src/window.py @@ -135,7 +135,6 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - print(dir(store)) store_values = [ "1", "5", @@ -150,7 +149,7 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - print(dir(self.tone_row)) + self.content_monet.add(self.tone_row) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From d3d5c3987e153922a51467b62499900a522b5895 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:11:47 +0200 Subject: [PATCH 076/149] update pref group --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 434c417a6..7ce2b1cf8 100644 --- a/src/window.py +++ b/src/window.py @@ -129,7 +129,6 @@ def setup_monet_page(self): self.palette_picker.add_suffix(picker) monet_pref_group.add(self.palette_picker) - self.content_monet.add(monet_pref_group) self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) @@ -149,7 +148,8 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - self.content_monet.add(self.tone_row) + monet_pref_group.add(self.tone_row) + self.content_monet.add(monet_pref_group) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From 7c50a5dc38c068761ecb9e509f6a62b7e301988e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:19:28 +0200 Subject: [PATCH 077/149] set colorpalette --- src/window.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/window.py b/src/window.py index 7ce2b1cf8..4ae21ec71 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,25 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] - #self.get_application().update_theme_from_monet(self.monet_theme, self.tone_row.get_selected_item()) + self.tone = self.tone_row.get_selected_item() + + i = 0 + """ + {'primary': , + 'secondary': , + 'tertiary': , + 'neutral': , + 'neutralVariant': , + 'error': } + """ + print(self.monet_palette) + print(self.monet_theme) + for color in self.monet_palette.values(): + i+=1 + color = color.tone(self.tone) + self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + + #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): @@ -119,7 +137,7 @@ def setup_monet_page(self): self.palette_picker.set_title(_("Monet Palette")) self.palette_picker self.palette_pickers = {} - for i in range(5): + for i in range(6): i = i+1 picker = Gtk.ColorButton() picker.set_name(str(i)) @@ -141,9 +159,7 @@ def setup_monet_page(self): "15", "20", "25", - "United Kingdom", - "United States of America", - "Uruguay", + "30" ] for v in store_values: store.append(v) From b2a5ddd77d5096076242d8cf9192f9079b8181ae Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:20:34 +0200 Subject: [PATCH 078/149] add debug --- src/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window.py b/src/window.py index 4ae21ec71..b554ae472 100644 --- a/src/window.py +++ b/src/window.py @@ -86,6 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() + dir(self.monet_img) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From 26a74fe18f7075f6733f52b76da136449ff534db Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:21:09 +0200 Subject: [PATCH 079/149] fix bug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b554ae472..fb291e46c 100644 --- a/src/window.py +++ b/src/window.py @@ -86,7 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - dir(self.monet_img) + dir(self.monet_image_file) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From f3755eb8a1dc1dc32a0820af5b3ae53cbba5a0da Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:21:48 +0200 Subject: [PATCH 080/149] print debug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index fb291e46c..de17ed356 100644 --- a/src/window.py +++ b/src/window.py @@ -86,7 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - dir(self.monet_image_file) + print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From dbff368414eb89e07e9d65a284aad21806b23ef0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:24:58 +0200 Subject: [PATCH 081/149] use path instead of g object --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index de17ed356..83dec7b83 100644 --- a/src/window.py +++ b/src/window.py @@ -87,7 +87,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() print(dir(self.monet_image_file)) - self.monet_img = Image.open(self.monet_image_file) + self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] self.tone = self.tone_row.get_selected_item() From 028bad472421942cd85ece601bfe80362dfccb8e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:25:47 +0200 Subject: [PATCH 082/149] fix typo error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 83dec7b83..4780fa299 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,7 @@ def on_monet_file_chooser_response(self, widget, response): print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) - self.monet_palette = self.monet_theme["palette"] + self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() i = 0 From d1aa1a93cd637ad3b5cdb7a573c21a5e2e459c29 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:27:07 +0200 Subject: [PATCH 083/149] convert into int --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 4780fa299..4f5d6a4c8 100644 --- a/src/window.py +++ b/src/window.py @@ -86,11 +86,11 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() + print(dir(self.tone)) i = 0 """ @@ -105,7 +105,7 @@ def on_monet_file_chooser_response(self, widget, response): print(self.monet_theme) for color in self.monet_palette.values(): i+=1 - color = color.tone(self.tone) + color = color.tone(int(self.tone)) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) From d08f4acba7bd2fa80014900ad50437f8b8b3df31 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:28:31 +0200 Subject: [PATCH 084/149] fix error --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 4f5d6a4c8..275917824 100644 --- a/src/window.py +++ b/src/window.py @@ -90,7 +90,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - print(dir(self.tone)) + print(dir(self.tone.get_string())) i = 0 """ @@ -105,7 +105,7 @@ def on_monet_file_chooser_response(self, widget, response): print(self.monet_theme) for color in self.monet_palette.values(): i+=1 - color = color.tone(int(self.tone)) + color = color.tone(int(self.tone.get_string())) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) From 20d21ba39cd6a7c521ba1004e13a1f550b1bd4f5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:29:49 +0200 Subject: [PATCH 085/149] print debug --- src/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 275917824..866929fe4 100644 --- a/src/window.py +++ b/src/window.py @@ -90,7 +90,6 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - print(dir(self.tone.get_string())) i = 0 """ @@ -106,8 +105,10 @@ def on_monet_file_chooser_response(self, widget, response): for color in self.monet_palette.values(): i+=1 color = color.tone(int(self.tone.get_string())) + print(color) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + self.palette_pickers["1"].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): From fd5e7ac4994d76520564c938527751523d7b26bb Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:38:57 +0200 Subject: [PATCH 086/149] add toast when reset --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index e94f41da8..3b2e0e9a2 100644 --- a/src/main.py +++ b/src/main.py @@ -433,6 +433,7 @@ def reset_color_scheme(self, widget, response): file.delete() except Exception: pass + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( From 071bcaf2145fbdd43adb394cd8083e9ebf43dfff Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:44:22 +0200 Subject: [PATCH 087/149] update palette --- src/window.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/window.py b/src/window.py index 866929fe4..0c2b77390 100644 --- a/src/window.py +++ b/src/window.py @@ -102,22 +102,33 @@ def on_monet_file_chooser_response(self, widget, response): """ print(self.monet_palette) print(self.monet_theme) + self.monet_pref_group.remove(self.palette_picker) + + self.palette_picker = Adw.ActionRow() + self.palette_picker.set_name("monet_palette") + self.palette_picker.set_title(_("Monet Palette")) + self.palette_picker + self.palette_pickers = {} + i = 0 for color in self.monet_palette.values(): - i+=1 + i = i+1 + picker = Gtk.ColorButton() + picker.set_name(str(i)) color = color.tone(int(self.tone.get_string())) - print(color) - self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) - - self.palette_pickers["1"].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + picker.set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + picker.set_valign(Gtk.Align.CENTER) + self.palette_pickers[str(i)] = picker + self.palette_picker.add_suffix(picker) + self.monet_pref_group.add(self.palette_picker) #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): - monet_pref_group = Adw.PreferencesGroup() - monet_pref_group.set_name("monet") - monet_pref_group.set_title(_("Monet Engine")) - monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + self.monet_pref_group = Adw.PreferencesGroup() + self.monet_pref_group.set_name("monet") + self.monet_pref_group.set_title(_("Monet Engine")) + self.monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -132,7 +143,7 @@ def setup_monet_page(self): self.monet_file_chooser_button.connect("clicked", self.on_file_picker_button_clicked ) self.monet_file_chooser_dialog.connect("response", self.on_monet_file_chooser_response ) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) - monet_pref_group.add(self.monet_file_chooser_row) + self.monet_pref_group.add(self.monet_file_chooser_row) self.palette_picker = Adw.ActionRow() self.palette_picker.set_name("monet_palette") @@ -147,7 +158,7 @@ def setup_monet_page(self): picker.set_valign(Gtk.Align.CENTER) self.palette_pickers[str(i)] = picker self.palette_picker.add_suffix(picker) - monet_pref_group.add(self.palette_picker) + self.monet_pref_group.add(self.palette_picker) self.tone_row = Adw.ComboRow() From 2257a5afeea8c505e8d005afa551eda5d0c3c41a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:45:10 +0200 Subject: [PATCH 088/149] fix bug --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 0c2b77390..07e160ed9 100644 --- a/src/window.py +++ b/src/window.py @@ -177,8 +177,8 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - monet_pref_group.add(self.tone_row) - self.content_monet.add(monet_pref_group) + self.monet_pref_group.add(self.tone_row) + self.content_monet.add(self.monet_pref_group) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From 160e46863ad81602915df718ee421f17772bca09 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:55:12 +0200 Subject: [PATCH 089/149] update tone generation --- src/main.py | 3 ++ src/window.py | 99 ++++++++++++++++----------------------------------- 2 files changed, 33 insertions(+), 69 deletions(-) diff --git a/src/main.py b/src/main.py index 3b2e0e9a2..cb961f23a 100644 --- a/src/main.py +++ b/src/main.py @@ -206,6 +206,9 @@ def load_preset_variables(self, preset): self.reload_variables() + def update_theme_from_monet(self, theme, tone): + pass + def generate_gtk_css(self, app_type): final_css = "" for key in self.variables.keys(): diff --git a/src/window.py b/src/window.py index 07e160ed9..394b64723 100644 --- a/src/window.py +++ b/src/window.py @@ -35,6 +35,7 @@ from .custom_css_group import AdwcustomizerCustomCSSGroup from material_color_utilities_python import * + @Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') class AdwcustomizerMainWindow(Adw.ApplicationWindow): __gtype_name__ = 'AdwcustomizerMainWindow' @@ -52,7 +53,8 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) - self.presets_dropdown.get_popover().connect("show", self.on_presets_dropdown_activate) + self.presets_dropdown.get_popover().connect( + "show", self.on_presets_dropdown_activate) self.setup_monet_page() self.setup_plugins_page() @@ -81,99 +83,54 @@ def on_file_picker_button_clicked(self, *args): def on_monet_file_chooser_response(self, widget, response): if response == Gtk.ResponseType.ACCEPT: - self.monet_image_file = self.monet_file_chooser_dialog.get_file() + self.monet_image_file = self.monet_file_chooser_dialog.get_file() image_basename = self.monet_image_file.get_basename() self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) - self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - - i = 0 - """ - {'primary': , - 'secondary': , - 'tertiary': , - 'neutral': , - 'neutralVariant': , - 'error': } - """ - print(self.monet_palette) - print(self.monet_theme) - self.monet_pref_group.remove(self.palette_picker) - - self.palette_picker = Adw.ActionRow() - self.palette_picker.set_name("monet_palette") - self.palette_picker.set_title(_("Monet Palette")) - self.palette_picker - self.palette_pickers = {} - i = 0 - for color in self.monet_palette.values(): - i = i+1 - picker = Gtk.ColorButton() - picker.set_name(str(i)) - color = color.tone(int(self.tone.get_string())) - picker.set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) - picker.set_valign(Gtk.Align.CENTER) - self.palette_pickers[str(i)] = picker - self.palette_picker.add_suffix(picker) - self.monet_pref_group.add(self.palette_picker) - #self.get_application().update_theme_from_monet(self.monet_theme) + self.get_application().update_theme_from_monet(self.monet_theme, self.tone) def setup_monet_page(self): - self.monet_pref_group = Adw.PreferencesGroup() self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) - self.monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + self.monet_pref_group.set_description( + _("Monet is an engine that generates Material Design 3 palette from backgrounds color")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) - + self.monet_file_chooser_dialog = Gtk.FileChooserNative() self.monet_file_chooser_dialog.set_transient_for(self) self.monet_file_chooser_button = Gtk.Button() self.monet_file_chooser_button.set_label(_("Choose a file")) - self.monet_file_chooser_button.set_icon_name("folder-pictures-symbolic") + self.monet_file_chooser_button.set_icon_name( + "folder-pictures-symbolic") - self.monet_file_chooser_button.connect("clicked", self.on_file_picker_button_clicked ) - self.monet_file_chooser_dialog.connect("response", self.on_monet_file_chooser_response ) + self.monet_file_chooser_button.connect( + "clicked", self.on_file_picker_button_clicked) + self.monet_file_chooser_dialog.connect( + "response", self.on_monet_file_chooser_response) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) self.monet_pref_group.add(self.monet_file_chooser_row) - self.palette_picker = Adw.ActionRow() - self.palette_picker.set_name("monet_palette") - self.palette_picker.set_title(_("Monet Palette")) - self.palette_picker - self.palette_pickers = {} - for i in range(6): - i = i+1 - picker = Gtk.ColorButton() - picker.set_name(str(i)) - picker.set_rgba(Gdk.RGBA(red=0, green=0, blue=0, alpha=0)) - picker.set_valign(Gtk.Align.CENTER) - self.palette_pickers[str(i)] = picker - self.palette_picker.add_suffix(picker) + self.monet_palette_shades = AdwcustomizerPaletteShades("monet", + "Monet Palette", + 6) self.monet_pref_group.add(self.palette_picker) - self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - store_values = [ - "1", - "5", - "10", - "15", - "20", - "25", - "30" - ] + store_values = ["1"] + for i in range(5, 100, 5): + store_values.append(str(i)) for v in store_values: store.append(v) self.tone_row.set_model(store) @@ -198,26 +155,29 @@ def setup_colors_page(self): for variable in group["variables"]: pref_variable = AdwcustomizerOption(variable["name"], variable["title"], - variable.get("explanation"), + variable.get( + "explanation"), variable["adw_gtk3_support"]) pref_group.add(pref_variable) - self.get_application().pref_variables[variable["name"]] = pref_variable + self.get_application( + ).pref_variables[variable["name"]] = pref_variable self.content.add(pref_group) palette_pref_group = Adw.PreferencesGroup() palette_pref_group.set_name("palette_colors") palette_pref_group.set_title(_("Palette Colors")) - palette_pref_group.set_description(_("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) + palette_pref_group.set_description( + _("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) for color in settings_schema["palette"]: palette_shades = AdwcustomizerPaletteShades(color["prefix"], color["title"], color["n_shades"]) palette_pref_group.add(palette_shades) - self.get_application().pref_palette_shades[color["prefix"]] = palette_shades + self.get_application( + ).pref_palette_shades[color["prefix"]] = palette_shades self.content.add(palette_pref_group) - def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) while child is not None: @@ -225,7 +185,8 @@ def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) self.errors_button.set_visible(len(errors) > 0) for error in errors: - self.errors_list.append(AdwcustomizerError(error["error"], error["element"], error["line"])) + self.errors_list.append(AdwcustomizerError( + error["error"], error["element"], error["line"])) def on_presets_dropdown_activate(self, *args): self.get_application().reload_user_defined_presets() From 5d6f4697e512f1016f194709edbd054e00694e87 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:55:49 +0200 Subject: [PATCH 090/149] fix error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 394b64723..67ca2771b 100644 --- a/src/window.py +++ b/src/window.py @@ -122,7 +122,7 @@ def setup_monet_page(self): self.monet_palette_shades = AdwcustomizerPaletteShades("monet", "Monet Palette", 6) - self.monet_pref_group.add(self.palette_picker) + self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) From 93f07e1ff673d3c187ddc776cc3fef445807cd58 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:57:29 +0200 Subject: [PATCH 091/149] add 0xMRTT as translator --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index cb961f23a..a8671c20e 100644 --- a/src/main.py +++ b/src/main.py @@ -449,8 +449,8 @@ def show_about_window(self, *_args): issue_url="https://github.com/AdwCustomizerTeam/AdwCustomizer/issues", developers=[ 'Artyom "ArtyIF" Fomin https://github.com/ArtyIF', - "Verantor https://github.com/Verantor", "0xMRTT https://github.com/0xMRTT", + "Verantor https://github.com/Verantor", ], artists=[ 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' @@ -466,6 +466,7 @@ def show_about_window(self, *_args): Renato Corrêa https://www.transifex.com/user/profile/renatocrrs/ Aggelos Tselios https://www.transifex.com/user/profile/AndroGR/ David "Daudix UFO" Lapshin https://github.com/daudix-UFO' + 0xMRTT https://github.com/0xMRTT Juanjo Cillero https://www.transifex.com/user/profile/renux918/ Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", From f390b01cda4ac7e39caccb1433dcca37a8dc9ec4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 13:02:13 +0200 Subject: [PATCH 092/149] remove PR --- .github/workflows/flatpak-nightly.yml | 1 - .github/workflows/flatpak.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index e05befe07..fa297f23a 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -2,7 +2,6 @@ name: Build flatpak nightly on: push: branches: [next] - pull_request: jobs: flatpak: name: "Flatpak" diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 8d1b02d48..69360a41c 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -2,7 +2,6 @@ name: Build flatpak on: push: branches: [main] - pull_request: jobs: flatpak: name: "Flatpak" From 9aae287cb07333be89d0374f74bed067f8a56366 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:22:08 +0200 Subject: [PATCH 093/149] use palette shades --- src/main.py | 11 ++++++++++- src/window.py | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a8671c20e..f4c360cdd 100644 --- a/src/main.py +++ b/src/main.py @@ -26,6 +26,7 @@ import gi from gi.repository import Gtk, Gdk, Gio, Adw, GLib, Xdp, XdpGtk4 +from material_color_utilities_python import * from .settings_schema import settings_schema from .window import AdwcustomizerMainWindow @@ -207,7 +208,15 @@ def load_preset_variables(self, preset): self.reload_variables() def update_theme_from_monet(self, theme, tone): - pass + palettes = theme["palettes"] + + palette = {} + i = 0 + for color in palettes.values(): + i += 1 + palette[str(i)] = hexFromArgb(color.tone(tone)) + + self.pref_palette_shades["monet"].update_shades() def generate_gtk_css(self, app_type): final_css = "" diff --git a/src/window.py b/src/window.py index 67ca2771b..b92e6eeed 100644 --- a/src/window.py +++ b/src/window.py @@ -122,6 +122,8 @@ def setup_monet_page(self): self.monet_palette_shades = AdwcustomizerPaletteShades("monet", "Monet Palette", 6) + self.get_application( + ).pref_palette_shades["monet"] = self.monet_palette_shades self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() From 91d7e5f7bb578df08e07bcb1e326e332b8a108bc Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:23:31 +0200 Subject: [PATCH 094/149] fix error --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index f4c360cdd..274dae147 100644 --- a/src/main.py +++ b/src/main.py @@ -214,7 +214,7 @@ def update_theme_from_monet(self, theme, tone): i = 0 for color in palettes.values(): i += 1 - palette[str(i)] = hexFromArgb(color.tone(tone)) + palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) self.pref_palette_shades["monet"].update_shades() From c98f8df6101f5fad3639dc9f3423073d85837eac Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:24:16 +0200 Subject: [PATCH 095/149] add missin arg --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 274dae147..fbaf678a4 100644 --- a/src/main.py +++ b/src/main.py @@ -216,7 +216,7 @@ def update_theme_from_monet(self, theme, tone): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) - self.pref_palette_shades["monet"].update_shades() + self.pref_palette_shades["monet"].update_shades(palette) def generate_gtk_css(self, app_type): final_css = "" From 3ad2ebc2586d394dcb40e421a4270512f7f36226 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:25:48 +0200 Subject: [PATCH 096/149] add debug --- src/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.py b/src/main.py index fbaf678a4..ff7dceddf 100644 --- a/src/main.py +++ b/src/main.py @@ -216,6 +216,8 @@ def update_theme_from_monet(self, theme, tone): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) + print(palette) + self.pref_palette_shades["monet"].update_shades(palette) def generate_gtk_css(self, app_type): From b26d9a8df76e83ad27f41280a857f60f40273644 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:45:45 +0200 Subject: [PATCH 097/149] remove tone 1 --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b92e6eeed..efc166bea 100644 --- a/src/window.py +++ b/src/window.py @@ -130,7 +130,7 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - store_values = ["1"] + store_values = [] for i in range(5, 100, 5): store_values.append(str(i)) for v in store_values: From d5bce25c1e699e947049bfa4af0c4e1159fa006d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:55:00 +0200 Subject: [PATCH 098/149] add theme row --- src/window.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/window.py b/src/window.py index efc166bea..5bfb54f19 100644 --- a/src/window.py +++ b/src/window.py @@ -137,6 +137,16 @@ def setup_monet_page(self): store.append(v) self.tone_row.set_model(store) self.monet_pref_group.add(self.tone_row) + + self.monet_theme_row = Adw.ComboRow() + self.monet_theme_row.set_title(_("Theme")) + + store = Gtk.StringList() + store.append("Dark") + store.append("Light") + self.monet_theme_row.set_model(store) + self.monet_pref_group.add(self.monet_theme_row) + self.content_monet.add(self.monet_pref_group) def setup_plugins_page(self): From e2c9b1717836ff21233cecb7e7b102fedc181f08 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:00:07 +0200 Subject: [PATCH 099/149] add monet theme selector --- src/main.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++- src/window.py | 3 ++- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index ff7dceddf..a37cd3993 100644 --- a/src/main.py +++ b/src/main.py @@ -207,9 +207,11 @@ def load_preset_variables(self, preset): self.reload_variables() - def update_theme_from_monet(self, theme, tone): + def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] + monet_theme = monet_theme.get_string() + palette = {} i = 0 for color in palettes.values(): @@ -220,6 +222,56 @@ def update_theme_from_monet(self, theme, tone): self.pref_palette_shades["monet"].update_shades(palette) + print(theme) + + self.variable = { + "accent_color": theme["schemes"]["light"]["primary"], + "accent_bg_color": theme["schemes"]["light"]["primaryContainer"], + "accent_fg_color": theme["schemes"]["light"]["onPrimaryContainer"], + + "destructive_color": theme["schemes"]["light"][""], + "destructive_bg_color": theme["schemes"]["light"][""], + "destructive_fg_color": theme["schemes"]["light"][""], + + "success_color": theme["schemes"]["light"][""], + "success_bg_color": theme["schemes"]["light"][""], + "success_fg_color": theme["schemes"]["light"][""], + + "warning_color": theme["schemes"]["light"][""], + "warning_bg_color": theme["schemes"]["light"][""], + "warning_fg_color": "rgba(0, 0, 0, 0.8)", + + "error_color": theme["schemes"]["light"][""], + "error_bg_color": theme["schemes"]["light"][""], + "error_fg_color": theme["schemes"]["light"][""], + + "window_bg_color": theme["schemes"]["light"][""], + "window_fg_color": theme["schemes"]["light"][""], + + "view_bg_color": theme["schemes"]["light"][""], + "view_fg_color": theme["schemes"]["light"][""], + + "headerbar_bg_color": theme["schemes"]["light"][""], + "headerbar_fg_color": "rgba(0, 0, 0, 0.8)", + "headerbar_border_color": "rgba(0, 0, 0, 0.8)", + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": "rgba(0, 0, 0, 0.07)", + + "card_bg_color": theme["schemes"]["light"][""], + "card_fg_color": "rgba(0, 0, 0, 0.8)", + "card_shade_color": "rgba(0, 0, 0, 0.07)", + + "dialog_bg_color": theme["schemes"]["light"][""], + "dialog_fg_color": "rgba(0, 0, 0, 0.8)", + + "popover_bg_color": theme["schemes"]["light"][""], + "popover_fg_color": "rgba(0, 0, 0, 0.8)", + + "shade_color": theme["schemes"]["light"][""], + "scrollbar_outline_color": theme["schemes"]["light"][""] + } + + def generate_gtk_css(self, app_type): final_css = "" for key in self.variables.keys(): diff --git a/src/window.py b/src/window.py index 5bfb54f19..d38272320 100644 --- a/src/window.py +++ b/src/window.py @@ -91,7 +91,8 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() - self.get_application().update_theme_from_monet(self.monet_theme, self.tone) + self.monet_theme = self.monet_theme_row.get_selected_item() + self.get_application().update_theme_from_monet(self.monet_theme, self.tone, self.monet_theme) def setup_monet_page(self): From d2bde49e06d23a38d29d181bd8d80c38e56e9f68 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:00:33 +0200 Subject: [PATCH 100/149] add debug info --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index a37cd3993..c0d609958 100644 --- a/src/main.py +++ b/src/main.py @@ -222,6 +222,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): self.pref_palette_shades["monet"].update_shades(palette) + print(monet_theme) print(theme) self.variable = { From 47c4218523062b457958d1a3048eca133d6084fa Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:03:57 +0200 Subject: [PATCH 101/149] fix duplicated name --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index d38272320..08e14604d 100644 --- a/src/window.py +++ b/src/window.py @@ -89,10 +89,10 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() self.monet_img = Image.open(self.monet_image_file.get_path()) - self.monet_theme = themeFromImage(self.monet_img) + self.theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.monet_theme, self.tone, self.monet_theme) + self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) def setup_monet_page(self): From f5f8580b2e1a5ba31ea2dc6079ff7dcc1a498705 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:39:31 +0200 Subject: [PATCH 102/149] add automatic theme generation. Need test --- src/main.py | 137 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 101 insertions(+), 36 deletions(-) diff --git a/src/main.py b/src/main.py index c0d609958..314d21aeb 100644 --- a/src/main.py +++ b/src/main.py @@ -207,10 +207,22 @@ def load_preset_variables(self, preset): self.reload_variables() + + def rgba_from_argb(self, argb, alpha = None) -> str: + base = "rgba({}, {}, {}, {})" + + red = redFromArgb(argb) + green = greenFromArgb(argb) + blue = blueFromArgb(argb) + if not alpha: + alpha = alphaFromArgb(argb) + + return base.format(red, green, blue, alpha) + def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] - monet_theme = monet_theme.get_string() + monet_theme = monet_theme.get_string().lower() # dark / light palette = {} i = 0 @@ -225,53 +237,106 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(monet_theme) print(theme) - self.variable = { - "accent_color": theme["schemes"]["light"]["primary"], - "accent_bg_color": theme["schemes"]["light"]["primaryContainer"], - "accent_fg_color": theme["schemes"]["light"]["onPrimaryContainer"], + if monet_theme == "dark": + dark_theme = theme["schemes"]["dark"].toJSON() + self.variable = { + "accent_color": dark_theme["primary"], + "accent_bg_color": dark_theme["primaryContainer"], + "accent_fg_color": dark_theme["onPrimaryContainer"], + + "destructive_color": dark_theme["error"], + "destructive_bg_color": dark_theme["errorContainer"], + "destructive_fg_color": dark_theme["onError"], + + "success_color": dark_theme["tertiary"], + "success_bg_color": dark_theme["onTertiary"], + "success_fg_color": dark_theme["tertiaryContainer"], + + "warning_color": dark_theme["secondaryContainer"], + "warning_bg_color": dark_theme["inversePrimary"], + "warning_fg_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + + "error_color": dark_theme["error"], + "error_bg_color": dark_theme["errorContainer"], + "error_fg_color": dark_theme["onError"], + + "window_bg_color": dark_theme["surface"], + "window_fg_color": dark_theme["onSurface"], - "destructive_color": theme["schemes"]["light"][""], - "destructive_bg_color": theme["schemes"]["light"][""], - "destructive_fg_color": theme["schemes"]["light"][""], + "view_bg_color": dark_theme["surface"], + "view_fg_color": dark_theme["onSurface"], - "success_color": theme["schemes"]["light"][""], - "success_bg_color": theme["schemes"]["light"][""], - "success_fg_color": theme["schemes"]["light"][""], + "headerbar_bg_color": dark_theme["surface"], + "headerbar_fg_color": dark_theme["onSurface"], + "headerbar_border_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": dark_theme["shadow"], - "warning_color": theme["schemes"]["light"][""], - "warning_bg_color": theme["schemes"]["light"][""], - "warning_fg_color": "rgba(0, 0, 0, 0.8)", + "card_bg_color": self.rgba_from_argb(dark_theme["primary"], "0.05"), + "card_fg_color": dark_theme["surfaceVariant"], + "card_shade_color": dark_theme["shadow"], - "error_color": theme["schemes"]["light"][""], - "error_bg_color": theme["schemes"]["light"][""], - "error_fg_color": theme["schemes"]["light"][""], + "dialog_bg_color": dark_theme["secondaryContainer"], + "dialog_fg_color": dark_theme["onSecondaryContainer"], - "window_bg_color": theme["schemes"]["light"][""], - "window_fg_color": theme["schemes"]["light"][""], + "popover_bg_color": dark_theme["secondaryContainer"], + "popover_fg_color": dark_theme["onSecondaryContainer"], - "view_bg_color": theme["schemes"]["light"][""], - "view_fg_color": theme["schemes"]["light"][""], + "shade_color": dark_theme["shadow"], + "scrollbar_outline_color": dark_theme["outline"] + } + else: # light + light_theme = theme["schemes"]["light"].toJSON() + self.variable = { + "accent_color": light_theme["primary"], + "accent_bg_color": light_theme["primaryContainer"], + "accent_fg_color": light_theme["onPrimaryContainer"], - "headerbar_bg_color": theme["schemes"]["light"][""], - "headerbar_fg_color": "rgba(0, 0, 0, 0.8)", - "headerbar_border_color": "rgba(0, 0, 0, 0.8)", - "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": "rgba(0, 0, 0, 0.07)", + "destructive_color": light_theme["error"], + "destructive_bg_color": light_theme["errorContainer"], + "destructive_fg_color": light_theme["onError"], - "card_bg_color": theme["schemes"]["light"][""], - "card_fg_color": "rgba(0, 0, 0, 0.8)", - "card_shade_color": "rgba(0, 0, 0, 0.07)", + "success_color": light_theme["tertiary"], + "success_bg_color": light_theme["onTertiary"], + "success_fg_color": light_theme["tertiaryContainer"], - "dialog_bg_color": theme["schemes"]["light"][""], - "dialog_fg_color": "rgba(0, 0, 0, 0.8)", + "warning_color": light_theme["secondaryContainer"], + "warning_bg_color": light_theme["inversePrimary"], + "warning_fg_color": self.rgba_from_argb(light_theme["primary"], "0.8"), - "popover_bg_color": theme["schemes"]["light"][""], - "popover_fg_color": "rgba(0, 0, 0, 0.8)", + "error_color": light_theme["error"], + "error_bg_color": light_theme["errorContainer"], + "error_fg_color": light_theme["onError"], - "shade_color": theme["schemes"]["light"][""], - "scrollbar_outline_color": theme["schemes"]["light"][""] - } + "window_bg_color": light_theme["surface"], + "window_fg_color": light_theme["onSurface"], + "view_bg_color": light_theme["surface"], + "view_fg_color": light_theme["onSurface"], + + "headerbar_bg_color": light_theme["surface"], + "headerbar_fg_color": light_theme["onSurface"], + "headerbar_border_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": light_theme["shadow"], + + "card_bg_color": self.rgba_from_argb(light_theme["primary"], "0.05"), + "card_fg_color": light_theme["surfaceVariant"], + "card_shade_color": light_theme["shadow"], + + "dialog_bg_color": light_theme["secondaryContainer"], + "dialog_fg_color": light_theme["onSecondaryContainer"], + + "popover_bg_color": light_theme["secondaryContainer"], + "popover_fg_color": light_theme["onSecondaryContainer"], + + "shade_color": light_theme["shadow"], + "scrollbar_outline_color": light_theme["outline"] + } + + for key in self.variables.keys(): + if key in self.pref_variables: + self.pref_variables[key].update_value(self.variables[key]) def generate_gtk_css(self, app_type): final_css = "" From eb52f52fbb6c7fe4dc92771af839a39776c0e840 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:41:46 +0200 Subject: [PATCH 103/149] fix error --- src/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 314d21aeb..9e08e3b0d 100644 --- a/src/main.py +++ b/src/main.py @@ -239,7 +239,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"].toJSON() - self.variable = { + variable = { "accent_color": dark_theme["primary"], "accent_bg_color": dark_theme["primaryContainer"], "accent_fg_color": dark_theme["onPrimaryContainer"], @@ -287,7 +287,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): } else: # light light_theme = theme["schemes"]["light"].toJSON() - self.variable = { + variable = { "accent_color": light_theme["primary"], "accent_bg_color": light_theme["primaryContainer"], "accent_fg_color": light_theme["onPrimaryContainer"], @@ -334,9 +334,9 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "scrollbar_outline_color": light_theme["outline"] } - for key in self.variables.keys(): + for key in variables.keys(): if key in self.pref_variables: - self.pref_variables[key].update_value(self.variables[key]) + self.pref_variables[key].update_value(variables[key]) def generate_gtk_css(self, app_type): final_css = "" From 8c25c94e9545968462508b63e50772cff267050c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:44:12 +0200 Subject: [PATCH 104/149] add reload --- src/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.py b/src/main.py index 9e08e3b0d..0dab116bd 100644 --- a/src/main.py +++ b/src/main.py @@ -337,6 +337,8 @@ def update_theme_from_monet(self, theme, tone, monet_theme): for key in variables.keys(): if key in self.pref_variables: self.pref_variables[key].update_value(variables[key]) + + self.reload_variables() def generate_gtk_css(self, app_type): final_css = "" From aada5ae201fd69e6ec9a7e8458eda551b912f6f0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:46:00 +0200 Subject: [PATCH 105/149] add conditon --- src/window.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/window.py b/src/window.py index 08e14604d..205942adc 100644 --- a/src/window.py +++ b/src/window.py @@ -88,11 +88,12 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - self.monet_img = Image.open(self.monet_image_file.get_path()) - self.theme = themeFromImage(self.monet_img) - self.tone = self.tone_row.get_selected_item() - self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) + if response == Gtk.ResponseType.ACCEPT: + self.monet_img = Image.open(self.monet_image_file.get_path()) + self.theme = themeFromImage(self.monet_img) + self.tone = self.tone_row.get_selected_item() + self.monet_theme = self.monet_theme_row.get_selected_item() + self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) def setup_monet_page(self): From df673661572dccafe6ee7d0aad165b7e7905d29c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:57:41 +0200 Subject: [PATCH 106/149] fix error --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 0dab116bd..4089c2bb2 100644 --- a/src/main.py +++ b/src/main.py @@ -240,7 +240,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"].toJSON() variable = { - "accent_color": dark_theme["primary"], + "accent_color": dark_theme.primary, "accent_bg_color": dark_theme["primaryContainer"], "accent_fg_color": dark_theme["onPrimaryContainer"], @@ -334,9 +334,9 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "scrollbar_outline_color": light_theme["outline"] } - for key in variables.keys(): + for key in variable.keys(): if key in self.pref_variables: - self.pref_variables[key].update_value(variables[key]) + self.pref_variables[key].update_value(variable[key]) self.reload_variables() From 686035177b84911702658937f9e43bcbee7e2173 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:58:53 +0200 Subject: [PATCH 107/149] fix bug --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 4089c2bb2..a8870f66b 100644 --- a/src/main.py +++ b/src/main.py @@ -238,11 +238,11 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(theme) if monet_theme == "dark": - dark_theme = theme["schemes"]["dark"].toJSON() + dark_theme = theme["schemes"]["dark"] variable = { "accent_color": dark_theme.primary, - "accent_bg_color": dark_theme["primaryContainer"], - "accent_fg_color": dark_theme["onPrimaryContainer"], + "accent_bg_color": dark_theme.primaryContainer, + "accent_fg_color": dark_theme.onPrimaryContainer, "destructive_color": dark_theme["error"], "destructive_bg_color": dark_theme["errorContainer"], From a4f48a11b44b4d988423015097f967923932c390 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:03:34 +0200 Subject: [PATCH 108/149] update dark sheme --- src/main.py | 60 ++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/main.py b/src/main.py index a8870f66b..143e5d934 100644 --- a/src/main.py +++ b/src/main.py @@ -244,49 +244,49 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_bg_color": dark_theme.primaryContainer, "accent_fg_color": dark_theme.onPrimaryContainer, - "destructive_color": dark_theme["error"], - "destructive_bg_color": dark_theme["errorContainer"], - "destructive_fg_color": dark_theme["onError"], + "destructive_color": dark_theme.error, + "destructive_bg_color": dark_theme.errorContainer, + "destructive_fg_color": dark_theme.onError, - "success_color": dark_theme["tertiary"], - "success_bg_color": dark_theme["onTertiary"], - "success_fg_color": dark_theme["tertiaryContainer"], + "success_color": dark_theme.tertiary, + "success_bg_color": dark_theme.onTertiary, + "success_fg_color": dark_theme.tertiaryContainer, - "warning_color": dark_theme["secondaryContainer"], - "warning_bg_color": dark_theme["inversePrimary"], - "warning_fg_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "warning_color": dark_theme.secondaryContainer, + "warning_bg_color": dark_theme.inversePrimary, + "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": dark_theme["error"], - "error_bg_color": dark_theme["errorContainer"], - "error_fg_color": dark_theme["onError"], + "error_color": dark_theme.error, + "error_bg_color": dark_theme.errorContainer, + "error_fg_color": dark_theme.onError, - "window_bg_color": dark_theme["surface"], - "window_fg_color": dark_theme["onSurface"], + "window_bg_color": dark_theme.surface, + "window_fg_color": dark_theme.onSurface, - "view_bg_color": dark_theme["surface"], - "view_fg_color": dark_theme["onSurface"], + "view_bg_color": dark_theme.surface, + "view_fg_color": dark_theme.onSurface, - "headerbar_bg_color": dark_theme["surface"], - "headerbar_fg_color": dark_theme["onSurface"], - "headerbar_border_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "headerbar_bg_color": dark_theme.surface, + "headerbar_fg_color": dark_theme.onSurface, + "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": dark_theme["shadow"], + "headerbar_shade_color": dark_theme.shadow, - "card_bg_color": self.rgba_from_argb(dark_theme["primary"], "0.05"), - "card_fg_color": dark_theme["surfaceVariant"], - "card_shade_color": dark_theme["shadow"], + "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), + "card_fg_color": dark_theme.surfaceVariant, + "card_shade_color": dark_theme.shadow, - "dialog_bg_color": dark_theme["secondaryContainer"], - "dialog_fg_color": dark_theme["onSecondaryContainer"], + "dialog_bg_color": dark_theme.secondaryContainer, + "dialog_fg_color": dark_theme.onSecondaryContainer, - "popover_bg_color": dark_theme["secondaryContainer"], - "popover_fg_color": dark_theme["onSecondaryContainer"], + "popover_bg_color": dark_theme.secondaryContainer, + "popover_fg_color": dark_theme.onSecondaryContainer, - "shade_color": dark_theme["shadow"], - "scrollbar_outline_color": dark_theme["outline"] + "shade_color": dark_theme.shadow, + "scrollbar_outline_color": dark_theme.outline } else: # light - light_theme = theme["schemes"]["light"].toJSON() + light_theme = theme["schemes"]["light"] variable = { "accent_color": light_theme["primary"], "accent_bg_color": light_theme["primaryContainer"], From 2382062177dc2b6be2ec8508a9adac34753d51c0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:06:55 +0200 Subject: [PATCH 109/149] convert to rgba --- src/main.py | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/main.py b/src/main.py index 143e5d934..c7231e161 100644 --- a/src/main.py +++ b/src/main.py @@ -240,50 +240,50 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"] variable = { - "accent_color": dark_theme.primary, - "accent_bg_color": dark_theme.primaryContainer, - "accent_fg_color": dark_theme.onPrimaryContainer, + "accent_color": self.rgba_from_argb(dark_theme.primary), + "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), + "accent_fg_color": self.rgba_from_argb(dark_theme.onPrimaryContainer), - "destructive_color": dark_theme.error, - "destructive_bg_color": dark_theme.errorContainer, - "destructive_fg_color": dark_theme.onError, + "destructive_color": self.rgba_from_argb(dark_theme.error), + "destructive_bg_color": self.rgba_from_argb(dark_theme.errorContainer), + "destructive_fg_color": self.rgba_from_argb(dark_theme.onError), - "success_color": dark_theme.tertiary, - "success_bg_color": dark_theme.onTertiary, - "success_fg_color": dark_theme.tertiaryContainer, + "success_color": self.rgba_from_argb(dark_theme.tertiary), + "success_bg_color": self.rgba_from_argb(dark_theme.onTertiary), + "success_fg_color": self.rgba_from_argb(dark_theme.tertiaryContainer), - "warning_color": dark_theme.secondaryContainer, - "warning_bg_color": dark_theme.inversePrimary, + "warning_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "warning_bg_color": self.rgba_from_argb(dark_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": dark_theme.error, - "error_bg_color": dark_theme.errorContainer, - "error_fg_color": dark_theme.onError, + "error_color": self.rgba_from_argb(dark_theme.error), + "error_bg_color": self.rgba_from_argb(dark_theme.errorContainer), + "error_fg_color": self.rgba_from_argb(dark_theme.onError), - "window_bg_color": dark_theme.surface, - "window_fg_color": dark_theme.onSurface, + "window_bg_color": self.rgba_from_argb(dark_theme.surface), + "window_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "view_bg_color": dark_theme.surface, - "view_fg_color": dark_theme.onSurface, + "view_bg_color": self.rgba_from_argb(dark_theme.surface), + "view_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_bg_color": dark_theme.surface, - "headerbar_fg_color": dark_theme.onSurface, + "headerbar_bg_color": self.rgba_from_argb(dark_theme.surface), + "headerbar_fg_color": self.rgba_from_argb(dark_theme.onSurface), "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": dark_theme.shadow, + "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), - "card_fg_color": dark_theme.surfaceVariant, - "card_shade_color": dark_theme.shadow, + "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), + "card_shade_color": self.rgba_from_argb(dark_theme.shadow), - "dialog_bg_color": dark_theme.secondaryContainer, - "dialog_fg_color": dark_theme.onSecondaryContainer, + "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "popover_bg_color": dark_theme.secondaryContainer, - "popover_fg_color": dark_theme.onSecondaryContainer, + "popover_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "popover_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "shade_color": dark_theme.shadow, - "scrollbar_outline_color": dark_theme.outline + "shade_color": self.rgba_from_argb(dark_theme.shadow), + "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) } else: # light light_theme = theme["schemes"]["light"] From 1b12e486244c38b0a0d14f59cd01be66825e4cd0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:17:35 +0200 Subject: [PATCH 110/149] update tones --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 205942adc..e5f413426 100644 --- a/src/window.py +++ b/src/window.py @@ -101,7 +101,7 @@ def setup_monet_page(self): self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) self.monet_pref_group.set_description( - _("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + _("Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -133,7 +133,7 @@ def setup_monet_page(self): store = Gtk.StringList() store_values = [] - for i in range(5, 100, 5): + for i in range(20, 80, 5): store_values.append(str(i)) for v in store_values: store.append(v) From 0324b9575947bacabbf1099c2107cd3e5491dc08 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:22:34 +0200 Subject: [PATCH 111/149] add automatic preset load --- src/main.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index c7231e161..92fa90dd4 100644 --- a/src/main.py +++ b/src/main.py @@ -96,9 +96,17 @@ def do_activate(self): self.create_action("about", self.show_about_window) self.reload_user_defined_presets() - self.load_preset_from_resource( - "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita.json" - ) + + self.style_manager = Adw.StyleManager.get_default() + + if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: + self.load_preset_from_resource( + "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" + ) + else: + self.load_preset_from_resource( + "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita.json" + ) self.win.present() From f996aeeaccec757a7cca2cadf3826a373f770b92 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:23:08 +0200 Subject: [PATCH 112/149] add debug --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index 92fa90dd4..3a430c01d 100644 --- a/src/main.py +++ b/src/main.py @@ -99,6 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() + print(self.style_manager.get_color_scheme()) if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From 7bf5edf685f16b39bc8870924be508fca5278e34 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:24:40 +0200 Subject: [PATCH 113/149] add more debug --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 3a430c01d..661823e7f 100644 --- a/src/main.py +++ b/src/main.py @@ -98,8 +98,9 @@ def do_activate(self): self.reload_user_defined_presets() self.style_manager = Adw.StyleManager.get_default() - + print(dir(self.style_manager)) print(self.style_manager.get_color_scheme()) + print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From e939dcdd1722e8790964544e8665721ec61e793d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:25:41 +0200 Subject: [PATCH 114/149] fix bug --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 661823e7f..8a2c5bc14 100644 --- a/src/main.py +++ b/src/main.py @@ -99,9 +99,10 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) + print(self.style_manager.get_default()) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) - if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: + if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" ) From 004bf83923814f8d75d30179de80a9f2b12d76b5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:26:48 +0200 Subject: [PATCH 115/149] add debug --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 8a2c5bc14..e7c33d578 100644 --- a/src/main.py +++ b/src/main.py @@ -99,7 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) - print(self.style_manager.get_default()) + print(dir(self.style_manager.get_default())) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: From 3339808f0a28dd33710138e43516508069c986d0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:28:27 +0200 Subject: [PATCH 116/149] add debug --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index e7c33d578..4eceea150 100644 --- a/src/main.py +++ b/src/main.py @@ -100,6 +100,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) print(dir(self.style_manager.get_default())) + print(self.style_manager.get_default().get_color_scheme()) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: From aff7cf44f647e3d2fd89dfeabaf543c03f5f4198 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:33:27 +0200 Subject: [PATCH 117/149] fix style manager --- src/main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 4eceea150..e19935439 100644 --- a/src/main.py +++ b/src/main.py @@ -99,10 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) - print(dir(self.style_manager.get_default())) - print(self.style_manager.get_default().get_color_scheme()) - print(self.style_manager.get_color_scheme()) - print(dir(self.style_manager.get_color_scheme())) + print(self.style_manager.get_dark()) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From 8f2b40d01fe75f1ef4b3c412829d396d1f4e7568 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:34:28 +0200 Subject: [PATCH 118/149] add automatic preset choice if dark or ligjt --- src/main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index e19935439..a6578d3e4 100644 --- a/src/main.py +++ b/src/main.py @@ -98,9 +98,7 @@ def do_activate(self): self.reload_user_defined_presets() self.style_manager = Adw.StyleManager.get_default() - print(dir(self.style_manager)) - print(self.style_manager.get_dark()) - if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: + if self.style_manager.get_dark(): self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" ) From 9f222bd06e2a5db7cec0593cf79bef2e4957d300 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:37:03 +0200 Subject: [PATCH 119/149] add automatic color choice for monet --- src/main.py | 7 ++++++- src/window.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a6578d3e4..4868c1575 100644 --- a/src/main.py +++ b/src/main.py @@ -243,7 +243,12 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(monet_theme) print(theme) - + if monet_theme == "automatic": + if self.style_manager.get_dark(): + monet_theme = "dark" + else: + monet_theme = "light" + if monet_theme == "dark": dark_theme = theme["schemes"]["dark"] variable = { diff --git a/src/window.py b/src/window.py index e5f413426..1f10d3f0a 100644 --- a/src/window.py +++ b/src/window.py @@ -144,6 +144,7 @@ def setup_monet_page(self): self.monet_theme_row.set_title(_("Theme")) store = Gtk.StringList() + store.append("Automatic") store.append("Dark") store.append("Light") self.monet_theme_row.set_model(store) From 28e6218038ed4f67c50b67d3bc350d704a748c76 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:39:34 +0200 Subject: [PATCH 120/149] update light theme scheme --- src/main.py | 64 ++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/main.py b/src/main.py index 4868c1575..6aa3b4843 100644 --- a/src/main.py +++ b/src/main.py @@ -300,50 +300,50 @@ def update_theme_from_monet(self, theme, tone, monet_theme): else: # light light_theme = theme["schemes"]["light"] variable = { - "accent_color": light_theme["primary"], - "accent_bg_color": light_theme["primaryContainer"], - "accent_fg_color": light_theme["onPrimaryContainer"], + "accent_color": self.rgba_from_argb(light_theme.primary), + "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), + "accent_fg_color": self.rgba_from_argb(light_theme.onPrimaryContainer), - "destructive_color": light_theme["error"], - "destructive_bg_color": light_theme["errorContainer"], - "destructive_fg_color": light_theme["onError"], + "destructive_color": self.rgba_from_argb(light_theme.error), + "destructive_bg_color": self.rgba_from_argb(light_theme.errorContainer), + "destructive_fg_color": self.rgba_from_argb(light_theme.onError), - "success_color": light_theme["tertiary"], - "success_bg_color": light_theme["onTertiary"], - "success_fg_color": light_theme["tertiaryContainer"], + "success_color": self.rgba_from_argb(light_theme.tertiary), + "success_bg_color": self.rgba_from_argb(light_theme.onTertiary), + "success_fg_color": self.rgba_from_argb(light_theme.tertiaryContainer), - "warning_color": light_theme["secondaryContainer"], - "warning_bg_color": light_theme["inversePrimary"], - "warning_fg_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "warning_color": self.rgba_from_argb(light_theme.secondaryContainer), + "warning_bg_color": self.rgba_from_argb(light_theme.inversePrimary), + "warning_fg_color": self.rgba_from_argb(light_theme.primary, "0.8"), - "error_color": light_theme["error"], - "error_bg_color": light_theme["errorContainer"], - "error_fg_color": light_theme["onError"], + "error_color": self.rgba_from_argb(light_theme.error), + "error_bg_color": self.rgba_from_argb(light_theme.errorContainer), + "error_fg_color": self.rgba_from_argb(light_theme.onError), - "window_bg_color": light_theme["surface"], - "window_fg_color": light_theme["onSurface"], + "window_bg_color": self.rgba_from_argb(light_theme.surface), + "window_fg_color": self.rgba_from_argb(light_theme.onSurface), - "view_bg_color": light_theme["surface"], - "view_fg_color": light_theme["onSurface"], + "view_bg_color": self.rgba_from_argb(light_theme.surface), + "view_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_bg_color": light_theme["surface"], - "headerbar_fg_color": light_theme["onSurface"], - "headerbar_border_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "headerbar_bg_color": self.rgba_from_argb(light_theme.surface), + "headerbar_fg_color": self.rgba_from_argb(light_theme.onSurface), + "headerbar_border_color": self.rgba_from_argb(light_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": light_theme["shadow"], + "headerbar_shade_color": self.rgba_from_argb(light_theme.shadow), - "card_bg_color": self.rgba_from_argb(light_theme["primary"], "0.05"), - "card_fg_color": light_theme["surfaceVariant"], - "card_shade_color": light_theme["shadow"], + "card_bg_color": self.rgba_from_argb(light_theme.primary, "0.05"), + "card_fg_color": self.rgba_from_argb(light_theme.surfaceVariant), + "card_shade_color": self.rgba_from_argb(light_theme.shadow), - "dialog_bg_color": light_theme["secondaryContainer"], - "dialog_fg_color": light_theme["onSecondaryContainer"], + "dialog_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), + "dialog_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - "popover_bg_color": light_theme["secondaryContainer"], - "popover_fg_color": light_theme["onSecondaryContainer"], + "popover_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), + "popover_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - "shade_color": light_theme["shadow"], - "scrollbar_outline_color": light_theme["outline"] + "shade_color": self.rgba_from_argb(light_theme.shadow), + "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline) } for key in variable.keys(): From 8e51c880acbddaf88d0f68b1940931835a57e6b2 Mon Sep 17 00:00:00 2001 From: David Lapshin Date: Thu, 11 Aug 2022 17:48:22 +0300 Subject: [PATCH 121/149] Fix missing settings-symbolic & open-menu-symbolic --- src/adwcustomizer.gresource.xml | 8 ++++++-- ...thub.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg | 2 -- ...AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg | 8 ++++++++ ....AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg | 2 ++ src/ui/window.blp | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) delete mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg diff --git a/src/adwcustomizer.gresource.xml b/src/adwcustomizer.gresource.xml index dc6a30581..fa71a5932 100644 --- a/src/adwcustomizer.gresource.xml +++ b/src/adwcustomizer.gresource.xml @@ -42,11 +42,15 @@ >icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg + alias="open-menu-symbolic.svg" + >icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-fill-symbolic.svg + icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg deleted file mode 100644 index 50b8a3c4d..000000000 --- a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg new file mode 100644 index 000000000..7f4474335 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg new file mode 100644 index 000000000..408d7e5d4 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/src/ui/window.blp b/src/ui/window.blp index e9e6deb74..3b3abc816 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -47,7 +47,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { [end] Gtk.MenuButton { - icon-name: "menu-symbolic"; + icon-name: "open-menu-symbolic"; menu-model: main-menu; } From 84dda5f78d499801a49c20ed7163bfec4854f006 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:53:41 +0200 Subject: [PATCH 122/149] add switch to select dark or light apply --- src/main.py | 72 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/src/main.py b/src/main.py index 6aa3b4843..819f4dd10 100644 --- a/src/main.py +++ b/src/main.py @@ -443,7 +443,13 @@ def show_apply_color_scheme_dialog(self, *_args): Adw.ResponseAppearance.SUGGESTED, transient_for=self.props.active_window, ) - dialog.connect("response", self.apply_color_scheme) + + switch = Gtk.Switch() + print(dir(switch)) + + dialog.set_extra_child(switch) + + dialog.connect("response", self.apply_color_scheme, switch) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -534,28 +540,50 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response): + def apply_color_scheme(self, widget, response, switch): if response == "apply": - if widget.get_app_types()["gtk4"]: - gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") - if not os.path.exists(gtk4_dir): - os.makedirs(gtk4_dir) - gtk4_css = self.generate_gtk_css("gtk4") - with open( - os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8" - ) as file: - file.write(gtk4_css) - if widget.get_app_types()["gtk3"]: - gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") - if not os.path.exists(gtk3_dir): - os.makedirs(gtk3_dir) - gtk3_css = self.generate_gtk_css("gtk3") - with open( - os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" - ) as file: - file.write(gtk3_css) + if switch.get_active(): + if widget.get_app_types()["gtk4"]: + gtk4_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + if not os.path.exists(gtk4_dir): + os.makedirs(gtk4_dir) + gtk4_css = self.generate_gtk_css("gtk4") + with open( + os.path.join(gtk4_dir, "gtk-dark.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk4_css) + if widget.get_app_types()["gtk3"]: + gtk3_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + if not os.path.exists(gtk3_dir): + os.makedirs(gtk3_dir) + gtk3_css = self.generate_gtk_css("gtk3") + with open( + os.path.join(gtk3_dir, "gtk-dark.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk3_css) + else: + if widget.get_app_types()["gtk4"]: + gtk4_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + if not os.path.exists(gtk4_dir): + os.makedirs(gtk4_dir) + gtk4_css = self.generate_gtk_css("gtk4") + with open( + os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk4_css) + if widget.get_app_types()["gtk3"]: + gtk3_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + if not os.path.exists(gtk3_dir): + os.makedirs(gtk3_dir) + gtk3_css = self.generate_gtk_css("gtk3") + with open( + os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk3_css) self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): From 5e96066b9c4b1578a159c564f9931efeacbd0c19 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 17:57:02 +0200 Subject: [PATCH 123/149] change license Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 819f4dd10..a8e7e471a 100644 --- a/src/main.py +++ b/src/main.py @@ -641,7 +641,7 @@ def show_about_window(self, *_args): Juanjo Cillero https://www.transifex.com/user/profile/renux918/ Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", - license_type=Gtk.License.MIT_X11, + license_type=Gtk.License.GPL_3_0, ) about.present() From f054988887d13b1517b79cba8f9a69957d671ad4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:21:13 +0200 Subject: [PATCH 124/149] rework apply --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a8e7e471a..fc68884de 100644 --- a/src/main.py +++ b/src/main.py @@ -444,7 +444,7 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - switch = Gtk.Switch() + switch = Adw.ActionRow() print(dir(switch)) dialog.set_extra_child(switch) From 7639f5313c1e8a1d031adcbb3bed350edb153cf9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:24:37 +0200 Subject: [PATCH 125/149] update comborow --- src/main.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index fc68884de..04ac224e6 100644 --- a/src/main.py +++ b/src/main.py @@ -444,12 +444,18 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - switch = Adw.ActionRow() - print(dir(switch)) + comborow = Adw.ComboRow() + comborow.set_title(_("Apply as dark theme")) - dialog.set_extra_child(switch) + store = Gtk.StringList() + store.append("Dark") + store.append("Light") + comborow.set_model(store) + print(dir(comborow)) - dialog.connect("response", self.apply_color_scheme, switch) + dialog.set_extra_child(comborow) + + dialog.connect("response", self.apply_color_scheme, comborow) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -540,9 +546,9 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response, switch): + def apply_color_scheme(self, widget, response, comborow): if response == "apply": - if switch.get_active(): + if comborow.get_string().lower() == "dark": if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") From ac53e2e876add0dad2e4871bd7b3a66ea0ab0df7 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:31:44 +0200 Subject: [PATCH 126/149] use switch instead --- src/main.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main.py b/src/main.py index 04ac224e6..f76002025 100644 --- a/src/main.py +++ b/src/main.py @@ -444,18 +444,18 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - comborow = Adw.ComboRow() - comborow.set_title(_("Apply as dark theme")) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - store = Gtk.StringList() - store.append("Dark") - store.append("Light") - comborow.set_model(store) - print(dir(comborow)) + label = Gtk.Label(text="Export as Dark theme") + switch = Gtk.Switch() - dialog.set_extra_child(comborow) + box.append(label) + box.append(switch) + print(dir(switch)) - dialog.connect("response", self.apply_color_scheme, comborow) + dialog.set_extra_child(box) + + dialog.connect("response", self.apply_color_scheme, switch) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -546,9 +546,9 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response, comborow): + def apply_color_scheme(self, widget, response, switch): if response == "apply": - if comborow.get_string().lower() == "dark": + if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") From 4278e213228f94e38423a59aa46942ed2b00b4db Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:32:46 +0200 Subject: [PATCH 127/149] fix bug --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index f76002025..b681a0398 100644 --- a/src/main.py +++ b/src/main.py @@ -446,7 +446,7 @@ def show_apply_color_scheme_dialog(self, *_args): box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - label = Gtk.Label(text="Export as Dark theme") + label = Gtk.Label(label="Export as Dark theme") switch = Gtk.Switch() box.append(label) From 18bb8725ee3e5420d4b5d249e344699b7c1ea30a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:35:23 +0200 Subject: [PATCH 128/149] increase spacing --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index b681a0398..959b83397 100644 --- a/src/main.py +++ b/src/main.py @@ -444,7 +444,7 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=30) label = Gtk.Label(label="Export as Dark theme") switch = Gtk.Switch() From b6105f6302a28c6ad4f2f6b9b033b6e2e8ca59cf Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:38:00 +0200 Subject: [PATCH 129/149] update label --- src/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 959b83397..8595303d5 100644 --- a/src/main.py +++ b/src/main.py @@ -444,9 +444,9 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=30) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - label = Gtk.Label(label="Export as Dark theme") + label = Gtk.Label(label="Apply as Dark theme") switch = Gtk.Switch() box.append(label) From b7c6be25e731b205bf7a8c7ecb45bee60a10b014 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:39:24 +0200 Subject: [PATCH 130/149] format --- src/main.py | 72 +++++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/main.py b/src/main.py index 8595303d5..4d4d6f45a 100644 --- a/src/main.py +++ b/src/main.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -36,6 +36,7 @@ from .custom_css_group import AdwcustomizerCustomCSSGroup from .plugins_list import AdwcustomizerPluginsList + def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -114,7 +115,7 @@ def reload_user_defined_presets(self): self.props.active_window.presets_menu.remove(1) preset_directory = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets") if not os.path.exists(preset_directory): os.makedirs(preset_directory) @@ -141,7 +142,8 @@ def reload_user_defined_presets(self): "line": traceback.format_exc().strip(), } ) - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Failed to load preset"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Failed to load preset"))) self.props.active_window.update_errors(self.global_errors) @@ -174,7 +176,8 @@ def open_dir_callback(_, result): self.portal.open_uri( parent, - "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets"), + "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets"), Xdp.OpenUriFlags.NONE, None, open_dir_callback, @@ -214,8 +217,7 @@ def load_preset_variables(self, preset): self.reload_variables() - - def rgba_from_argb(self, argb, alpha = None) -> str: + def rgba_from_argb(self, argb, alpha=None) -> str: base = "rgba({}, {}, {}, {})" red = redFromArgb(argb) @@ -229,28 +231,22 @@ def rgba_from_argb(self, argb, alpha = None) -> str: def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] - monet_theme = monet_theme.get_string().lower() # dark / light + monet_theme = monet_theme.get_string().lower() # dark / light palette = {} i = 0 for color in palettes.values(): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) - - print(palette) - self.pref_palette_shades["monet"].update_shades(palette) - - print(monet_theme) - print(theme) if monet_theme == "automatic": if self.style_manager.get_dark(): monet_theme = "dark" else: monet_theme = "light" - + if monet_theme == "dark": - dark_theme = theme["schemes"]["dark"] + dark_theme = theme["schemes"]["dark"] variable = { "accent_color": self.rgba_from_argb(dark_theme.primary), "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), @@ -297,8 +293,8 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "shade_color": self.rgba_from_argb(dark_theme.shadow), "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) } - else: # light - light_theme = theme["schemes"]["light"] + else: # light + light_theme = theme["schemes"]["light"] variable = { "accent_color": self.rgba_from_argb(light_theme.primary), "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), @@ -349,7 +345,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): for key in variable.keys(): if key in self.pref_variables: self.pref_variables[key].update_value(variable[key]) - + self.reload_variables() def generate_gtk_css(self, app_type): @@ -419,7 +415,8 @@ def load_preset_action(self, _unused, *args): if args[0].get_string().startswith("custom-"): self.load_preset_from_file( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", args[0].get_string().replace("custom-", "", 1) + ".json", ) @@ -451,7 +448,6 @@ def show_apply_color_scheme_dialog(self, *_args): box.append(label) box.append(switch) - print(dir(switch)) dialog.set_extra_child(box) @@ -478,7 +474,8 @@ def show_save_preset_dialog(self, *_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(self.preset_name) + ".json", ) @@ -501,7 +498,7 @@ def on_preset_entry_change(*_args): dialog.set_body( _( "Saving preset to {0}. If that preset already exists, it will be overwritten!" - ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets")) + ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets")) ) dialog.set_response_enabled("save", False) else: @@ -510,7 +507,8 @@ def on_preset_entry_change(*_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(preset_entry.get_text()) + ".json", ) @@ -529,7 +527,8 @@ def save_preset(self, _unused, response, entry): if response == "save": with open( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(entry.get_text()) + ".json", ), @@ -544,14 +543,15 @@ def save_preset(self, _unused, response, entry): } file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Scheme successfully saved!"))) def apply_color_scheme(self, widget, response, switch): if response == "apply": if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -561,7 +561,7 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -572,7 +572,7 @@ def apply_color_scheme(self, widget, response, switch): else: if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -582,7 +582,7 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -590,30 +590,32 @@ def apply_color_scheme(self, widget, response, switch): os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" ) as file: file.write(gtk3_css) - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): if response == "reset": if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0/gtk.css") ) try: file.delete() except Exception: pass - + if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0/gtk.css") ) try: file.delete() except Exception: pass - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( From 1ee3b7c0bf0d349004c57742ef8498cb4b501df5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:39:52 +0200 Subject: [PATCH 131/149] format --- src/app_type_dialog.py | 23 +++- src/custom_css_group.py | 24 ++-- src/error.py | 9 +- src/main.py | 157 +++++++++++++------------ src/option.py | 27 +++-- src/palette_shades.py | 25 ++-- src/plugin.py | 11 +- src/plugins/__init__.py | 6 +- src/plugins/gtk4.py | 7 +- src/plugins_list.py | 21 ++-- src/setting.py | 7 +- src/settings_schema.py | 251 ++++++++++++++++++++-------------------- src/window.py | 70 ++++++----- 13 files changed, 355 insertions(+), 283 deletions(-) diff --git a/src/app_type_dialog.py b/src/app_type_dialog.py index be2707fe2..f7f88133d 100644 --- a/src/app_type_dialog.py +++ b/src/app_type_dialog.py @@ -7,25 +7,36 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/app_type_dialog.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/app_type_dialog.ui" +) class AdwcustomizerAppTypeDialog(Adw.MessageDialog): - __gtype_name__ = 'AdwcustomizerAppTypeDialog' + __gtype_name__ = "AdwcustomizerAppTypeDialog" gtk4_app_type = Gtk.Template.Child("gtk4-app-type") gtk3_app_type = Gtk.Template.Child("gtk3-app-type") - def __init__(self, heading, body, ok_response_name, ok_response_label, ok_response_appearance, **kwargs): + def __init__( + self, + heading, + body, + ok_response_name, + ok_response_label, + ok_response_appearance, + **kwargs + ): super().__init__(**kwargs) self.set_heading(heading) self.set_body(body) @@ -39,5 +50,5 @@ def __init__(self, heading, body, ok_response_name, ok_response_label, ok_respon def get_app_types(self): return { "gtk4": self.gtk4_app_type.get_active(), - "gtk3": self.gtk3_app_type.get_active() + "gtk3": self.gtk3_app_type.get_active(), } diff --git a/src/custom_css_group.py b/src/custom_css_group.py index 2e2d453bd..1f98ab800 100644 --- a/src/custom_css_group.py +++ b/src/custom_css_group.py @@ -7,20 +7,23 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/custom_css_group.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/custom_css_group.ui" +) class AdwcustomizerCustomCSSGroup(Adw.PreferencesGroup): - __gtype_name__ = 'AdwcustomizerCustomCSSGroup' + __gtype_name__ = "AdwcustomizerCustomCSSGroup" app_type_dropdown = Gtk.Template.Child("app-type-dropdown") custom_css_text_view = Gtk.Template.Child("custom-css-text-view") @@ -31,14 +34,21 @@ def __init__(self, **kwargs): def load_custom_css(self, custom_css): self.custom_css = custom_css - self.custom_css_text_view.get_buffer().set_text(list(self.custom_css.values())[self.app_type_dropdown.get_selected()]) + self.custom_css_text_view.get_buffer().set_text( + list(self.custom_css.values())[self.app_type_dropdown.get_selected()] + ) @Gtk.Template.Callback() def on_custom_css_changed(self, buffer): Gtk.Application.get_default().mark_as_dirty() - Gtk.Application.get_default().update_custom_css_text(list(self.custom_css.keys())[self.app_type_dropdown.get_selected()], buffer.props.text) + Gtk.Application.get_default().update_custom_css_text( + list(self.custom_css.keys())[self.app_type_dropdown.get_selected()], + buffer.props.text, + ) @Gtk.Template.Callback() def on_dropdown_notify(self, _unused, pspec): if pspec.name == "selected": - self.custom_css_text_view.get_buffer().set_text(list(self.custom_css.values())[self.app_type_dropdown.get_selected()]) + self.custom_css_text_view.get_buffer().set_text( + list(self.custom_css.values())[self.app_type_dropdown.get_selected()] + ) diff --git a/src/error.py b/src/error.py index 98fd3fdf1..2760bd544 100644 --- a/src/error.py +++ b/src/error.py @@ -7,20 +7,21 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/error.ui') + +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/error.ui") class AdwcustomizerError(Gtk.ListBoxRow): - __gtype_name__ = 'AdwcustomizerError' + __gtype_name__ = "AdwcustomizerError" error_label = Gtk.Template.Child("error-label") element_label = Gtk.Template.Child("element-label") diff --git a/src/main.py b/src/main.py index 4d4d6f45a..042eaf87b 100644 --- a/src/main.py +++ b/src/main.py @@ -89,10 +89,8 @@ def do_activate(self): GLib.Variant("s", "adwaita"), self.load_preset_action, ) - self.create_action("apply_color_scheme", - self.show_apply_color_scheme_dialog) - self.create_action("reset_color_scheme", - self.show_reset_color_scheme_dialog) + self.create_action("apply_color_scheme", self.show_apply_color_scheme_dialog) + self.create_action("reset_color_scheme", self.show_reset_color_scheme_dialog) self.create_action("save_preset", self.show_save_preset_dialog) self.create_action("about", self.show_about_window) @@ -115,7 +113,9 @@ def reload_user_defined_presets(self): self.props.active_window.presets_menu.remove(1) preset_directory = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), + "presets", + ) if not os.path.exists(preset_directory): os.makedirs(preset_directory) @@ -132,8 +132,7 @@ def reload_user_defined_presets(self): raise KeyError("variables") if preset.get("palette") is None: raise KeyError("palette") - self.custom_presets[file_name.replace( - ".json", "")] = preset["name"] + self.custom_presets[file_name.replace(".json", "")] = preset["name"] except Exception: self.global_errors.append( { @@ -143,7 +142,8 @@ def reload_user_defined_presets(self): } ) self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Failed to load preset"))) + Adw.Toast(title=_("Failed to load preset")) + ) self.props.active_window.update_errors(self.global_errors) @@ -176,8 +176,11 @@ def open_dir_callback(_, result): self.portal.open_uri( parent, - "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), "presets"), + "file://" + + os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), + "presets", + ), Xdp.OpenUriFlags.NONE, None, open_dir_callback, @@ -190,8 +193,7 @@ def load_preset_from_file(self, preset_path): self.load_preset_variables(json.loads(preset_text)) def load_preset_from_resource(self, preset_path): - preset_text = Gio.resources_lookup_data( - preset_path, 0).get_data().decode() + preset_text = Gio.resources_lookup_data(preset_path, 0).get_data().decode() self.load_preset_variables(json.loads(preset_text)) def load_preset_variables(self, preset): @@ -251,47 +253,40 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_color": self.rgba_from_argb(dark_theme.primary), "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), "accent_fg_color": self.rgba_from_argb(dark_theme.onPrimaryContainer), - "destructive_color": self.rgba_from_argb(dark_theme.error), "destructive_bg_color": self.rgba_from_argb(dark_theme.errorContainer), "destructive_fg_color": self.rgba_from_argb(dark_theme.onError), - "success_color": self.rgba_from_argb(dark_theme.tertiary), "success_bg_color": self.rgba_from_argb(dark_theme.onTertiary), "success_fg_color": self.rgba_from_argb(dark_theme.tertiaryContainer), - "warning_color": self.rgba_from_argb(dark_theme.secondaryContainer), "warning_bg_color": self.rgba_from_argb(dark_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": self.rgba_from_argb(dark_theme.error), "error_bg_color": self.rgba_from_argb(dark_theme.errorContainer), "error_fg_color": self.rgba_from_argb(dark_theme.onError), - "window_bg_color": self.rgba_from_argb(dark_theme.surface), "window_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "view_bg_color": self.rgba_from_argb(dark_theme.surface), "view_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_bg_color": self.rgba_from_argb(dark_theme.surface), "headerbar_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), + "headerbar_border_color": self.rgba_from_argb( + dark_theme.primary, "0.8" + ), "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), - "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), "card_shade_color": self.rgba_from_argb(dark_theme.shadow), - "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "popover_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), - "popover_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - + "popover_fg_color": self.rgba_from_argb( + dark_theme.onSecondaryContainer + ), "shade_color": self.rgba_from_argb(dark_theme.shadow), - "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) + "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline), } else: # light light_theme = theme["schemes"]["light"] @@ -299,47 +294,42 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_color": self.rgba_from_argb(light_theme.primary), "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), "accent_fg_color": self.rgba_from_argb(light_theme.onPrimaryContainer), - "destructive_color": self.rgba_from_argb(light_theme.error), "destructive_bg_color": self.rgba_from_argb(light_theme.errorContainer), "destructive_fg_color": self.rgba_from_argb(light_theme.onError), - "success_color": self.rgba_from_argb(light_theme.tertiary), "success_bg_color": self.rgba_from_argb(light_theme.onTertiary), "success_fg_color": self.rgba_from_argb(light_theme.tertiaryContainer), - "warning_color": self.rgba_from_argb(light_theme.secondaryContainer), "warning_bg_color": self.rgba_from_argb(light_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(light_theme.primary, "0.8"), - "error_color": self.rgba_from_argb(light_theme.error), "error_bg_color": self.rgba_from_argb(light_theme.errorContainer), "error_fg_color": self.rgba_from_argb(light_theme.onError), - "window_bg_color": self.rgba_from_argb(light_theme.surface), "window_fg_color": self.rgba_from_argb(light_theme.onSurface), - "view_bg_color": self.rgba_from_argb(light_theme.surface), "view_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_bg_color": self.rgba_from_argb(light_theme.surface), "headerbar_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_border_color": self.rgba_from_argb(light_theme.primary, "0.8"), + "headerbar_border_color": self.rgba_from_argb( + light_theme.primary, "0.8" + ), "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(light_theme.shadow), - "card_bg_color": self.rgba_from_argb(light_theme.primary, "0.05"), "card_fg_color": self.rgba_from_argb(light_theme.surfaceVariant), "card_shade_color": self.rgba_from_argb(light_theme.shadow), - "dialog_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), - "dialog_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - + "dialog_fg_color": self.rgba_from_argb( + light_theme.onSecondaryContainer + ), "popover_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), - "popover_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - + "popover_fg_color": self.rgba_from_argb( + light_theme.onSecondaryContainer + ), "shade_color": self.rgba_from_argb(light_theme.shadow), - "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline) + "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline), } for key in variable.keys(): @@ -395,8 +385,7 @@ def on_error(_, section, error): css_provider.connect("parsing-error", on_error) css_provider.load_from_data(gtk_css.encode()) - self.props.active_window.update_errors( - self.global_errors + parsing_errors) + self.props.active_window.update_errors(self.global_errors + parsing_errors) # loading with the priority above user to override the applied config if self.current_css_provider is not None: Gtk.StyleContext.remove_provider_for_display( @@ -415,8 +404,7 @@ def load_preset_action(self, _unused, *args): if args[0].get_string().startswith("custom-"): self.load_preset_from_file( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", args[0].get_string().replace("custom-", "", 1) + ".json", ) @@ -474,8 +462,7 @@ def show_save_preset_dialog(self, *_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", to_slug_case(self.preset_name) + ".json", ) @@ -485,8 +472,7 @@ def show_save_preset_dialog(self, *_args): dialog.add_response("cancel", _("Cancel")) dialog.add_response("save", _("Save")) - dialog.set_response_appearance( - "save", Adw.ResponseAppearance.SUGGESTED) + dialog.set_response_appearance("save", Adw.ResponseAppearance.SUGGESTED) dialog.set_default_response("cancel") dialog.set_close_response("cancel") @@ -498,7 +484,14 @@ def on_preset_entry_change(*_args): dialog.set_body( _( "Saving preset to {0}. If that preset already exists, it will be overwritten!" - ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets")) + ).format( + os.path.join( + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "presets", + ) + ) ) dialog.set_response_enabled("save", False) else: @@ -507,8 +500,9 @@ def on_preset_entry_change(*_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), "presets", to_slug_case(preset_entry.get_text()) + ".json", ) @@ -527,8 +521,7 @@ def save_preset(self, _unused, response, entry): if response == "save": with open( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", to_slug_case(entry.get_text()) + ".json", ), @@ -544,14 +537,19 @@ def save_preset(self, _unused, response, entry): file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Scheme successfully saved!"))) + Adw.Toast(title=_("Scheme successfully saved!")) + ) def apply_color_scheme(self, widget, response, switch): if response == "apply": if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0", + ) if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -561,7 +559,11 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0", + ) if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -572,7 +574,11 @@ def apply_color_scheme(self, widget, response, switch): else: if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0", + ) if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -582,7 +588,11 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0", + ) if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -591,14 +601,19 @@ def apply_color_scheme(self, widget, response, switch): ) as file: file.write(gtk3_css) self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Scheme set successfully!"))) + Adw.Toast(title=_("Scheme set successfully!")) + ) def reset_color_scheme(self, widget, response): if response == "reset": if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0/gtk.css") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0/gtk.css", + ) ) try: file.delete() @@ -608,14 +623,17 @@ def reset_color_scheme(self, widget, response): if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0/gtk.css") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0/gtk.css", + ) ) try: file.delete() except Exception: pass - self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Reset successfully!"))) + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( @@ -631,12 +649,8 @@ def show_about_window(self, *_args): "0xMRTT https://github.com/0xMRTT", "Verantor https://github.com/Verantor", ], - artists=[ - 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' - ], - designers=[ - 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' - ], + artists=['David "Daudix UFO" Lapshin https://github.com/daudix-UFO'], + designers=['David "Daudix UFO" Lapshin https://github.com/daudix-UFO'], # Translators: This is a place to put your credits (formats: "Name https://example.com" or "Name ", no quotes) and is not meant to be translated literally. translator_credits="""Maxime V https://www.transifex.com/user/profile/Adaoh/ FineFindus https://github.com/FineFindus @@ -676,8 +690,7 @@ def create_stateful_action( self, name, parameter_type, initial_state, callback, shortcuts=None ): """Add a stateful application action.""" - action = Gio.SimpleAction.new_stateful( - name, parameter_type, initial_state) + action = Gio.SimpleAction.new_stateful(name, parameter_type, initial_state) action.connect("activate", callback) self.add_action(action) if shortcuts: diff --git a/src/option.py b/src/option.py index ed98f2d12..885339f22 100644 --- a/src/option.py +++ b/src/option.py @@ -7,20 +7,21 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/option.ui') + +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/option.ui") class AdwcustomizerOption(Adw.ActionRow): - __gtype_name__ = 'AdwcustomizerOption' + __gtype_name__ = "AdwcustomizerOption" color_value = Gtk.Template.Child("color-value") text_value = Gtk.Template.Child("text-value") @@ -42,10 +43,14 @@ def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs): self.warning_button.set_visible(False) elif adw_gtk3_support == "partial": self.warning_button.add_css_class("warning") - self.warning_label.set_label(_("This option is only partially supported by the adw-gtk3 theme.")) + self.warning_label.set_label( + _("This option is only partially supported by the adw-gtk3 theme.") + ) elif adw_gtk3_support == "no": self.warning_button.add_css_class("error") - self.warning_label.set_label(_("This option is not supported by the adw-gtk3 theme.")) + self.warning_label.set_label( + _("This option is not supported by the adw-gtk3 theme.") + ) self.explanation_label.set_label(explanation or "") if explanation is None: @@ -53,7 +58,9 @@ def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs): @Gtk.Template.Callback() def on_color_value_changed(self, *_args): - self.update_value(self.color_value.get_rgba().to_string(), update_from="color_value") + self.update_value( + self.color_value.get_rgba().to_string(), update_from="color_value" + ) @Gtk.Template.Callback() def on_text_value_changed(self, *_args): @@ -86,7 +93,11 @@ def update_value(self, new_value, **kwargs): self.color_value.set_rgba(rgba) self.color_value.set_tooltip_text(_("Not a color, see text value")) - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "text_value" and new_value != "": + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "text_value" + and new_value != "" + ): Gtk.Application.get_default().variables[self.get_name()] = new_value Gtk.Application.get_default().mark_as_dirty() Gtk.Application.get_default().reload_variables() diff --git a/src/palette_shades.py b/src/palette_shades.py index f7eb9bf79..dcb0cc63d 100644 --- a/src/palette_shades.py +++ b/src/palette_shades.py @@ -7,20 +7,23 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/palette_shades.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/palette_shades.ui" +) class AdwcustomizerPaletteShades(Adw.ActionRow): - __gtype_name__ = 'AdwcustomizerPaletteShades' + __gtype_name__ = "AdwcustomizerPaletteShades" def __init__(self, prefix, color_title, n_shades, **kwargs): super().__init__(**kwargs) @@ -52,9 +55,17 @@ def update_shades(self, shades, **kwargs): if new_rgba.parse(shades[str(i)]): self.color_pickers[str(i)].set_rgba(new_rgba) self.color_pickers[str(i)].set_tooltip_text(shades[str(i)]) - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "color_value": - Gtk.Application.get_default().palette[self.prefix][str(i)] = shades[str(i)] + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "color_value" + ): + Gtk.Application.get_default().palette[self.prefix][str(i)] = shades[ + str(i) + ] - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "color_value": + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "color_value" + ): Gtk.Application.get_default().mark_as_dirty() Gtk.Application.get_default().reload_variables() diff --git a/src/plugin.py b/src/plugin.py index 16a234f24..cceb7e014 100644 --- a/src/plugin.py +++ b/src/plugin.py @@ -7,17 +7,18 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from .setting import AdwcustomizerSetting + class AdwcustomizerPlugin: def __init__(self): self.title = None @@ -48,7 +49,9 @@ def get_custom_settings_for_preset(self): def get_alias_values(self): alias_values = {} for key, value in self.alias_dict.items(): - alias_values[key] = self.colors.get(value, self.palette.get(value, self.custom_settings.get(value))) + alias_values[key] = self.colors.get( + value, self.palette.get(value, self.custom_settings.get(value)) + ) return alias_values def validate(self): @@ -58,4 +61,4 @@ def apply(self): raise NotImplementedError() def save(self): - pass \ No newline at end of file + pass diff --git a/src/plugins/__init__.py b/src/plugins/__init__.py index a66319289..f93ffe537 100644 --- a/src/plugins/__init__.py +++ b/src/plugins/__init__.py @@ -7,11 +7,11 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with this program. If not, see . \ No newline at end of file +# along with this program. If not, see . diff --git a/src/plugins/gtk4.py b/src/plugins/gtk4.py index b5a7d14f1..dd5fe68e9 100644 --- a/src/plugins/gtk4.py +++ b/src/plugins/gtk4.py @@ -7,16 +7,17 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from ..plugin import AdwcustomizerPlugin + class AdwcustomizerGtk4Plugin(AdwcustomizerPlugin): - pass \ No newline at end of file + pass diff --git a/src/plugins_list.py b/src/plugins_list.py index 3c7c04b35..d2c14499e 100644 --- a/src/plugins_list.py +++ b/src/plugins_list.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -20,22 +20,27 @@ import os from pathlib import Path import importlib + + class AdwcustomizerPluginsList: def __init__(self): - self.plugins = { # AdwCustomizerTeam plugins - "gtk4": AdwcustomizerGtk4Plugin() - } + self.plugins = {"gtk4": AdwcustomizerGtk4Plugin()} # AdwCustomizerTeam plugins self.add_user_plugins() def add_user_plugins(self): - self.user_plugin_dir = Path(os.environ.get("XDG_DATA_HOME", os.environ["HOME"])) / ".local" / "share" / "AdwCustomizer" / "plugins" + self.user_plugin_dir = ( + Path(os.environ.get("XDG_DATA_HOME", os.environ["HOME"])) + / ".local" + / "share" + / "AdwCustomizer" + / "plugins" + ) if self.user_plugin_dir.exists(): for path, _, name in os.walk(self.user_plugin_dir): print(name[0]) else: print("No plugins dir found") - def load_all_custom_settings(self, settings): for plugin_id, plugin in self.plugins.items(): plugin.load_custom_settings(settings[plugin_id]) @@ -43,4 +48,4 @@ def load_all_custom_settings(self, settings): def get_all_custom_settings_for_preset(self): custom_settings = {} for plugin_id, plugin in self.plugins.items(): - custom_settings[plugin_id] = plugin.get_custom_settings_for_preset() \ No newline at end of file + custom_settings[plugin_id] = plugin.get_custom_settings_for_preset() diff --git a/src/setting.py b/src/setting.py index 9a7492815..a2d3479b5 100644 --- a/src/setting.py +++ b/src/setting.py @@ -7,15 +7,16 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . + class AdwcustomizerSetting: def __init__(self, name, title, value_type, explanation=None, default_value=None): # TODO supported types: @@ -34,4 +35,4 @@ def __init__(self, name, title, value_type, explanation=None, default_value=None def set_value(self, new_value): # TODO checks - self.value = new_value \ No newline at end of file + self.value = new_value diff --git a/src/settings_schema.py b/src/settings_schema.py index ea9317441..ea22ce840 100644 --- a/src/settings_schema.py +++ b/src/settings_schema.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -21,117 +21,137 @@ { "name": "accent_colors", "title": _("Accent Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, and entries, to indicate that a widget is important, interactive, or currently active."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, and entries, to indicate that a widget is important, interactive, or currently active." + ), "variables": [ { "name": "accent_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "accent_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "accent_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "destructive_colors", "title": _("Destructive Colors"), - "description": _("These colors are used for buttons to indicate a dangerous action, such as deleting a file."), + "description": _( + "These colors are used for buttons to indicate a dangerous action, such as deleting a file." + ), "variables": [ { "name": "destructive_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "destructive_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "destructive_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "success_colors", "title": _("Success Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a success or a high level."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a success or a high level." + ), "variables": [ { "name": "success_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "success_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "success_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "warning_colors", "title": _("Warning Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a warning or a low level."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a warning or a low level." + ), "variables": [ { "name": "warning_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "warning_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "warning_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "error_colors", "title": _("Error Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, and entries, to indicate a failure."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, and entries, to indicate a failure." + ), "variables": [ { "name": "error_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "error_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "error_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "window_colors", @@ -141,66 +161,76 @@ { "name": "window_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "window_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "view_colors", "title": _("View Colors"), - "description": _("These colors are used in a variety of widgets, such as text views and entries."), + "description": _( + "These colors are used in a variety of widgets, such as text views and entries." + ), "variables": [ { "name": "view_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "view_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "headerbar_colors", "title": _("Header Bar Colors"), - "description": _("These colors are used for header bars, as well as widgets that are meant to be visually attached to it, such as search bars or tab bars."), + "description": _( + "These colors are used for header bars, as well as widgets that are meant to be visually attached to it, such as search bars or tab bars." + ), "variables": [ { "name": "headerbar_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "headerbar_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "headerbar_border_color", "title": _("Border Color"), - "explanation": _("The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout."), - "adw_gtk3_support": "no" + "explanation": _( + "The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout." + ), + "adw_gtk3_support": "no", }, { "name": "headerbar_backdrop_color", "title": _("Backdrop Color"), - "explanation": _("The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color."), - "adw_gtk3_support": "yes" + "explanation": _( + "The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color." + ), + "adw_gtk3_support": "yes", }, { "name": "headerbar_shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window."), - "adw_gtk3_support": "no" - } - ] + "explanation": _( + "The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window." + ), + "adw_gtk3_support": "no", + }, + ], }, { "name": "card_colors", @@ -210,20 +240,22 @@ { "name": "card_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "card_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "card_shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards."), - "adw_gtk3_support": "no" - } - ] + "explanation": _( + "The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards." + ), + "adw_gtk3_support": "no", + }, + ], }, { "name": "dialog_colors", @@ -233,14 +265,14 @@ { "name": "dialog_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "no" + "adw_gtk3_support": "no", }, { "name": "dialog_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "no" - } - ] + "adw_gtk3_support": "no", + }, + ], }, { "name": "popover_colors", @@ -250,14 +282,14 @@ { "name": "popover_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "popover_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "misc_colors", @@ -267,67 +299,32 @@ { "name": "shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders."), - "adw_gtk3_support": "no" + "explanation": _( + "The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders." + ), + "adw_gtk3_support": "no", }, { "name": "scrollbar_outline_color", "title": _("Scrollbar Outline Color"), - "explanation": _("The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color."), - "adw_gtk3_support": "no" - } - ] - } + "explanation": _( + "The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color." + ), + "adw_gtk3_support": "no", + }, + ], + }, ], "palette": [ - { - "prefix": "blue_", - "title": _("Blue"), - "n_shades": 5 - }, - { - "prefix": "green_", - "title": _("Green"), - "n_shades": 5 - }, - { - "prefix": "yellow_", - "title": _("Yellow"), - "n_shades": 5 - }, - { - "prefix": "orange_", - "title": _("Orange"), - "n_shades": 5 - }, - { - "prefix": "red_", - "title": _("Red"), - "n_shades": 5 - }, - { - "prefix": "purple_", - "title": _("Purple"), - "n_shades": 5 - }, - { - "prefix": "brown_", - "title": _("Brown"), - "n_shades": 5 - }, - { - "prefix": "light_", - "title": _("Light"), - "n_shades": 5 - }, - { - "prefix": "dark_", - "title": _("Dark"), - "n_shades": 5 - } + {"prefix": "blue_", "title": _("Blue"), "n_shades": 5}, + {"prefix": "green_", "title": _("Green"), "n_shades": 5}, + {"prefix": "yellow_", "title": _("Yellow"), "n_shades": 5}, + {"prefix": "orange_", "title": _("Orange"), "n_shades": 5}, + {"prefix": "red_", "title": _("Red"), "n_shades": 5}, + {"prefix": "purple_", "title": _("Purple"), "n_shades": 5}, + {"prefix": "brown_", "title": _("Brown"), "n_shades": 5}, + {"prefix": "light_", "title": _("Light"), "n_shades": 5}, + {"prefix": "dark_", "title": _("Dark"), "n_shades": 5}, ], - "custom_css_app_types": [ - "gtk4", - "gtk3" - ] + "custom_css_app_types": ["gtk4", "gtk3"], } diff --git a/src/window.py b/src/window.py index 1f10d3f0a..25d03cc83 100644 --- a/src/window.py +++ b/src/window.py @@ -36,9 +36,9 @@ from material_color_utilities_python import * -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui") class AdwcustomizerMainWindow(Adw.ApplicationWindow): - __gtype_name__ = 'AdwcustomizerMainWindow' + __gtype_name__ = "AdwcustomizerMainWindow" content = Gtk.Template.Child() toast_overlay = Gtk.Template.Child() @@ -54,14 +54,14 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) self.presets_dropdown.get_popover().connect( - "show", self.on_presets_dropdown_activate) + "show", self.on_presets_dropdown_activate + ) self.setup_monet_page() self.setup_plugins_page() self.setup_colors_page() - self.settings = Gio.Settings( - "com.github.AdwCustomizerTeam.AdwCustomizer") + self.settings = Gio.Settings("com.github.AdwCustomizerTeam.AdwCustomizer") self.settings.bind( "window-width", self, "default-width", Gio.SettingsBindFlags.DEFAULT @@ -93,7 +93,9 @@ def on_monet_file_chooser_response(self, widget, response): self.theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) + self.get_application().update_theme_from_monet( + self.theme, self.tone, self.monet_theme + ) def setup_monet_page(self): @@ -101,7 +103,10 @@ def setup_monet_page(self): self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) self.monet_pref_group.set_description( - _("Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow")) + _( + "Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow" + ) + ) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -111,21 +116,21 @@ def setup_monet_page(self): self.monet_file_chooser_button = Gtk.Button() self.monet_file_chooser_button.set_label(_("Choose a file")) - self.monet_file_chooser_button.set_icon_name( - "folder-pictures-symbolic") + self.monet_file_chooser_button.set_icon_name("folder-pictures-symbolic") self.monet_file_chooser_button.connect( - "clicked", self.on_file_picker_button_clicked) + "clicked", self.on_file_picker_button_clicked + ) self.monet_file_chooser_dialog.connect( - "response", self.on_monet_file_chooser_response) + "response", self.on_monet_file_chooser_response + ) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) self.monet_pref_group.add(self.monet_file_chooser_row) - self.monet_palette_shades = AdwcustomizerPaletteShades("monet", - "Monet Palette", - 6) - self.get_application( - ).pref_palette_shades["monet"] = self.monet_palette_shades + self.monet_palette_shades = AdwcustomizerPaletteShades( + "monet", "Monet Palette", 6 + ) + self.get_application().pref_palette_shades["monet"] = self.monet_palette_shades self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() @@ -168,14 +173,14 @@ def setup_colors_page(self): pref_group.set_description(group["description"]) for variable in group["variables"]: - pref_variable = AdwcustomizerOption(variable["name"], - variable["title"], - variable.get( - "explanation"), - variable["adw_gtk3_support"]) + pref_variable = AdwcustomizerOption( + variable["name"], + variable["title"], + variable.get("explanation"), + variable["adw_gtk3_support"], + ) pref_group.add(pref_variable) - self.get_application( - ).pref_variables[variable["name"]] = pref_variable + self.get_application().pref_variables[variable["name"]] = pref_variable self.content.add(pref_group) @@ -183,14 +188,16 @@ def setup_colors_page(self): palette_pref_group.set_name("palette_colors") palette_pref_group.set_title(_("Palette Colors")) palette_pref_group.set_description( - _("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) + _( + 'Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.' + ) + ) for color in settings_schema["palette"]: - palette_shades = AdwcustomizerPaletteShades(color["prefix"], - color["title"], - color["n_shades"]) + palette_shades = AdwcustomizerPaletteShades( + color["prefix"], color["title"], color["n_shades"] + ) palette_pref_group.add(palette_shades) - self.get_application( - ).pref_palette_shades[color["prefix"]] = palette_shades + self.get_application().pref_palette_shades[color["prefix"]] = palette_shades self.content.add(palette_pref_group) def update_errors(self, errors): @@ -200,8 +207,9 @@ def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) self.errors_button.set_visible(len(errors) > 0) for error in errors: - self.errors_list.append(AdwcustomizerError( - error["error"], error["element"], error["line"])) + self.errors_list.append( + AdwcustomizerError(error["error"], error["element"], error["line"]) + ) def on_presets_dropdown_activate(self, *args): self.get_application().reload_user_defined_presets() From f84080832408da0368c8ff33b488993b9e538235 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:44:51 +0200 Subject: [PATCH 132/149] add version --- meson.build | 6 +++++- src/info.py.in | 2 ++ src/main.py | 3 ++- src/meson.build | 11 +++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/info.py.in diff --git a/meson.build b/meson.build index 36f2ff2f4..e22a4fc1e 100644 --- a/meson.build +++ b/meson.build @@ -1,11 +1,15 @@ project('adwcustomizer', - version: 'git', + version: '0.1.0', meson_version: '>= 0.59.0', default_options: [ 'warning_level=2', 'werror=false', ], ) +dependency('glib-2.0') +dependency('pygobject-3.0') +dependency('libadwaita-1') + i18n = import('i18n') gnome = import('gnome') diff --git a/src/info.py.in b/src/info.py.in new file mode 100644 index 000000000..20fc34949 --- /dev/null +++ b/src/info.py.in @@ -0,0 +1,2 @@ +version = '@version@' +build_type = '@build_type@' \ No newline at end of file diff --git a/src/main.py b/src/main.py index 042eaf87b..142524a33 100644 --- a/src/main.py +++ b/src/main.py @@ -35,7 +35,7 @@ from .app_type_dialog import AdwcustomizerAppTypeDialog from .custom_css_group import AdwcustomizerCustomCSSGroup from .plugins_list import AdwcustomizerPluginsList - +from . import info def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -664,6 +664,7 @@ def show_about_window(self, *_args): Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, + version=f"{info.version}" ) about.present() diff --git a/src/meson.build b/src/meson.build index 7f45b1d13..b395392b1 100644 --- a/src/meson.build +++ b/src/meson.build @@ -40,6 +40,17 @@ configure_file( install_dir: get_option('bindir') ) +configure_file( + input: 'info.py.in', + output: '@BASENAME@', + install: true, + install_dir: python.get_install_dir() / 'adwcustomizer', + configuration: configuration_data({ + 'version': meson.project_version(), + 'build_type': get_option('buildtype'), + }), +) + adwcustomizer_sources = [ '__init__.py', 'settings_schema.py', From c775f93492d60738f4453c7f7323af2b82efabd9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:46:03 +0200 Subject: [PATCH 133/149] update meson build --- src/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index b395392b1..d3e13293a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -44,7 +44,7 @@ configure_file( input: 'info.py.in', output: '@BASENAME@', install: true, - install_dir: python.get_install_dir() / 'adwcustomizer', + install_dir: moduledir, configuration: configuration_data({ 'version': meson.project_version(), 'build_type': get_option('buildtype'), From 30ac48c58b3685a52a4b27b44d61fe2b90477094 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:47:30 +0200 Subject: [PATCH 134/149] format --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 142524a33..4849549f9 100644 --- a/src/main.py +++ b/src/main.py @@ -37,6 +37,7 @@ from .plugins_list import AdwcustomizerPluginsList from . import info + def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -664,7 +665,7 @@ def show_about_window(self, *_args): Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, - version=f"{info.version}" + version=f"{info.version}", ) about.present() From 63d59ffd66ece733b449f914eba171e4c2560345 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:51:30 +0200 Subject: [PATCH 135/149] udpate appstream metadata #77 --- ...github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index 9547dad90..86def6ddf 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -2,8 +2,11 @@ com.github.AdwCustomizerTeam.AdwCustomizer.desktop CC0-1.0 - MIT + GPL-3.0 - Change the look of Adwaita, with ease + Change the look of Adwaita, with ease - + https://github.com/AdwCustomizerTeam/AdwCustomizer/issues + https://github.com/AdwCustomizerTeam/AdwCustomizer + https://www.transifex.com/adwcustomizerteam/adwcustomizer/ + \ No newline at end of file From 6b64caccd48484c845c1c96e1f230fef629360f7 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 19:27:47 +0200 Subject: [PATCH 136/149] move menu button next to close button --- src/ui/window.blp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index 3b3abc816..da2d16a8c 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -45,11 +45,6 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } } - [end] - Gtk.MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } [end] MenuButton errors-button { @@ -58,6 +53,13 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { popover: errors-popover; } + + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + } Gtk.Box { From 2d7e04e3b7e0914df7a2bde1e2c9ffefdcafa9a5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 19:27:57 +0200 Subject: [PATCH 137/149] update appstream metadata --- data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index 86def6ddf..b6b00b08c 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -3,6 +3,8 @@ com.github.AdwCustomizerTeam.AdwCustomizer.desktop CC0-1.0 GPL-3.0 + Adwaita Manager + Change the look of Adwaita, with ease Change the look of Adwaita, with ease From 8d2facab423a51c45a07fd5debeca2b53703528f Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 20:12:34 +0200 Subject: [PATCH 138/149] switch back to main Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index 31be453cf..2bb34ef9d 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -71,7 +71,7 @@ { "type" : "git", "path" : ".", - "branch": "next" + "branch": "main" } ] } From 6405f813075861d95168c8018dba123736d029ed Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 20:13:21 +0200 Subject: [PATCH 139/149] auto instead of automatic Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 25d03cc83..2e35d7f4b 100644 --- a/src/window.py +++ b/src/window.py @@ -149,7 +149,7 @@ def setup_monet_page(self): self.monet_theme_row.set_title(_("Theme")) store = Gtk.StringList() - store.append("Automatic") + store.append("Auto") store.append("Dark") store.append("Light") self.monet_theme_row.set_model(store) From 405ad1d079e59ceaa645b28072ae6ccdd21d1f58 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:25:05 +0200 Subject: [PATCH 140/149] Update POT --- po/AdwCustomizer.pot | 229 +++++++++++++++++++++++++------------------ 1 file changed, 134 insertions(+), 95 deletions(-) diff --git a/po/AdwCustomizer.pot b/po/AdwCustomizer.pot index c45e60352..1d707805a 100644 --- a/po/AdwCustomizer.pot +++ b/po/AdwCustomizer.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-09 22:21+0300\n" +"POT-Creation-Date: 2022-08-12 11:24+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,11 +18,13 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: data/com.github.AdwCustomizerTeam.AdwCustomizer.desktop.in:3 -#: src/ui/window.blp:5 src/main.py:332 +#: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:6 +#: src/ui/window.blp:5 src/main.py:642 msgid "Adwaita Manager" msgstr "" #: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:7 +#: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:9 msgid "Change the look of Adwaita, with ease" msgstr "" @@ -70,225 +72,236 @@ msgstr "" msgid "Toggle Text Value" msgstr "" -#: src/ui/window.blp:13 src/main.py:245 +#: src/ui/window.blp:23 src/main.py:428 msgid "Apply" msgstr "" -#: src/ui/window.blp:20 -msgid "Save Preset" +#: src/ui/window.blp:35 +msgid "Presets" msgstr "" -#: src/ui/window.blp:36 -msgid "Presets" +#: src/ui/window.blp:42 +msgid "Save Preset" msgstr "" -#: src/ui/window.blp:58 +#: src/ui/window.blp:112 msgid "Built-in Presets" msgstr "" -#: src/ui/window.blp:73 +#: src/ui/window.blp:134 +msgid "Release Notes" +msgstr "" + +#: src/ui/window.blp:138 msgid "Reset Applied Color Scheme" msgstr "" -#: src/ui/window.blp:74 +#: src/ui/window.blp:142 msgid "About Adwaita Manager" msgstr "" -#: src/app_type_dialog.py:43 src/main.py:264 +#: src/app_type_dialog.py:44 src/main.py:474 msgid "Cancel" msgstr "" -#: src/main.py:123 +#: src/main.py:140 src/main.py:146 msgid "Failed to load preset" msgstr "" -#: src/main.py:139 +#: src/main.py:163 msgid "Open in File Manager" msgstr "" -#: src/main.py:142 +#: src/main.py:169 msgid "User Defined Presets" msgstr "" -#: src/main.py:203 +#: src/main.py:358 msgid "Unsaved changes" msgstr "" -#: src/main.py:243 +#: src/main.py:423 msgid "Apply this color scheme?" msgstr "" -#: src/main.py:244 +#: src/main.py:425 msgid "" "Warning: any custom CSS files for those app types will be irreversibly " "overwritten!" msgstr "" -#: src/main.py:251 +#: src/main.py:448 msgid "Reset applied color scheme?" msgstr "" -#: src/main.py:252 +#: src/main.py:449 msgid "Make sure you have the current settings saved as a preset." msgstr "" -#: src/main.py:253 +#: src/main.py:451 msgid "Reset" msgstr "" -#: src/main.py:260 +#: src/main.py:461 msgid "Save preset as..." msgstr "" -#: src/main.py:261 src/main.py:274 src/main.py:277 +#: src/main.py:463 src/main.py:487 src/main.py:501 #, python-brace-format msgid "" "Saving preset to {0}. If that preset already exists, it will be " "overwritten!" msgstr "" -#: src/main.py:265 +#: src/main.py:475 msgid "Save" msgstr "" -#: src/main.py:334 -msgid "Adwaita Manager Team" +#: src/main.py:541 +msgid "Scheme successfully saved!" msgstr "" -#. Translators: This is a place to put your credits (formats: "Name https://example.com" or "Name ", no quotes) and is not meant to be translated literally. -#: src/main.py:338 -msgid "translator-credits" +#: src/main.py:605 +msgid "Scheme set successfully!" msgstr "" -#: src/option.py:55 +#: src/main.py:637 +msgid "Reset successfully!" +msgstr "" + +#: src/main.py:644 +msgid "Adwaita Manager Team" +msgstr "" + +#: src/option.py:47 msgid "This option is only partially supported by the adw-gtk3 theme." msgstr "" -#: src/option.py:58 +#: src/option.py:52 msgid "This option is not supported by the adw-gtk3 theme." msgstr "" -#: src/option.py:97 +#: src/option.py:94 msgid "Not a color, see text value" msgstr "" -#: src/settings_schema.py:5 +#: src/settings_schema.py:23 msgid "Accent Colors" msgstr "" -#: src/settings_schema.py:6 +#: src/settings_schema.py:25 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, and entries, to indicate that a widget is important, interactive, or " "currently active." msgstr "" -#: src/settings_schema.py:10 src/settings_schema.py:33 -#: src/settings_schema.py:56 src/settings_schema.py:79 -#: src/settings_schema.py:102 +#: src/settings_schema.py:30 src/settings_schema.py:57 +#: src/settings_schema.py:84 src/settings_schema.py:111 +#: src/settings_schema.py:138 msgid "Standalone Color" msgstr "" -#: src/settings_schema.py:11 src/settings_schema.py:34 -#: src/settings_schema.py:57 src/settings_schema.py:80 -#: src/settings_schema.py:103 +#: src/settings_schema.py:32 src/settings_schema.py:59 +#: src/settings_schema.py:86 src/settings_schema.py:113 +#: src/settings_schema.py:140 msgid "" "The standalone colors are similar to the background ones, but provide better " "contrast when used as foreground color on top of a neutral background - for " "example, colorful text in a window." msgstr "" -#: src/settings_schema.py:16 src/settings_schema.py:39 -#: src/settings_schema.py:62 src/settings_schema.py:85 -#: src/settings_schema.py:108 src/settings_schema.py:125 -#: src/settings_schema.py:142 src/settings_schema.py:159 -#: src/settings_schema.py:194 src/settings_schema.py:217 -#: src/settings_schema.py:234 +#: src/settings_schema.py:38 src/settings_schema.py:65 +#: src/settings_schema.py:92 src/settings_schema.py:119 +#: src/settings_schema.py:146 src/settings_schema.py:163 +#: src/settings_schema.py:182 src/settings_schema.py:201 +#: src/settings_schema.py:242 src/settings_schema.py:267 +#: src/settings_schema.py:284 msgid "Background Color" msgstr "" -#: src/settings_schema.py:21 src/settings_schema.py:44 -#: src/settings_schema.py:67 src/settings_schema.py:90 -#: src/settings_schema.py:113 src/settings_schema.py:130 -#: src/settings_schema.py:147 src/settings_schema.py:164 -#: src/settings_schema.py:199 src/settings_schema.py:222 -#: src/settings_schema.py:239 +#: src/settings_schema.py:43 src/settings_schema.py:70 +#: src/settings_schema.py:97 src/settings_schema.py:124 +#: src/settings_schema.py:151 src/settings_schema.py:168 +#: src/settings_schema.py:187 src/settings_schema.py:206 +#: src/settings_schema.py:247 src/settings_schema.py:272 +#: src/settings_schema.py:289 msgid "Foreground Color" msgstr "" -#: src/settings_schema.py:28 +#: src/settings_schema.py:50 msgid "Destructive Colors" msgstr "" -#: src/settings_schema.py:29 +#: src/settings_schema.py:52 msgid "" "These colors are used for buttons to indicate a dangerous action, such as " "deleting a file." msgstr "" -#: src/settings_schema.py:51 +#: src/settings_schema.py:77 msgid "Success Colors" msgstr "" -#: src/settings_schema.py:52 +#: src/settings_schema.py:79 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, entries, and level bars, to indicate a success or a high level." msgstr "" -#: src/settings_schema.py:74 +#: src/settings_schema.py:104 msgid "Warning Colors" msgstr "" -#: src/settings_schema.py:75 +#: src/settings_schema.py:106 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, entries, and level bars, to indicate a warning or a low level." msgstr "" -#: src/settings_schema.py:97 +#: src/settings_schema.py:131 msgid "Error Colors" msgstr "" -#: src/settings_schema.py:98 +#: src/settings_schema.py:133 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, and entries, to indicate a failure." msgstr "" -#: src/settings_schema.py:120 +#: src/settings_schema.py:158 msgid "Window Colors" msgstr "" -#: src/settings_schema.py:121 +#: src/settings_schema.py:159 msgid "These colors are used primarily for windows." msgstr "" -#: src/settings_schema.py:137 +#: src/settings_schema.py:175 msgid "View Colors" msgstr "" -#: src/settings_schema.py:138 +#: src/settings_schema.py:177 msgid "" "These colors are used in a variety of widgets, such as text views and " "entries." msgstr "" -#: src/settings_schema.py:154 +#: src/settings_schema.py:194 msgid "Header Bar Colors" msgstr "" -#: src/settings_schema.py:155 +#: src/settings_schema.py:196 msgid "" "These colors are used for header bars, as well as widgets that are meant to " "be visually attached to it, such as search bars or tab bars." msgstr "" -#: src/settings_schema.py:169 +#: src/settings_schema.py:211 msgid "Border Color" msgstr "" -#: src/settings_schema.py:170 +#: src/settings_schema.py:213 msgid "" "The border color has the same default value as a foreground color, but " "doesn't change along with it. This can be useful if a light window has a " @@ -297,11 +310,11 @@ msgid "" "example, separators between the two header bars in a split header bar layout." msgstr "" -#: src/settings_schema.py:175 +#: src/settings_schema.py:219 msgid "Backdrop Color" msgstr "" -#: src/settings_schema.py:176 +#: src/settings_schema.py:221 msgid "" "The backdrop color is used instead of the background color when the window " "is not focused. By default it's an alias of the window's background color " @@ -309,113 +322,139 @@ msgid "" "it to a value matching your header bar background color." msgstr "" -#: src/settings_schema.py:181 src/settings_schema.py:204 -#: src/settings_schema.py:251 +#: src/settings_schema.py:227 src/settings_schema.py:252 +#: src/settings_schema.py:301 msgid "Shade Color" msgstr "" -#: src/settings_schema.py:182 +#: src/settings_schema.py:229 msgid "" "The shade color is used to provide a dark border for header bars and similar " "widgets that separates them from the main window." msgstr "" -#: src/settings_schema.py:189 +#: src/settings_schema.py:237 msgid "Card Colors" msgstr "" -#: src/settings_schema.py:190 +#: src/settings_schema.py:238 msgid "These colors are used for cards and boxed lists." msgstr "" -#: src/settings_schema.py:205 +#: src/settings_schema.py:254 msgid "" "The shade color is used for shadows that are used by cards to separate " "themselves from the window background, as well as for row dividers in the " "cards." msgstr "" -#: src/settings_schema.py:212 +#: src/settings_schema.py:262 msgid "Dialog Colors" msgstr "" -#: src/settings_schema.py:213 +#: src/settings_schema.py:263 msgid "These colors are used for message dialogs." msgstr "" -#: src/settings_schema.py:229 +#: src/settings_schema.py:279 msgid "Popover Colors" msgstr "" -#: src/settings_schema.py:230 +#: src/settings_schema.py:280 msgid "These colors are used for popovers." msgstr "" -#: src/settings_schema.py:246 +#: src/settings_schema.py:296 msgid "Miscalleneous Colors" msgstr "" -#: src/settings_schema.py:247 +#: src/settings_schema.py:297 msgid "Colors that don't fit in any particular group." msgstr "" -#: src/settings_schema.py:252 +#: src/settings_schema.py:303 msgid "" "The shade color is used by inline tab bars, as well as the transitions in " "leaflets and flaps, and info bar borders." msgstr "" -#: src/settings_schema.py:257 +#: src/settings_schema.py:309 msgid "Scrollbar Outline Color" msgstr "" -#: src/settings_schema.py:258 +#: src/settings_schema.py:311 msgid "" "The scrollbar outline color is used by scrollbars to ensure that overlay " "scrollbars are visible regardless of the content color." msgstr "" -#: src/settings_schema.py:267 +#: src/settings_schema.py:319 msgid "Blue" msgstr "" -#: src/settings_schema.py:272 +#: src/settings_schema.py:320 msgid "Green" msgstr "" -#: src/settings_schema.py:277 +#: src/settings_schema.py:321 msgid "Yellow" msgstr "" -#: src/settings_schema.py:282 +#: src/settings_schema.py:322 msgid "Orange" msgstr "" -#: src/settings_schema.py:287 +#: src/settings_schema.py:323 msgid "Red" msgstr "" -#: src/settings_schema.py:292 +#: src/settings_schema.py:324 msgid "Purple" msgstr "" -#: src/settings_schema.py:297 +#: src/settings_schema.py:325 msgid "Brown" msgstr "" -#: src/settings_schema.py:302 +#: src/settings_schema.py:326 msgid "Light" msgstr "" -#: src/settings_schema.py:307 +#: src/settings_schema.py:327 msgid "Dark" msgstr "" -#: src/window.py:70 +#: src/window.py:104 +msgid "Monet Engine" +msgstr "" + +#: src/window.py:107 +msgid "" +"Monet is an engine that generates Material Design 3 palette from backgrounds " +"color. The generation can be slow" +msgstr "" + +#: src/window.py:112 +msgid "Background Image" +msgstr "" + +#: src/window.py:118 +msgid "Choose a file" +msgstr "" + +#: src/window.py:137 +msgid "Tone" +msgstr "" + +#: src/window.py:149 +msgid "Theme" +msgstr "" + +#: src/window.py:189 msgid "Palette Colors" msgstr "" -#: src/window.py:71 +#: src/window.py:192 msgid "" "Named palette colors used by some applications. Default colors follow the GNOME Human " From deb7a6f40df1acb07f1d291f3c471dc81fa71cd5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:27:19 +0200 Subject: [PATCH 141/149] add devel flatpak --- .github/workflows/flatpak-nightly.yml | 4 +- ...AdwCustomizerTeam.AdwCustomizer.Devel.json | 82 +++++++++++++++++++ 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index fa297f23a..613457218 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -14,6 +14,6 @@ jobs: uses: actions/checkout@v3.0.2 - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 with: - bundle: com.github.AdwCustomizerTeam.AdwCustomizer.flatpak - manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.json + bundle: com.github.AdwCustomizerTeam.AdwCustomizer.Devel.flatpak + manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json cache-key: flatpak-builder-${{ github.sha }}-nightly \ No newline at end of file diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json b/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json new file mode 100644 index 000000000..31be453cf --- /dev/null +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json @@ -0,0 +1,82 @@ +{ + "app-id" : "com.github.AdwCustomizerTeam.AdwCustomizer", + "runtime" : "org.gnome.Platform", + "runtime-version" : "master", + "sdk" : "org.gnome.Sdk", + "command" : "adwcustomizer", + "finish-args" : [ + "--share=network", + "--share=ipc", + "--socket=fallback-x11", + "--device=dri", + "--socket=wayland", + "--filesystem=xdg-config/gtk-3.0", + "--filesystem=xdg-config/gtk-4.0" + ], + "cleanup" : [ + "/include", + "/lib/pkgconfig", + "/man", + "/share/doc", + "/share/gtk-doc", + "/share/man", + "/share/pkgconfig", + "*.la", + "*.a" + ], + "modules" : [ + "pypi-dependencies.json", + { + "name" : "blueprint-compiler", + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "url" : "https://gitlab.gnome.org/jwestman/blueprint-compiler", + "branch" : "main" + } + ] + }, + { + "name": "libportal", + "buildsystem": "meson", + "config-opts": ["-Ddocs=false", "-Dvapi=false", "-Dbackends=gtk4"], + "sources": [ + { + "type": "git", + "url": "https://github.com/flatpak/libportal", + "branch": "main" + } + ] + }, + { + "name": "material-color-utilities-python", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"material_color_utilities_python~=0.1.0\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "path": "./monet/material_color_utilities_python-0.1.0-py3-none-any.whl", + "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" + } + ] + }, + { + "name" : "adwcustomizer", + "builddir" : true, + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "path" : ".", + "branch": "next" + } + ] + } + ], + "build-options" : { + "env" : { } + } +} From e13af9f723333ad3b2311b4cf9393f2d2a9d37d8 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:28:57 +0200 Subject: [PATCH 142/149] update license --- po/AdwCustomizer.pot | 2 +- po/update_potfile.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/po/AdwCustomizer.pot b/po/AdwCustomizer.pot index 1d707805a..13f7a243a 100644 --- a/po/AdwCustomizer.pot +++ b/po/AdwCustomizer.pot @@ -1,6 +1,6 @@ # Adwaita Manager POT file # Copyright (C) 2022 Adwaita Manager Team -# This file is distributed under the MIT/X11 license. +# This file is distributed under the GNU GPLv3 license. # Adwaita Manager Team, 2022. # #, fuzzy diff --git a/po/update_potfile.sh b/po/update_potfile.sh index b20cc2c9e..8c9c7f35f 100755 --- a/po/update_potfile.sh +++ b/po/update_potfile.sh @@ -3,7 +3,7 @@ po_dir=$(dirname "$(realpath "$0")") xgettext -f "$po_dir"/POTFILES -o "$po_dir"/AdwCustomizer.pot --add-comments=Translators --keyword=_ --keyword=C_1c,2 --from-code=UTF-8 sed -i "s/SOME DESCRIPTIVE TITLE./Adwaita Manager POT file/" "$po_dir"/AdwCustomizer.pot sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/$(date +%Y) Adwaita Manager Team/" "$po_dir"/AdwCustomizer.pot -sed -i "s@same license as the PACKAGE package.@MIT/X11 license.@" "$po_dir"/AdwCustomizer.pot +sed -i "s@same license as the PACKAGE package.@GNU GPLv3 license.@" "$po_dir"/AdwCustomizer.pot sed -i "s/FIRST AUTHOR , YEAR./Adwaita Manager Team, $(date +%Y)./" "$po_dir"/AdwCustomizer.pot regex="$po_dir/([a-zA-Z_]*).po" From a9fe0b768dc3df47b20f63c3697a1b0e79e8efa4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:30:51 +0200 Subject: [PATCH 143/149] reverse button order --- src/ui/window.blp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index da2d16a8c..ba11eeb97 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -29,6 +29,12 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { stack: view_stack; } + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + [end] MenuButton presets-dropdown { menu-model: presets-menu; @@ -54,11 +60,6 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } - [end] - Gtk.MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } } From b23768a060e4f8cdae68493158d5342a0c17eaa4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:38:35 +0200 Subject: [PATCH 144/149] change card fg color --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 4849549f9..50f452655 100644 --- a/src/main.py +++ b/src/main.py @@ -278,7 +278,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), - "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), + "card_fg_color": self.rgba_from_argb(dark_theme.onSurface), "card_shade_color": self.rgba_from_argb(dark_theme.shadow), "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), From 36ec03fe62cfd1a38580200a8c55bdd2404a7939 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:49:29 +0200 Subject: [PATCH 145/149] update releases notes --- ...ustomizerTeam.AdwCustomizer.appdata.xml.in | 16 +++++++++ src/main.py | 34 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index b431f38a0..f75d2b327 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -104,6 +104,22 @@ First release of Adwaita Manager. + + Add AdwViewSwitcher in the header bar. + Move CSS to the "Advanced" tab + Move the rest to the "Colours" tab + Add Monet tab which generates a theme from a background + Add disk saved and disk unsaved icon in the header bar + Update about dialog + Change license to GNU GPLv3 + Begin plugin support + Move preset selector to a drop-down called palette (icon palette) + Add ability to apply the theme onlyfor dark theme or oy for light theme + Automaticly use Adwaita-dark preset if the user prefered scheme is dark. + Added Flatpak CI build + Added issue template for bug and feature request + `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch + diff --git a/src/main.py b/src/main.py index 50f452655..bed21e1f7 100644 --- a/src/main.py +++ b/src/main.py @@ -666,6 +666,40 @@ def show_about_window(self, *_args): copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, version=f"{info.version}", + release_notes=""" + + + Add AdwViewSwitcher in the header bar. + Move CSS to the "Advanced" tab + Move the rest to the "Colours" tab + Add Monet tab which generates a theme from a background + Add disk saved and disk unsaved icon in the header bar + Update about dialog + Change license to GNU GPLv3 + Begin plugin support + Move preset selector to a drop-down called palette (icon palette) + Add ability to apply the theme onlyfor dark theme or oy for light theme + Automaticly use Adwaita-dark preset if the user prefered scheme is dark. + Added Flatpak CI build + Added issue template for bug and feature request + `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch + + + """, + comments=""" + + Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. + + With Adwaita Manager you can: + + Change any color of Adwaita theme + Apply Material 3 colors from wallaper + Use other users presets + Change advanced options with CSS + Extend functionality using plugins + + This app is written in Python and uses GTK 4 and libadwaita. + """ ) about.present() From 262a690da3ab80eb3ca9bed8fff6b358ee981864 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:54:45 +0200 Subject: [PATCH 146/149] remove markup --- src/main.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index bed21e1f7..1f93c3fb5 100644 --- a/src/main.py +++ b/src/main.py @@ -667,7 +667,6 @@ def show_about_window(self, *_args): license_type=Gtk.License.GPL_3_0, version=f"{info.version}", release_notes=""" - Add AdwViewSwitcher in the header bar. Move CSS to the "Advanced" tab @@ -684,13 +683,11 @@ def show_about_window(self, *_args): Added issue template for bug and feature request `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch -
i*^ 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 sp!jKhc**ke5dMpW&Ger) Date: Thu, 11 Aug 2022 11:29:51 +0200 Subject: [PATCH 064/149] use local file --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index d162543b7..31be453cf 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -57,7 +57,7 @@ ], "sources": [ { - "type": "url", + "type": "file", "path": "./monet/material_color_utilities_python-0.1.0-py3-none-any.whl", "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" } From 4d74bc5cf92bbe1813f5b1e6e5e0e51a72558831 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 11:49:04 +0200 Subject: [PATCH 065/149] add tone row --- src/window.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 3a705f98a..11b6724fc 100644 --- a/src/window.py +++ b/src/window.py @@ -81,11 +81,16 @@ def on_file_picker_button_clicked(self, *args): def on_monet_file_chooser_response(self, widget, response): if response == Gtk.ResponseType.ACCEPT: - image_file = self.monet_file_chooser_dialog.get_file() - image_basename = image_file.get_basename() + self.monet_image_file = self.monet_file_chooser_dialog.get_file() + image_basename = self.monet_image_file.get_basename() self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() + self.monet_img = Image.open(self.monet_image_file) + self.monet_theme = themeFromImage(self.monet_img) + self.monet_palette = self.monet_theme["palette"] + self.get_application().update_theme_from_monet(self.monet_theme) + def setup_monet_page(self): @@ -126,6 +131,10 @@ def setup_monet_page(self): self.content_monet.add(monet_pref_group) + self.tone_row = Adw.ComboRow() + self.tone_row.set_title(_("Tone")) + print(dir(self.tone_row)) + def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() for app_type in settings_schema["custom_css_app_types"]: From aad88ff496f9aa86a198cc763b40fb002d9356aa Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:03:21 +0200 Subject: [PATCH 066/149] add tone row --- src/window.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 11b6724fc..19122fad4 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] - self.get_application().update_theme_from_monet(self.monet_theme) + #self.get_application().update_theme_from_monet(self.monet_theme, self.tone_row.get_selected_item()) def setup_monet_page(self): @@ -133,6 +133,22 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) + + store = Gtk.ListStore(str) + store_values = [ + "1", + "5", + "10", + "15", + "20", + "25", + "United Kingdom", + "United States of America", + "Uruguay", + ] + for v in store_values: + store.append([v]) + self.tone_row.set_list_factory(store) print(dir(self.tone_row)) def setup_plugins_page(self): From 07e22ed96ec3235362fe97b9eba18dc42d3e7607 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:04:09 +0200 Subject: [PATCH 067/149] update list factory --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 19122fad4..f84a5318a 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListStore(str) + store = Gtk.ListItemFactory(str) store_values = [ "1", "5", From e1ff0aa84875576437f24bf4eb582d27a9d37b03 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:04:34 +0200 Subject: [PATCH 068/149] fix bug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index f84a5318a..8353a828f 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListItemFactory(str) + store = Gtk.ListItemFactory() store_values = [ "1", "5", From ce2067fd00189e92983b24011ea4127c983e9300 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:05:14 +0200 Subject: [PATCH 069/149] add debug info --- src/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window.py b/src/window.py index 8353a828f..7bc102f3e 100644 --- a/src/window.py +++ b/src/window.py @@ -135,6 +135,7 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.ListItemFactory() + print(dir(store)) store_values = [ "1", "5", From 11448c487a8b9a63e843163b5332e1438e99268b Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:06:23 +0200 Subject: [PATCH 070/149] update tone row --- src/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 7bc102f3e..a99b42d00 100644 --- a/src/window.py +++ b/src/window.py @@ -147,8 +147,7 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - for v in store_values: - store.append([v]) + store.set_data(store_values) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From c81d7af57511aa01501975cab814d9d510c70e0d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:07:34 +0200 Subject: [PATCH 071/149] update tone row --- src/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index a99b42d00..0e61c581d 100644 --- a/src/window.py +++ b/src/window.py @@ -147,7 +147,8 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - store.set_data(store_values) + store.replace_qdata(store_values) + store.replace_data(store_values) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From 352ae0c33575f76f96b6c8371f7aa79153cafcef Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:09:18 +0200 Subject: [PATCH 072/149] use GtkStringList --- src/window.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/window.py b/src/window.py index 0e61c581d..b35550b53 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListItemFactory() + store = Gtk.StringList() print(dir(store)) store_values = [ "1", @@ -147,8 +147,8 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - store.replace_qdata(store_values) - store.replace_data(store_values) + for v in store_values: + store.append([v]) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From c50cb8d000238e685bab787f1ad7518763088934 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:09:42 +0200 Subject: [PATCH 073/149] fix error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b35550b53..b28bac1d1 100644 --- a/src/window.py +++ b/src/window.py @@ -148,7 +148,7 @@ def setup_monet_page(self): "Uruguay", ] for v in store_values: - store.append([v]) + store.append(v) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From 5744873bb80e64db6949e5ac5bff2e2f9a2df308 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:10:26 +0200 Subject: [PATCH 074/149] use set_model --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b28bac1d1..258025af3 100644 --- a/src/window.py +++ b/src/window.py @@ -149,7 +149,7 @@ def setup_monet_page(self): ] for v in store_values: store.append(v) - self.tone_row.set_list_factory(store) + self.tone_row.set_model(store) print(dir(self.tone_row)) def setup_plugins_page(self): From 35f78ffb9cfdbac53cd1468e2eb3ab99dc17db9c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:11:07 +0200 Subject: [PATCH 075/149] add tone row to the page --- src/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 258025af3..434c417a6 100644 --- a/src/window.py +++ b/src/window.py @@ -135,7 +135,6 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - print(dir(store)) store_values = [ "1", "5", @@ -150,7 +149,7 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - print(dir(self.tone_row)) + self.content_monet.add(self.tone_row) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From d3d5c3987e153922a51467b62499900a522b5895 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:11:47 +0200 Subject: [PATCH 076/149] update pref group --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 434c417a6..7ce2b1cf8 100644 --- a/src/window.py +++ b/src/window.py @@ -129,7 +129,6 @@ def setup_monet_page(self): self.palette_picker.add_suffix(picker) monet_pref_group.add(self.palette_picker) - self.content_monet.add(monet_pref_group) self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) @@ -149,7 +148,8 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - self.content_monet.add(self.tone_row) + monet_pref_group.add(self.tone_row) + self.content_monet.add(monet_pref_group) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From 7c50a5dc38c068761ecb9e509f6a62b7e301988e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:19:28 +0200 Subject: [PATCH 077/149] set colorpalette --- src/window.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/window.py b/src/window.py index 7ce2b1cf8..4ae21ec71 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,25 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] - #self.get_application().update_theme_from_monet(self.monet_theme, self.tone_row.get_selected_item()) + self.tone = self.tone_row.get_selected_item() + + i = 0 + """ + {'primary': , + 'secondary': , + 'tertiary': , + 'neutral': , + 'neutralVariant': , + 'error': } + """ + print(self.monet_palette) + print(self.monet_theme) + for color in self.monet_palette.values(): + i+=1 + color = color.tone(self.tone) + self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + + #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): @@ -119,7 +137,7 @@ def setup_monet_page(self): self.palette_picker.set_title(_("Monet Palette")) self.palette_picker self.palette_pickers = {} - for i in range(5): + for i in range(6): i = i+1 picker = Gtk.ColorButton() picker.set_name(str(i)) @@ -141,9 +159,7 @@ def setup_monet_page(self): "15", "20", "25", - "United Kingdom", - "United States of America", - "Uruguay", + "30" ] for v in store_values: store.append(v) From b2a5ddd77d5096076242d8cf9192f9079b8181ae Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:20:34 +0200 Subject: [PATCH 078/149] add debug --- src/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window.py b/src/window.py index 4ae21ec71..b554ae472 100644 --- a/src/window.py +++ b/src/window.py @@ -86,6 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() + dir(self.monet_img) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From 26a74fe18f7075f6733f52b76da136449ff534db Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:21:09 +0200 Subject: [PATCH 079/149] fix bug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b554ae472..fb291e46c 100644 --- a/src/window.py +++ b/src/window.py @@ -86,7 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - dir(self.monet_img) + dir(self.monet_image_file) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From f3755eb8a1dc1dc32a0820af5b3ae53cbba5a0da Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:21:48 +0200 Subject: [PATCH 080/149] print debug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index fb291e46c..de17ed356 100644 --- a/src/window.py +++ b/src/window.py @@ -86,7 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - dir(self.monet_image_file) + print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From dbff368414eb89e07e9d65a284aad21806b23ef0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:24:58 +0200 Subject: [PATCH 081/149] use path instead of g object --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index de17ed356..83dec7b83 100644 --- a/src/window.py +++ b/src/window.py @@ -87,7 +87,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() print(dir(self.monet_image_file)) - self.monet_img = Image.open(self.monet_image_file) + self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] self.tone = self.tone_row.get_selected_item() From 028bad472421942cd85ece601bfe80362dfccb8e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:25:47 +0200 Subject: [PATCH 082/149] fix typo error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 83dec7b83..4780fa299 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,7 @@ def on_monet_file_chooser_response(self, widget, response): print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) - self.monet_palette = self.monet_theme["palette"] + self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() i = 0 From d1aa1a93cd637ad3b5cdb7a573c21a5e2e459c29 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:27:07 +0200 Subject: [PATCH 083/149] convert into int --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 4780fa299..4f5d6a4c8 100644 --- a/src/window.py +++ b/src/window.py @@ -86,11 +86,11 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() + print(dir(self.tone)) i = 0 """ @@ -105,7 +105,7 @@ def on_monet_file_chooser_response(self, widget, response): print(self.monet_theme) for color in self.monet_palette.values(): i+=1 - color = color.tone(self.tone) + color = color.tone(int(self.tone)) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) From d08f4acba7bd2fa80014900ad50437f8b8b3df31 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:28:31 +0200 Subject: [PATCH 084/149] fix error --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 4f5d6a4c8..275917824 100644 --- a/src/window.py +++ b/src/window.py @@ -90,7 +90,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - print(dir(self.tone)) + print(dir(self.tone.get_string())) i = 0 """ @@ -105,7 +105,7 @@ def on_monet_file_chooser_response(self, widget, response): print(self.monet_theme) for color in self.monet_palette.values(): i+=1 - color = color.tone(int(self.tone)) + color = color.tone(int(self.tone.get_string())) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) From 20d21ba39cd6a7c521ba1004e13a1f550b1bd4f5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:29:49 +0200 Subject: [PATCH 085/149] print debug --- src/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 275917824..866929fe4 100644 --- a/src/window.py +++ b/src/window.py @@ -90,7 +90,6 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - print(dir(self.tone.get_string())) i = 0 """ @@ -106,8 +105,10 @@ def on_monet_file_chooser_response(self, widget, response): for color in self.monet_palette.values(): i+=1 color = color.tone(int(self.tone.get_string())) + print(color) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + self.palette_pickers["1"].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): From fd5e7ac4994d76520564c938527751523d7b26bb Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:38:57 +0200 Subject: [PATCH 086/149] add toast when reset --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index e94f41da8..3b2e0e9a2 100644 --- a/src/main.py +++ b/src/main.py @@ -433,6 +433,7 @@ def reset_color_scheme(self, widget, response): file.delete() except Exception: pass + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( From 071bcaf2145fbdd43adb394cd8083e9ebf43dfff Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:44:22 +0200 Subject: [PATCH 087/149] update palette --- src/window.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/window.py b/src/window.py index 866929fe4..0c2b77390 100644 --- a/src/window.py +++ b/src/window.py @@ -102,22 +102,33 @@ def on_monet_file_chooser_response(self, widget, response): """ print(self.monet_palette) print(self.monet_theme) + self.monet_pref_group.remove(self.palette_picker) + + self.palette_picker = Adw.ActionRow() + self.palette_picker.set_name("monet_palette") + self.palette_picker.set_title(_("Monet Palette")) + self.palette_picker + self.palette_pickers = {} + i = 0 for color in self.monet_palette.values(): - i+=1 + i = i+1 + picker = Gtk.ColorButton() + picker.set_name(str(i)) color = color.tone(int(self.tone.get_string())) - print(color) - self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) - - self.palette_pickers["1"].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + picker.set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + picker.set_valign(Gtk.Align.CENTER) + self.palette_pickers[str(i)] = picker + self.palette_picker.add_suffix(picker) + self.monet_pref_group.add(self.palette_picker) #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): - monet_pref_group = Adw.PreferencesGroup() - monet_pref_group.set_name("monet") - monet_pref_group.set_title(_("Monet Engine")) - monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + self.monet_pref_group = Adw.PreferencesGroup() + self.monet_pref_group.set_name("monet") + self.monet_pref_group.set_title(_("Monet Engine")) + self.monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -132,7 +143,7 @@ def setup_monet_page(self): self.monet_file_chooser_button.connect("clicked", self.on_file_picker_button_clicked ) self.monet_file_chooser_dialog.connect("response", self.on_monet_file_chooser_response ) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) - monet_pref_group.add(self.monet_file_chooser_row) + self.monet_pref_group.add(self.monet_file_chooser_row) self.palette_picker = Adw.ActionRow() self.palette_picker.set_name("monet_palette") @@ -147,7 +158,7 @@ def setup_monet_page(self): picker.set_valign(Gtk.Align.CENTER) self.palette_pickers[str(i)] = picker self.palette_picker.add_suffix(picker) - monet_pref_group.add(self.palette_picker) + self.monet_pref_group.add(self.palette_picker) self.tone_row = Adw.ComboRow() From 2257a5afeea8c505e8d005afa551eda5d0c3c41a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:45:10 +0200 Subject: [PATCH 088/149] fix bug --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 0c2b77390..07e160ed9 100644 --- a/src/window.py +++ b/src/window.py @@ -177,8 +177,8 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - monet_pref_group.add(self.tone_row) - self.content_monet.add(monet_pref_group) + self.monet_pref_group.add(self.tone_row) + self.content_monet.add(self.monet_pref_group) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From 160e46863ad81602915df718ee421f17772bca09 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:55:12 +0200 Subject: [PATCH 089/149] update tone generation --- src/main.py | 3 ++ src/window.py | 99 ++++++++++++++++----------------------------------- 2 files changed, 33 insertions(+), 69 deletions(-) diff --git a/src/main.py b/src/main.py index 3b2e0e9a2..cb961f23a 100644 --- a/src/main.py +++ b/src/main.py @@ -206,6 +206,9 @@ def load_preset_variables(self, preset): self.reload_variables() + def update_theme_from_monet(self, theme, tone): + pass + def generate_gtk_css(self, app_type): final_css = "" for key in self.variables.keys(): diff --git a/src/window.py b/src/window.py index 07e160ed9..394b64723 100644 --- a/src/window.py +++ b/src/window.py @@ -35,6 +35,7 @@ from .custom_css_group import AdwcustomizerCustomCSSGroup from material_color_utilities_python import * + @Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') class AdwcustomizerMainWindow(Adw.ApplicationWindow): __gtype_name__ = 'AdwcustomizerMainWindow' @@ -52,7 +53,8 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) - self.presets_dropdown.get_popover().connect("show", self.on_presets_dropdown_activate) + self.presets_dropdown.get_popover().connect( + "show", self.on_presets_dropdown_activate) self.setup_monet_page() self.setup_plugins_page() @@ -81,99 +83,54 @@ def on_file_picker_button_clicked(self, *args): def on_monet_file_chooser_response(self, widget, response): if response == Gtk.ResponseType.ACCEPT: - self.monet_image_file = self.monet_file_chooser_dialog.get_file() + self.monet_image_file = self.monet_file_chooser_dialog.get_file() image_basename = self.monet_image_file.get_basename() self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) - self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - - i = 0 - """ - {'primary': , - 'secondary': , - 'tertiary': , - 'neutral': , - 'neutralVariant': , - 'error': } - """ - print(self.monet_palette) - print(self.monet_theme) - self.monet_pref_group.remove(self.palette_picker) - - self.palette_picker = Adw.ActionRow() - self.palette_picker.set_name("monet_palette") - self.palette_picker.set_title(_("Monet Palette")) - self.palette_picker - self.palette_pickers = {} - i = 0 - for color in self.monet_palette.values(): - i = i+1 - picker = Gtk.ColorButton() - picker.set_name(str(i)) - color = color.tone(int(self.tone.get_string())) - picker.set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) - picker.set_valign(Gtk.Align.CENTER) - self.palette_pickers[str(i)] = picker - self.palette_picker.add_suffix(picker) - self.monet_pref_group.add(self.palette_picker) - #self.get_application().update_theme_from_monet(self.monet_theme) + self.get_application().update_theme_from_monet(self.monet_theme, self.tone) def setup_monet_page(self): - self.monet_pref_group = Adw.PreferencesGroup() self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) - self.monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + self.monet_pref_group.set_description( + _("Monet is an engine that generates Material Design 3 palette from backgrounds color")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) - + self.monet_file_chooser_dialog = Gtk.FileChooserNative() self.monet_file_chooser_dialog.set_transient_for(self) self.monet_file_chooser_button = Gtk.Button() self.monet_file_chooser_button.set_label(_("Choose a file")) - self.monet_file_chooser_button.set_icon_name("folder-pictures-symbolic") + self.monet_file_chooser_button.set_icon_name( + "folder-pictures-symbolic") - self.monet_file_chooser_button.connect("clicked", self.on_file_picker_button_clicked ) - self.monet_file_chooser_dialog.connect("response", self.on_monet_file_chooser_response ) + self.monet_file_chooser_button.connect( + "clicked", self.on_file_picker_button_clicked) + self.monet_file_chooser_dialog.connect( + "response", self.on_monet_file_chooser_response) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) self.monet_pref_group.add(self.monet_file_chooser_row) - self.palette_picker = Adw.ActionRow() - self.palette_picker.set_name("monet_palette") - self.palette_picker.set_title(_("Monet Palette")) - self.palette_picker - self.palette_pickers = {} - for i in range(6): - i = i+1 - picker = Gtk.ColorButton() - picker.set_name(str(i)) - picker.set_rgba(Gdk.RGBA(red=0, green=0, blue=0, alpha=0)) - picker.set_valign(Gtk.Align.CENTER) - self.palette_pickers[str(i)] = picker - self.palette_picker.add_suffix(picker) + self.monet_palette_shades = AdwcustomizerPaletteShades("monet", + "Monet Palette", + 6) self.monet_pref_group.add(self.palette_picker) - self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - store_values = [ - "1", - "5", - "10", - "15", - "20", - "25", - "30" - ] + store_values = ["1"] + for i in range(5, 100, 5): + store_values.append(str(i)) for v in store_values: store.append(v) self.tone_row.set_model(store) @@ -198,26 +155,29 @@ def setup_colors_page(self): for variable in group["variables"]: pref_variable = AdwcustomizerOption(variable["name"], variable["title"], - variable.get("explanation"), + variable.get( + "explanation"), variable["adw_gtk3_support"]) pref_group.add(pref_variable) - self.get_application().pref_variables[variable["name"]] = pref_variable + self.get_application( + ).pref_variables[variable["name"]] = pref_variable self.content.add(pref_group) palette_pref_group = Adw.PreferencesGroup() palette_pref_group.set_name("palette_colors") palette_pref_group.set_title(_("Palette Colors")) - palette_pref_group.set_description(_("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) + palette_pref_group.set_description( + _("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) for color in settings_schema["palette"]: palette_shades = AdwcustomizerPaletteShades(color["prefix"], color["title"], color["n_shades"]) palette_pref_group.add(palette_shades) - self.get_application().pref_palette_shades[color["prefix"]] = palette_shades + self.get_application( + ).pref_palette_shades[color["prefix"]] = palette_shades self.content.add(palette_pref_group) - def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) while child is not None: @@ -225,7 +185,8 @@ def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) self.errors_button.set_visible(len(errors) > 0) for error in errors: - self.errors_list.append(AdwcustomizerError(error["error"], error["element"], error["line"])) + self.errors_list.append(AdwcustomizerError( + error["error"], error["element"], error["line"])) def on_presets_dropdown_activate(self, *args): self.get_application().reload_user_defined_presets() From 5d6f4697e512f1016f194709edbd054e00694e87 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:55:49 +0200 Subject: [PATCH 090/149] fix error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 394b64723..67ca2771b 100644 --- a/src/window.py +++ b/src/window.py @@ -122,7 +122,7 @@ def setup_monet_page(self): self.monet_palette_shades = AdwcustomizerPaletteShades("monet", "Monet Palette", 6) - self.monet_pref_group.add(self.palette_picker) + self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) From 93f07e1ff673d3c187ddc776cc3fef445807cd58 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:57:29 +0200 Subject: [PATCH 091/149] add 0xMRTT as translator --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index cb961f23a..a8671c20e 100644 --- a/src/main.py +++ b/src/main.py @@ -449,8 +449,8 @@ def show_about_window(self, *_args): issue_url="https://github.com/AdwCustomizerTeam/AdwCustomizer/issues", developers=[ 'Artyom "ArtyIF" Fomin https://github.com/ArtyIF', - "Verantor https://github.com/Verantor", "0xMRTT https://github.com/0xMRTT", + "Verantor https://github.com/Verantor", ], artists=[ 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' @@ -466,6 +466,7 @@ def show_about_window(self, *_args): Renato Corrêa https://www.transifex.com/user/profile/renatocrrs/ Aggelos Tselios https://www.transifex.com/user/profile/AndroGR/ David "Daudix UFO" Lapshin https://github.com/daudix-UFO' + 0xMRTT https://github.com/0xMRTT Juanjo Cillero https://www.transifex.com/user/profile/renux918/ Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", From f390b01cda4ac7e39caccb1433dcca37a8dc9ec4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 13:02:13 +0200 Subject: [PATCH 092/149] remove PR --- .github/workflows/flatpak-nightly.yml | 1 - .github/workflows/flatpak.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index e05befe07..fa297f23a 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -2,7 +2,6 @@ name: Build flatpak nightly on: push: branches: [next] - pull_request: jobs: flatpak: name: "Flatpak" diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 8d1b02d48..69360a41c 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -2,7 +2,6 @@ name: Build flatpak on: push: branches: [main] - pull_request: jobs: flatpak: name: "Flatpak" From 9aae287cb07333be89d0374f74bed067f8a56366 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:22:08 +0200 Subject: [PATCH 093/149] use palette shades --- src/main.py | 11 ++++++++++- src/window.py | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a8671c20e..f4c360cdd 100644 --- a/src/main.py +++ b/src/main.py @@ -26,6 +26,7 @@ import gi from gi.repository import Gtk, Gdk, Gio, Adw, GLib, Xdp, XdpGtk4 +from material_color_utilities_python import * from .settings_schema import settings_schema from .window import AdwcustomizerMainWindow @@ -207,7 +208,15 @@ def load_preset_variables(self, preset): self.reload_variables() def update_theme_from_monet(self, theme, tone): - pass + palettes = theme["palettes"] + + palette = {} + i = 0 + for color in palettes.values(): + i += 1 + palette[str(i)] = hexFromArgb(color.tone(tone)) + + self.pref_palette_shades["monet"].update_shades() def generate_gtk_css(self, app_type): final_css = "" diff --git a/src/window.py b/src/window.py index 67ca2771b..b92e6eeed 100644 --- a/src/window.py +++ b/src/window.py @@ -122,6 +122,8 @@ def setup_monet_page(self): self.monet_palette_shades = AdwcustomizerPaletteShades("monet", "Monet Palette", 6) + self.get_application( + ).pref_palette_shades["monet"] = self.monet_palette_shades self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() From 91d7e5f7bb578df08e07bcb1e326e332b8a108bc Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:23:31 +0200 Subject: [PATCH 094/149] fix error --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index f4c360cdd..274dae147 100644 --- a/src/main.py +++ b/src/main.py @@ -214,7 +214,7 @@ def update_theme_from_monet(self, theme, tone): i = 0 for color in palettes.values(): i += 1 - palette[str(i)] = hexFromArgb(color.tone(tone)) + palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) self.pref_palette_shades["monet"].update_shades() From c98f8df6101f5fad3639dc9f3423073d85837eac Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:24:16 +0200 Subject: [PATCH 095/149] add missin arg --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 274dae147..fbaf678a4 100644 --- a/src/main.py +++ b/src/main.py @@ -216,7 +216,7 @@ def update_theme_from_monet(self, theme, tone): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) - self.pref_palette_shades["monet"].update_shades() + self.pref_palette_shades["monet"].update_shades(palette) def generate_gtk_css(self, app_type): final_css = "" From 3ad2ebc2586d394dcb40e421a4270512f7f36226 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:25:48 +0200 Subject: [PATCH 096/149] add debug --- src/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.py b/src/main.py index fbaf678a4..ff7dceddf 100644 --- a/src/main.py +++ b/src/main.py @@ -216,6 +216,8 @@ def update_theme_from_monet(self, theme, tone): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) + print(palette) + self.pref_palette_shades["monet"].update_shades(palette) def generate_gtk_css(self, app_type): From b26d9a8df76e83ad27f41280a857f60f40273644 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:45:45 +0200 Subject: [PATCH 097/149] remove tone 1 --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b92e6eeed..efc166bea 100644 --- a/src/window.py +++ b/src/window.py @@ -130,7 +130,7 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - store_values = ["1"] + store_values = [] for i in range(5, 100, 5): store_values.append(str(i)) for v in store_values: From d5bce25c1e699e947049bfa4af0c4e1159fa006d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:55:00 +0200 Subject: [PATCH 098/149] add theme row --- src/window.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/window.py b/src/window.py index efc166bea..5bfb54f19 100644 --- a/src/window.py +++ b/src/window.py @@ -137,6 +137,16 @@ def setup_monet_page(self): store.append(v) self.tone_row.set_model(store) self.monet_pref_group.add(self.tone_row) + + self.monet_theme_row = Adw.ComboRow() + self.monet_theme_row.set_title(_("Theme")) + + store = Gtk.StringList() + store.append("Dark") + store.append("Light") + self.monet_theme_row.set_model(store) + self.monet_pref_group.add(self.monet_theme_row) + self.content_monet.add(self.monet_pref_group) def setup_plugins_page(self): From e2c9b1717836ff21233cecb7e7b102fedc181f08 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:00:07 +0200 Subject: [PATCH 099/149] add monet theme selector --- src/main.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++- src/window.py | 3 ++- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index ff7dceddf..a37cd3993 100644 --- a/src/main.py +++ b/src/main.py @@ -207,9 +207,11 @@ def load_preset_variables(self, preset): self.reload_variables() - def update_theme_from_monet(self, theme, tone): + def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] + monet_theme = monet_theme.get_string() + palette = {} i = 0 for color in palettes.values(): @@ -220,6 +222,56 @@ def update_theme_from_monet(self, theme, tone): self.pref_palette_shades["monet"].update_shades(palette) + print(theme) + + self.variable = { + "accent_color": theme["schemes"]["light"]["primary"], + "accent_bg_color": theme["schemes"]["light"]["primaryContainer"], + "accent_fg_color": theme["schemes"]["light"]["onPrimaryContainer"], + + "destructive_color": theme["schemes"]["light"][""], + "destructive_bg_color": theme["schemes"]["light"][""], + "destructive_fg_color": theme["schemes"]["light"][""], + + "success_color": theme["schemes"]["light"][""], + "success_bg_color": theme["schemes"]["light"][""], + "success_fg_color": theme["schemes"]["light"][""], + + "warning_color": theme["schemes"]["light"][""], + "warning_bg_color": theme["schemes"]["light"][""], + "warning_fg_color": "rgba(0, 0, 0, 0.8)", + + "error_color": theme["schemes"]["light"][""], + "error_bg_color": theme["schemes"]["light"][""], + "error_fg_color": theme["schemes"]["light"][""], + + "window_bg_color": theme["schemes"]["light"][""], + "window_fg_color": theme["schemes"]["light"][""], + + "view_bg_color": theme["schemes"]["light"][""], + "view_fg_color": theme["schemes"]["light"][""], + + "headerbar_bg_color": theme["schemes"]["light"][""], + "headerbar_fg_color": "rgba(0, 0, 0, 0.8)", + "headerbar_border_color": "rgba(0, 0, 0, 0.8)", + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": "rgba(0, 0, 0, 0.07)", + + "card_bg_color": theme["schemes"]["light"][""], + "card_fg_color": "rgba(0, 0, 0, 0.8)", + "card_shade_color": "rgba(0, 0, 0, 0.07)", + + "dialog_bg_color": theme["schemes"]["light"][""], + "dialog_fg_color": "rgba(0, 0, 0, 0.8)", + + "popover_bg_color": theme["schemes"]["light"][""], + "popover_fg_color": "rgba(0, 0, 0, 0.8)", + + "shade_color": theme["schemes"]["light"][""], + "scrollbar_outline_color": theme["schemes"]["light"][""] + } + + def generate_gtk_css(self, app_type): final_css = "" for key in self.variables.keys(): diff --git a/src/window.py b/src/window.py index 5bfb54f19..d38272320 100644 --- a/src/window.py +++ b/src/window.py @@ -91,7 +91,8 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() - self.get_application().update_theme_from_monet(self.monet_theme, self.tone) + self.monet_theme = self.monet_theme_row.get_selected_item() + self.get_application().update_theme_from_monet(self.monet_theme, self.tone, self.monet_theme) def setup_monet_page(self): From d2bde49e06d23a38d29d181bd8d80c38e56e9f68 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:00:33 +0200 Subject: [PATCH 100/149] add debug info --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index a37cd3993..c0d609958 100644 --- a/src/main.py +++ b/src/main.py @@ -222,6 +222,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): self.pref_palette_shades["monet"].update_shades(palette) + print(monet_theme) print(theme) self.variable = { From 47c4218523062b457958d1a3048eca133d6084fa Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:03:57 +0200 Subject: [PATCH 101/149] fix duplicated name --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index d38272320..08e14604d 100644 --- a/src/window.py +++ b/src/window.py @@ -89,10 +89,10 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() self.monet_img = Image.open(self.monet_image_file.get_path()) - self.monet_theme = themeFromImage(self.monet_img) + self.theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.monet_theme, self.tone, self.monet_theme) + self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) def setup_monet_page(self): From f5f8580b2e1a5ba31ea2dc6079ff7dcc1a498705 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:39:31 +0200 Subject: [PATCH 102/149] add automatic theme generation. Need test --- src/main.py | 137 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 101 insertions(+), 36 deletions(-) diff --git a/src/main.py b/src/main.py index c0d609958..314d21aeb 100644 --- a/src/main.py +++ b/src/main.py @@ -207,10 +207,22 @@ def load_preset_variables(self, preset): self.reload_variables() + + def rgba_from_argb(self, argb, alpha = None) -> str: + base = "rgba({}, {}, {}, {})" + + red = redFromArgb(argb) + green = greenFromArgb(argb) + blue = blueFromArgb(argb) + if not alpha: + alpha = alphaFromArgb(argb) + + return base.format(red, green, blue, alpha) + def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] - monet_theme = monet_theme.get_string() + monet_theme = monet_theme.get_string().lower() # dark / light palette = {} i = 0 @@ -225,53 +237,106 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(monet_theme) print(theme) - self.variable = { - "accent_color": theme["schemes"]["light"]["primary"], - "accent_bg_color": theme["schemes"]["light"]["primaryContainer"], - "accent_fg_color": theme["schemes"]["light"]["onPrimaryContainer"], + if monet_theme == "dark": + dark_theme = theme["schemes"]["dark"].toJSON() + self.variable = { + "accent_color": dark_theme["primary"], + "accent_bg_color": dark_theme["primaryContainer"], + "accent_fg_color": dark_theme["onPrimaryContainer"], + + "destructive_color": dark_theme["error"], + "destructive_bg_color": dark_theme["errorContainer"], + "destructive_fg_color": dark_theme["onError"], + + "success_color": dark_theme["tertiary"], + "success_bg_color": dark_theme["onTertiary"], + "success_fg_color": dark_theme["tertiaryContainer"], + + "warning_color": dark_theme["secondaryContainer"], + "warning_bg_color": dark_theme["inversePrimary"], + "warning_fg_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + + "error_color": dark_theme["error"], + "error_bg_color": dark_theme["errorContainer"], + "error_fg_color": dark_theme["onError"], + + "window_bg_color": dark_theme["surface"], + "window_fg_color": dark_theme["onSurface"], - "destructive_color": theme["schemes"]["light"][""], - "destructive_bg_color": theme["schemes"]["light"][""], - "destructive_fg_color": theme["schemes"]["light"][""], + "view_bg_color": dark_theme["surface"], + "view_fg_color": dark_theme["onSurface"], - "success_color": theme["schemes"]["light"][""], - "success_bg_color": theme["schemes"]["light"][""], - "success_fg_color": theme["schemes"]["light"][""], + "headerbar_bg_color": dark_theme["surface"], + "headerbar_fg_color": dark_theme["onSurface"], + "headerbar_border_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": dark_theme["shadow"], - "warning_color": theme["schemes"]["light"][""], - "warning_bg_color": theme["schemes"]["light"][""], - "warning_fg_color": "rgba(0, 0, 0, 0.8)", + "card_bg_color": self.rgba_from_argb(dark_theme["primary"], "0.05"), + "card_fg_color": dark_theme["surfaceVariant"], + "card_shade_color": dark_theme["shadow"], - "error_color": theme["schemes"]["light"][""], - "error_bg_color": theme["schemes"]["light"][""], - "error_fg_color": theme["schemes"]["light"][""], + "dialog_bg_color": dark_theme["secondaryContainer"], + "dialog_fg_color": dark_theme["onSecondaryContainer"], - "window_bg_color": theme["schemes"]["light"][""], - "window_fg_color": theme["schemes"]["light"][""], + "popover_bg_color": dark_theme["secondaryContainer"], + "popover_fg_color": dark_theme["onSecondaryContainer"], - "view_bg_color": theme["schemes"]["light"][""], - "view_fg_color": theme["schemes"]["light"][""], + "shade_color": dark_theme["shadow"], + "scrollbar_outline_color": dark_theme["outline"] + } + else: # light + light_theme = theme["schemes"]["light"].toJSON() + self.variable = { + "accent_color": light_theme["primary"], + "accent_bg_color": light_theme["primaryContainer"], + "accent_fg_color": light_theme["onPrimaryContainer"], - "headerbar_bg_color": theme["schemes"]["light"][""], - "headerbar_fg_color": "rgba(0, 0, 0, 0.8)", - "headerbar_border_color": "rgba(0, 0, 0, 0.8)", - "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": "rgba(0, 0, 0, 0.07)", + "destructive_color": light_theme["error"], + "destructive_bg_color": light_theme["errorContainer"], + "destructive_fg_color": light_theme["onError"], - "card_bg_color": theme["schemes"]["light"][""], - "card_fg_color": "rgba(0, 0, 0, 0.8)", - "card_shade_color": "rgba(0, 0, 0, 0.07)", + "success_color": light_theme["tertiary"], + "success_bg_color": light_theme["onTertiary"], + "success_fg_color": light_theme["tertiaryContainer"], - "dialog_bg_color": theme["schemes"]["light"][""], - "dialog_fg_color": "rgba(0, 0, 0, 0.8)", + "warning_color": light_theme["secondaryContainer"], + "warning_bg_color": light_theme["inversePrimary"], + "warning_fg_color": self.rgba_from_argb(light_theme["primary"], "0.8"), - "popover_bg_color": theme["schemes"]["light"][""], - "popover_fg_color": "rgba(0, 0, 0, 0.8)", + "error_color": light_theme["error"], + "error_bg_color": light_theme["errorContainer"], + "error_fg_color": light_theme["onError"], - "shade_color": theme["schemes"]["light"][""], - "scrollbar_outline_color": theme["schemes"]["light"][""] - } + "window_bg_color": light_theme["surface"], + "window_fg_color": light_theme["onSurface"], + "view_bg_color": light_theme["surface"], + "view_fg_color": light_theme["onSurface"], + + "headerbar_bg_color": light_theme["surface"], + "headerbar_fg_color": light_theme["onSurface"], + "headerbar_border_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": light_theme["shadow"], + + "card_bg_color": self.rgba_from_argb(light_theme["primary"], "0.05"), + "card_fg_color": light_theme["surfaceVariant"], + "card_shade_color": light_theme["shadow"], + + "dialog_bg_color": light_theme["secondaryContainer"], + "dialog_fg_color": light_theme["onSecondaryContainer"], + + "popover_bg_color": light_theme["secondaryContainer"], + "popover_fg_color": light_theme["onSecondaryContainer"], + + "shade_color": light_theme["shadow"], + "scrollbar_outline_color": light_theme["outline"] + } + + for key in self.variables.keys(): + if key in self.pref_variables: + self.pref_variables[key].update_value(self.variables[key]) def generate_gtk_css(self, app_type): final_css = "" From eb52f52fbb6c7fe4dc92771af839a39776c0e840 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:41:46 +0200 Subject: [PATCH 103/149] fix error --- src/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 314d21aeb..9e08e3b0d 100644 --- a/src/main.py +++ b/src/main.py @@ -239,7 +239,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"].toJSON() - self.variable = { + variable = { "accent_color": dark_theme["primary"], "accent_bg_color": dark_theme["primaryContainer"], "accent_fg_color": dark_theme["onPrimaryContainer"], @@ -287,7 +287,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): } else: # light light_theme = theme["schemes"]["light"].toJSON() - self.variable = { + variable = { "accent_color": light_theme["primary"], "accent_bg_color": light_theme["primaryContainer"], "accent_fg_color": light_theme["onPrimaryContainer"], @@ -334,9 +334,9 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "scrollbar_outline_color": light_theme["outline"] } - for key in self.variables.keys(): + for key in variables.keys(): if key in self.pref_variables: - self.pref_variables[key].update_value(self.variables[key]) + self.pref_variables[key].update_value(variables[key]) def generate_gtk_css(self, app_type): final_css = "" From 8c25c94e9545968462508b63e50772cff267050c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:44:12 +0200 Subject: [PATCH 104/149] add reload --- src/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.py b/src/main.py index 9e08e3b0d..0dab116bd 100644 --- a/src/main.py +++ b/src/main.py @@ -337,6 +337,8 @@ def update_theme_from_monet(self, theme, tone, monet_theme): for key in variables.keys(): if key in self.pref_variables: self.pref_variables[key].update_value(variables[key]) + + self.reload_variables() def generate_gtk_css(self, app_type): final_css = "" From aada5ae201fd69e6ec9a7e8458eda551b912f6f0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:46:00 +0200 Subject: [PATCH 105/149] add conditon --- src/window.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/window.py b/src/window.py index 08e14604d..205942adc 100644 --- a/src/window.py +++ b/src/window.py @@ -88,11 +88,12 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - self.monet_img = Image.open(self.monet_image_file.get_path()) - self.theme = themeFromImage(self.monet_img) - self.tone = self.tone_row.get_selected_item() - self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) + if response == Gtk.ResponseType.ACCEPT: + self.monet_img = Image.open(self.monet_image_file.get_path()) + self.theme = themeFromImage(self.monet_img) + self.tone = self.tone_row.get_selected_item() + self.monet_theme = self.monet_theme_row.get_selected_item() + self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) def setup_monet_page(self): From df673661572dccafe6ee7d0aad165b7e7905d29c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:57:41 +0200 Subject: [PATCH 106/149] fix error --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 0dab116bd..4089c2bb2 100644 --- a/src/main.py +++ b/src/main.py @@ -240,7 +240,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"].toJSON() variable = { - "accent_color": dark_theme["primary"], + "accent_color": dark_theme.primary, "accent_bg_color": dark_theme["primaryContainer"], "accent_fg_color": dark_theme["onPrimaryContainer"], @@ -334,9 +334,9 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "scrollbar_outline_color": light_theme["outline"] } - for key in variables.keys(): + for key in variable.keys(): if key in self.pref_variables: - self.pref_variables[key].update_value(variables[key]) + self.pref_variables[key].update_value(variable[key]) self.reload_variables() From 686035177b84911702658937f9e43bcbee7e2173 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:58:53 +0200 Subject: [PATCH 107/149] fix bug --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 4089c2bb2..a8870f66b 100644 --- a/src/main.py +++ b/src/main.py @@ -238,11 +238,11 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(theme) if monet_theme == "dark": - dark_theme = theme["schemes"]["dark"].toJSON() + dark_theme = theme["schemes"]["dark"] variable = { "accent_color": dark_theme.primary, - "accent_bg_color": dark_theme["primaryContainer"], - "accent_fg_color": dark_theme["onPrimaryContainer"], + "accent_bg_color": dark_theme.primaryContainer, + "accent_fg_color": dark_theme.onPrimaryContainer, "destructive_color": dark_theme["error"], "destructive_bg_color": dark_theme["errorContainer"], From a4f48a11b44b4d988423015097f967923932c390 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:03:34 +0200 Subject: [PATCH 108/149] update dark sheme --- src/main.py | 60 ++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/main.py b/src/main.py index a8870f66b..143e5d934 100644 --- a/src/main.py +++ b/src/main.py @@ -244,49 +244,49 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_bg_color": dark_theme.primaryContainer, "accent_fg_color": dark_theme.onPrimaryContainer, - "destructive_color": dark_theme["error"], - "destructive_bg_color": dark_theme["errorContainer"], - "destructive_fg_color": dark_theme["onError"], + "destructive_color": dark_theme.error, + "destructive_bg_color": dark_theme.errorContainer, + "destructive_fg_color": dark_theme.onError, - "success_color": dark_theme["tertiary"], - "success_bg_color": dark_theme["onTertiary"], - "success_fg_color": dark_theme["tertiaryContainer"], + "success_color": dark_theme.tertiary, + "success_bg_color": dark_theme.onTertiary, + "success_fg_color": dark_theme.tertiaryContainer, - "warning_color": dark_theme["secondaryContainer"], - "warning_bg_color": dark_theme["inversePrimary"], - "warning_fg_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "warning_color": dark_theme.secondaryContainer, + "warning_bg_color": dark_theme.inversePrimary, + "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": dark_theme["error"], - "error_bg_color": dark_theme["errorContainer"], - "error_fg_color": dark_theme["onError"], + "error_color": dark_theme.error, + "error_bg_color": dark_theme.errorContainer, + "error_fg_color": dark_theme.onError, - "window_bg_color": dark_theme["surface"], - "window_fg_color": dark_theme["onSurface"], + "window_bg_color": dark_theme.surface, + "window_fg_color": dark_theme.onSurface, - "view_bg_color": dark_theme["surface"], - "view_fg_color": dark_theme["onSurface"], + "view_bg_color": dark_theme.surface, + "view_fg_color": dark_theme.onSurface, - "headerbar_bg_color": dark_theme["surface"], - "headerbar_fg_color": dark_theme["onSurface"], - "headerbar_border_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "headerbar_bg_color": dark_theme.surface, + "headerbar_fg_color": dark_theme.onSurface, + "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": dark_theme["shadow"], + "headerbar_shade_color": dark_theme.shadow, - "card_bg_color": self.rgba_from_argb(dark_theme["primary"], "0.05"), - "card_fg_color": dark_theme["surfaceVariant"], - "card_shade_color": dark_theme["shadow"], + "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), + "card_fg_color": dark_theme.surfaceVariant, + "card_shade_color": dark_theme.shadow, - "dialog_bg_color": dark_theme["secondaryContainer"], - "dialog_fg_color": dark_theme["onSecondaryContainer"], + "dialog_bg_color": dark_theme.secondaryContainer, + "dialog_fg_color": dark_theme.onSecondaryContainer, - "popover_bg_color": dark_theme["secondaryContainer"], - "popover_fg_color": dark_theme["onSecondaryContainer"], + "popover_bg_color": dark_theme.secondaryContainer, + "popover_fg_color": dark_theme.onSecondaryContainer, - "shade_color": dark_theme["shadow"], - "scrollbar_outline_color": dark_theme["outline"] + "shade_color": dark_theme.shadow, + "scrollbar_outline_color": dark_theme.outline } else: # light - light_theme = theme["schemes"]["light"].toJSON() + light_theme = theme["schemes"]["light"] variable = { "accent_color": light_theme["primary"], "accent_bg_color": light_theme["primaryContainer"], From 2382062177dc2b6be2ec8508a9adac34753d51c0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:06:55 +0200 Subject: [PATCH 109/149] convert to rgba --- src/main.py | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/main.py b/src/main.py index 143e5d934..c7231e161 100644 --- a/src/main.py +++ b/src/main.py @@ -240,50 +240,50 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"] variable = { - "accent_color": dark_theme.primary, - "accent_bg_color": dark_theme.primaryContainer, - "accent_fg_color": dark_theme.onPrimaryContainer, + "accent_color": self.rgba_from_argb(dark_theme.primary), + "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), + "accent_fg_color": self.rgba_from_argb(dark_theme.onPrimaryContainer), - "destructive_color": dark_theme.error, - "destructive_bg_color": dark_theme.errorContainer, - "destructive_fg_color": dark_theme.onError, + "destructive_color": self.rgba_from_argb(dark_theme.error), + "destructive_bg_color": self.rgba_from_argb(dark_theme.errorContainer), + "destructive_fg_color": self.rgba_from_argb(dark_theme.onError), - "success_color": dark_theme.tertiary, - "success_bg_color": dark_theme.onTertiary, - "success_fg_color": dark_theme.tertiaryContainer, + "success_color": self.rgba_from_argb(dark_theme.tertiary), + "success_bg_color": self.rgba_from_argb(dark_theme.onTertiary), + "success_fg_color": self.rgba_from_argb(dark_theme.tertiaryContainer), - "warning_color": dark_theme.secondaryContainer, - "warning_bg_color": dark_theme.inversePrimary, + "warning_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "warning_bg_color": self.rgba_from_argb(dark_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": dark_theme.error, - "error_bg_color": dark_theme.errorContainer, - "error_fg_color": dark_theme.onError, + "error_color": self.rgba_from_argb(dark_theme.error), + "error_bg_color": self.rgba_from_argb(dark_theme.errorContainer), + "error_fg_color": self.rgba_from_argb(dark_theme.onError), - "window_bg_color": dark_theme.surface, - "window_fg_color": dark_theme.onSurface, + "window_bg_color": self.rgba_from_argb(dark_theme.surface), + "window_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "view_bg_color": dark_theme.surface, - "view_fg_color": dark_theme.onSurface, + "view_bg_color": self.rgba_from_argb(dark_theme.surface), + "view_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_bg_color": dark_theme.surface, - "headerbar_fg_color": dark_theme.onSurface, + "headerbar_bg_color": self.rgba_from_argb(dark_theme.surface), + "headerbar_fg_color": self.rgba_from_argb(dark_theme.onSurface), "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": dark_theme.shadow, + "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), - "card_fg_color": dark_theme.surfaceVariant, - "card_shade_color": dark_theme.shadow, + "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), + "card_shade_color": self.rgba_from_argb(dark_theme.shadow), - "dialog_bg_color": dark_theme.secondaryContainer, - "dialog_fg_color": dark_theme.onSecondaryContainer, + "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "popover_bg_color": dark_theme.secondaryContainer, - "popover_fg_color": dark_theme.onSecondaryContainer, + "popover_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "popover_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "shade_color": dark_theme.shadow, - "scrollbar_outline_color": dark_theme.outline + "shade_color": self.rgba_from_argb(dark_theme.shadow), + "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) } else: # light light_theme = theme["schemes"]["light"] From 1b12e486244c38b0a0d14f59cd01be66825e4cd0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:17:35 +0200 Subject: [PATCH 110/149] update tones --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 205942adc..e5f413426 100644 --- a/src/window.py +++ b/src/window.py @@ -101,7 +101,7 @@ def setup_monet_page(self): self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) self.monet_pref_group.set_description( - _("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + _("Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -133,7 +133,7 @@ def setup_monet_page(self): store = Gtk.StringList() store_values = [] - for i in range(5, 100, 5): + for i in range(20, 80, 5): store_values.append(str(i)) for v in store_values: store.append(v) From 0324b9575947bacabbf1099c2107cd3e5491dc08 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:22:34 +0200 Subject: [PATCH 111/149] add automatic preset load --- src/main.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index c7231e161..92fa90dd4 100644 --- a/src/main.py +++ b/src/main.py @@ -96,9 +96,17 @@ def do_activate(self): self.create_action("about", self.show_about_window) self.reload_user_defined_presets() - self.load_preset_from_resource( - "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita.json" - ) + + self.style_manager = Adw.StyleManager.get_default() + + if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: + self.load_preset_from_resource( + "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" + ) + else: + self.load_preset_from_resource( + "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita.json" + ) self.win.present() From f996aeeaccec757a7cca2cadf3826a373f770b92 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:23:08 +0200 Subject: [PATCH 112/149] add debug --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index 92fa90dd4..3a430c01d 100644 --- a/src/main.py +++ b/src/main.py @@ -99,6 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() + print(self.style_manager.get_color_scheme()) if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From 7bf5edf685f16b39bc8870924be508fca5278e34 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:24:40 +0200 Subject: [PATCH 113/149] add more debug --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 3a430c01d..661823e7f 100644 --- a/src/main.py +++ b/src/main.py @@ -98,8 +98,9 @@ def do_activate(self): self.reload_user_defined_presets() self.style_manager = Adw.StyleManager.get_default() - + print(dir(self.style_manager)) print(self.style_manager.get_color_scheme()) + print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From e939dcdd1722e8790964544e8665721ec61e793d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:25:41 +0200 Subject: [PATCH 114/149] fix bug --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 661823e7f..8a2c5bc14 100644 --- a/src/main.py +++ b/src/main.py @@ -99,9 +99,10 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) + print(self.style_manager.get_default()) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) - if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: + if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" ) From 004bf83923814f8d75d30179de80a9f2b12d76b5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:26:48 +0200 Subject: [PATCH 115/149] add debug --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 8a2c5bc14..e7c33d578 100644 --- a/src/main.py +++ b/src/main.py @@ -99,7 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) - print(self.style_manager.get_default()) + print(dir(self.style_manager.get_default())) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: From 3339808f0a28dd33710138e43516508069c986d0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:28:27 +0200 Subject: [PATCH 116/149] add debug --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index e7c33d578..4eceea150 100644 --- a/src/main.py +++ b/src/main.py @@ -100,6 +100,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) print(dir(self.style_manager.get_default())) + print(self.style_manager.get_default().get_color_scheme()) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: From aff7cf44f647e3d2fd89dfeabaf543c03f5f4198 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:33:27 +0200 Subject: [PATCH 117/149] fix style manager --- src/main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 4eceea150..e19935439 100644 --- a/src/main.py +++ b/src/main.py @@ -99,10 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) - print(dir(self.style_manager.get_default())) - print(self.style_manager.get_default().get_color_scheme()) - print(self.style_manager.get_color_scheme()) - print(dir(self.style_manager.get_color_scheme())) + print(self.style_manager.get_dark()) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From 8f2b40d01fe75f1ef4b3c412829d396d1f4e7568 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:34:28 +0200 Subject: [PATCH 118/149] add automatic preset choice if dark or ligjt --- src/main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index e19935439..a6578d3e4 100644 --- a/src/main.py +++ b/src/main.py @@ -98,9 +98,7 @@ def do_activate(self): self.reload_user_defined_presets() self.style_manager = Adw.StyleManager.get_default() - print(dir(self.style_manager)) - print(self.style_manager.get_dark()) - if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: + if self.style_manager.get_dark(): self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" ) From 9f222bd06e2a5db7cec0593cf79bef2e4957d300 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:37:03 +0200 Subject: [PATCH 119/149] add automatic color choice for monet --- src/main.py | 7 ++++++- src/window.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a6578d3e4..4868c1575 100644 --- a/src/main.py +++ b/src/main.py @@ -243,7 +243,12 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(monet_theme) print(theme) - + if monet_theme == "automatic": + if self.style_manager.get_dark(): + monet_theme = "dark" + else: + monet_theme = "light" + if monet_theme == "dark": dark_theme = theme["schemes"]["dark"] variable = { diff --git a/src/window.py b/src/window.py index e5f413426..1f10d3f0a 100644 --- a/src/window.py +++ b/src/window.py @@ -144,6 +144,7 @@ def setup_monet_page(self): self.monet_theme_row.set_title(_("Theme")) store = Gtk.StringList() + store.append("Automatic") store.append("Dark") store.append("Light") self.monet_theme_row.set_model(store) From 28e6218038ed4f67c50b67d3bc350d704a748c76 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:39:34 +0200 Subject: [PATCH 120/149] update light theme scheme --- src/main.py | 64 ++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/main.py b/src/main.py index 4868c1575..6aa3b4843 100644 --- a/src/main.py +++ b/src/main.py @@ -300,50 +300,50 @@ def update_theme_from_monet(self, theme, tone, monet_theme): else: # light light_theme = theme["schemes"]["light"] variable = { - "accent_color": light_theme["primary"], - "accent_bg_color": light_theme["primaryContainer"], - "accent_fg_color": light_theme["onPrimaryContainer"], + "accent_color": self.rgba_from_argb(light_theme.primary), + "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), + "accent_fg_color": self.rgba_from_argb(light_theme.onPrimaryContainer), - "destructive_color": light_theme["error"], - "destructive_bg_color": light_theme["errorContainer"], - "destructive_fg_color": light_theme["onError"], + "destructive_color": self.rgba_from_argb(light_theme.error), + "destructive_bg_color": self.rgba_from_argb(light_theme.errorContainer), + "destructive_fg_color": self.rgba_from_argb(light_theme.onError), - "success_color": light_theme["tertiary"], - "success_bg_color": light_theme["onTertiary"], - "success_fg_color": light_theme["tertiaryContainer"], + "success_color": self.rgba_from_argb(light_theme.tertiary), + "success_bg_color": self.rgba_from_argb(light_theme.onTertiary), + "success_fg_color": self.rgba_from_argb(light_theme.tertiaryContainer), - "warning_color": light_theme["secondaryContainer"], - "warning_bg_color": light_theme["inversePrimary"], - "warning_fg_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "warning_color": self.rgba_from_argb(light_theme.secondaryContainer), + "warning_bg_color": self.rgba_from_argb(light_theme.inversePrimary), + "warning_fg_color": self.rgba_from_argb(light_theme.primary, "0.8"), - "error_color": light_theme["error"], - "error_bg_color": light_theme["errorContainer"], - "error_fg_color": light_theme["onError"], + "error_color": self.rgba_from_argb(light_theme.error), + "error_bg_color": self.rgba_from_argb(light_theme.errorContainer), + "error_fg_color": self.rgba_from_argb(light_theme.onError), - "window_bg_color": light_theme["surface"], - "window_fg_color": light_theme["onSurface"], + "window_bg_color": self.rgba_from_argb(light_theme.surface), + "window_fg_color": self.rgba_from_argb(light_theme.onSurface), - "view_bg_color": light_theme["surface"], - "view_fg_color": light_theme["onSurface"], + "view_bg_color": self.rgba_from_argb(light_theme.surface), + "view_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_bg_color": light_theme["surface"], - "headerbar_fg_color": light_theme["onSurface"], - "headerbar_border_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "headerbar_bg_color": self.rgba_from_argb(light_theme.surface), + "headerbar_fg_color": self.rgba_from_argb(light_theme.onSurface), + "headerbar_border_color": self.rgba_from_argb(light_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": light_theme["shadow"], + "headerbar_shade_color": self.rgba_from_argb(light_theme.shadow), - "card_bg_color": self.rgba_from_argb(light_theme["primary"], "0.05"), - "card_fg_color": light_theme["surfaceVariant"], - "card_shade_color": light_theme["shadow"], + "card_bg_color": self.rgba_from_argb(light_theme.primary, "0.05"), + "card_fg_color": self.rgba_from_argb(light_theme.surfaceVariant), + "card_shade_color": self.rgba_from_argb(light_theme.shadow), - "dialog_bg_color": light_theme["secondaryContainer"], - "dialog_fg_color": light_theme["onSecondaryContainer"], + "dialog_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), + "dialog_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - "popover_bg_color": light_theme["secondaryContainer"], - "popover_fg_color": light_theme["onSecondaryContainer"], + "popover_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), + "popover_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - "shade_color": light_theme["shadow"], - "scrollbar_outline_color": light_theme["outline"] + "shade_color": self.rgba_from_argb(light_theme.shadow), + "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline) } for key in variable.keys(): From 8e51c880acbddaf88d0f68b1940931835a57e6b2 Mon Sep 17 00:00:00 2001 From: David Lapshin Date: Thu, 11 Aug 2022 17:48:22 +0300 Subject: [PATCH 121/149] Fix missing settings-symbolic & open-menu-symbolic --- src/adwcustomizer.gresource.xml | 8 ++++++-- ...thub.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg | 2 -- ...AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg | 8 ++++++++ ....AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg | 2 ++ src/ui/window.blp | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) delete mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg diff --git a/src/adwcustomizer.gresource.xml b/src/adwcustomizer.gresource.xml index dc6a30581..fa71a5932 100644 --- a/src/adwcustomizer.gresource.xml +++ b/src/adwcustomizer.gresource.xml @@ -42,11 +42,15 @@ >icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg + alias="open-menu-symbolic.svg" + >icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-fill-symbolic.svg + icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg deleted file mode 100644 index 50b8a3c4d..000000000 --- a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg new file mode 100644 index 000000000..7f4474335 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg new file mode 100644 index 000000000..408d7e5d4 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/src/ui/window.blp b/src/ui/window.blp index e9e6deb74..3b3abc816 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -47,7 +47,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { [end] Gtk.MenuButton { - icon-name: "menu-symbolic"; + icon-name: "open-menu-symbolic"; menu-model: main-menu; } From 84dda5f78d499801a49c20ed7163bfec4854f006 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:53:41 +0200 Subject: [PATCH 122/149] add switch to select dark or light apply --- src/main.py | 72 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/src/main.py b/src/main.py index 6aa3b4843..819f4dd10 100644 --- a/src/main.py +++ b/src/main.py @@ -443,7 +443,13 @@ def show_apply_color_scheme_dialog(self, *_args): Adw.ResponseAppearance.SUGGESTED, transient_for=self.props.active_window, ) - dialog.connect("response", self.apply_color_scheme) + + switch = Gtk.Switch() + print(dir(switch)) + + dialog.set_extra_child(switch) + + dialog.connect("response", self.apply_color_scheme, switch) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -534,28 +540,50 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response): + def apply_color_scheme(self, widget, response, switch): if response == "apply": - if widget.get_app_types()["gtk4"]: - gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") - if not os.path.exists(gtk4_dir): - os.makedirs(gtk4_dir) - gtk4_css = self.generate_gtk_css("gtk4") - with open( - os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8" - ) as file: - file.write(gtk4_css) - if widget.get_app_types()["gtk3"]: - gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") - if not os.path.exists(gtk3_dir): - os.makedirs(gtk3_dir) - gtk3_css = self.generate_gtk_css("gtk3") - with open( - os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" - ) as file: - file.write(gtk3_css) + if switch.get_active(): + if widget.get_app_types()["gtk4"]: + gtk4_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + if not os.path.exists(gtk4_dir): + os.makedirs(gtk4_dir) + gtk4_css = self.generate_gtk_css("gtk4") + with open( + os.path.join(gtk4_dir, "gtk-dark.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk4_css) + if widget.get_app_types()["gtk3"]: + gtk3_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + if not os.path.exists(gtk3_dir): + os.makedirs(gtk3_dir) + gtk3_css = self.generate_gtk_css("gtk3") + with open( + os.path.join(gtk3_dir, "gtk-dark.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk3_css) + else: + if widget.get_app_types()["gtk4"]: + gtk4_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + if not os.path.exists(gtk4_dir): + os.makedirs(gtk4_dir) + gtk4_css = self.generate_gtk_css("gtk4") + with open( + os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk4_css) + if widget.get_app_types()["gtk3"]: + gtk3_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + if not os.path.exists(gtk3_dir): + os.makedirs(gtk3_dir) + gtk3_css = self.generate_gtk_css("gtk3") + with open( + os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk3_css) self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): From 5e96066b9c4b1578a159c564f9931efeacbd0c19 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 17:57:02 +0200 Subject: [PATCH 123/149] change license Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 819f4dd10..a8e7e471a 100644 --- a/src/main.py +++ b/src/main.py @@ -641,7 +641,7 @@ def show_about_window(self, *_args): Juanjo Cillero https://www.transifex.com/user/profile/renux918/ Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", - license_type=Gtk.License.MIT_X11, + license_type=Gtk.License.GPL_3_0, ) about.present() From f054988887d13b1517b79cba8f9a69957d671ad4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:21:13 +0200 Subject: [PATCH 124/149] rework apply --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a8e7e471a..fc68884de 100644 --- a/src/main.py +++ b/src/main.py @@ -444,7 +444,7 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - switch = Gtk.Switch() + switch = Adw.ActionRow() print(dir(switch)) dialog.set_extra_child(switch) From 7639f5313c1e8a1d031adcbb3bed350edb153cf9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:24:37 +0200 Subject: [PATCH 125/149] update comborow --- src/main.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index fc68884de..04ac224e6 100644 --- a/src/main.py +++ b/src/main.py @@ -444,12 +444,18 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - switch = Adw.ActionRow() - print(dir(switch)) + comborow = Adw.ComboRow() + comborow.set_title(_("Apply as dark theme")) - dialog.set_extra_child(switch) + store = Gtk.StringList() + store.append("Dark") + store.append("Light") + comborow.set_model(store) + print(dir(comborow)) - dialog.connect("response", self.apply_color_scheme, switch) + dialog.set_extra_child(comborow) + + dialog.connect("response", self.apply_color_scheme, comborow) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -540,9 +546,9 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response, switch): + def apply_color_scheme(self, widget, response, comborow): if response == "apply": - if switch.get_active(): + if comborow.get_string().lower() == "dark": if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") From ac53e2e876add0dad2e4871bd7b3a66ea0ab0df7 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:31:44 +0200 Subject: [PATCH 126/149] use switch instead --- src/main.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main.py b/src/main.py index 04ac224e6..f76002025 100644 --- a/src/main.py +++ b/src/main.py @@ -444,18 +444,18 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - comborow = Adw.ComboRow() - comborow.set_title(_("Apply as dark theme")) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - store = Gtk.StringList() - store.append("Dark") - store.append("Light") - comborow.set_model(store) - print(dir(comborow)) + label = Gtk.Label(text="Export as Dark theme") + switch = Gtk.Switch() - dialog.set_extra_child(comborow) + box.append(label) + box.append(switch) + print(dir(switch)) - dialog.connect("response", self.apply_color_scheme, comborow) + dialog.set_extra_child(box) + + dialog.connect("response", self.apply_color_scheme, switch) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -546,9 +546,9 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response, comborow): + def apply_color_scheme(self, widget, response, switch): if response == "apply": - if comborow.get_string().lower() == "dark": + if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") From 4278e213228f94e38423a59aa46942ed2b00b4db Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:32:46 +0200 Subject: [PATCH 127/149] fix bug --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index f76002025..b681a0398 100644 --- a/src/main.py +++ b/src/main.py @@ -446,7 +446,7 @@ def show_apply_color_scheme_dialog(self, *_args): box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - label = Gtk.Label(text="Export as Dark theme") + label = Gtk.Label(label="Export as Dark theme") switch = Gtk.Switch() box.append(label) From 18bb8725ee3e5420d4b5d249e344699b7c1ea30a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:35:23 +0200 Subject: [PATCH 128/149] increase spacing --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index b681a0398..959b83397 100644 --- a/src/main.py +++ b/src/main.py @@ -444,7 +444,7 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=30) label = Gtk.Label(label="Export as Dark theme") switch = Gtk.Switch() From b6105f6302a28c6ad4f2f6b9b033b6e2e8ca59cf Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:38:00 +0200 Subject: [PATCH 129/149] update label --- src/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 959b83397..8595303d5 100644 --- a/src/main.py +++ b/src/main.py @@ -444,9 +444,9 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=30) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - label = Gtk.Label(label="Export as Dark theme") + label = Gtk.Label(label="Apply as Dark theme") switch = Gtk.Switch() box.append(label) From b7c6be25e731b205bf7a8c7ecb45bee60a10b014 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:39:24 +0200 Subject: [PATCH 130/149] format --- src/main.py | 72 +++++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/main.py b/src/main.py index 8595303d5..4d4d6f45a 100644 --- a/src/main.py +++ b/src/main.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -36,6 +36,7 @@ from .custom_css_group import AdwcustomizerCustomCSSGroup from .plugins_list import AdwcustomizerPluginsList + def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -114,7 +115,7 @@ def reload_user_defined_presets(self): self.props.active_window.presets_menu.remove(1) preset_directory = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets") if not os.path.exists(preset_directory): os.makedirs(preset_directory) @@ -141,7 +142,8 @@ def reload_user_defined_presets(self): "line": traceback.format_exc().strip(), } ) - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Failed to load preset"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Failed to load preset"))) self.props.active_window.update_errors(self.global_errors) @@ -174,7 +176,8 @@ def open_dir_callback(_, result): self.portal.open_uri( parent, - "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets"), + "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets"), Xdp.OpenUriFlags.NONE, None, open_dir_callback, @@ -214,8 +217,7 @@ def load_preset_variables(self, preset): self.reload_variables() - - def rgba_from_argb(self, argb, alpha = None) -> str: + def rgba_from_argb(self, argb, alpha=None) -> str: base = "rgba({}, {}, {}, {})" red = redFromArgb(argb) @@ -229,28 +231,22 @@ def rgba_from_argb(self, argb, alpha = None) -> str: def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] - monet_theme = monet_theme.get_string().lower() # dark / light + monet_theme = monet_theme.get_string().lower() # dark / light palette = {} i = 0 for color in palettes.values(): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) - - print(palette) - self.pref_palette_shades["monet"].update_shades(palette) - - print(monet_theme) - print(theme) if monet_theme == "automatic": if self.style_manager.get_dark(): monet_theme = "dark" else: monet_theme = "light" - + if monet_theme == "dark": - dark_theme = theme["schemes"]["dark"] + dark_theme = theme["schemes"]["dark"] variable = { "accent_color": self.rgba_from_argb(dark_theme.primary), "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), @@ -297,8 +293,8 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "shade_color": self.rgba_from_argb(dark_theme.shadow), "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) } - else: # light - light_theme = theme["schemes"]["light"] + else: # light + light_theme = theme["schemes"]["light"] variable = { "accent_color": self.rgba_from_argb(light_theme.primary), "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), @@ -349,7 +345,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): for key in variable.keys(): if key in self.pref_variables: self.pref_variables[key].update_value(variable[key]) - + self.reload_variables() def generate_gtk_css(self, app_type): @@ -419,7 +415,8 @@ def load_preset_action(self, _unused, *args): if args[0].get_string().startswith("custom-"): self.load_preset_from_file( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", args[0].get_string().replace("custom-", "", 1) + ".json", ) @@ -451,7 +448,6 @@ def show_apply_color_scheme_dialog(self, *_args): box.append(label) box.append(switch) - print(dir(switch)) dialog.set_extra_child(box) @@ -478,7 +474,8 @@ def show_save_preset_dialog(self, *_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(self.preset_name) + ".json", ) @@ -501,7 +498,7 @@ def on_preset_entry_change(*_args): dialog.set_body( _( "Saving preset to {0}. If that preset already exists, it will be overwritten!" - ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets")) + ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets")) ) dialog.set_response_enabled("save", False) else: @@ -510,7 +507,8 @@ def on_preset_entry_change(*_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(preset_entry.get_text()) + ".json", ) @@ -529,7 +527,8 @@ def save_preset(self, _unused, response, entry): if response == "save": with open( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(entry.get_text()) + ".json", ), @@ -544,14 +543,15 @@ def save_preset(self, _unused, response, entry): } file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Scheme successfully saved!"))) def apply_color_scheme(self, widget, response, switch): if response == "apply": if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -561,7 +561,7 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -572,7 +572,7 @@ def apply_color_scheme(self, widget, response, switch): else: if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -582,7 +582,7 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -590,30 +590,32 @@ def apply_color_scheme(self, widget, response, switch): os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" ) as file: file.write(gtk3_css) - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): if response == "reset": if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0/gtk.css") ) try: file.delete() except Exception: pass - + if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0/gtk.css") ) try: file.delete() except Exception: pass - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( From 1ee3b7c0bf0d349004c57742ef8498cb4b501df5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:39:52 +0200 Subject: [PATCH 131/149] format --- src/app_type_dialog.py | 23 +++- src/custom_css_group.py | 24 ++-- src/error.py | 9 +- src/main.py | 157 +++++++++++++------------ src/option.py | 27 +++-- src/palette_shades.py | 25 ++-- src/plugin.py | 11 +- src/plugins/__init__.py | 6 +- src/plugins/gtk4.py | 7 +- src/plugins_list.py | 21 ++-- src/setting.py | 7 +- src/settings_schema.py | 251 ++++++++++++++++++++-------------------- src/window.py | 70 ++++++----- 13 files changed, 355 insertions(+), 283 deletions(-) diff --git a/src/app_type_dialog.py b/src/app_type_dialog.py index be2707fe2..f7f88133d 100644 --- a/src/app_type_dialog.py +++ b/src/app_type_dialog.py @@ -7,25 +7,36 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/app_type_dialog.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/app_type_dialog.ui" +) class AdwcustomizerAppTypeDialog(Adw.MessageDialog): - __gtype_name__ = 'AdwcustomizerAppTypeDialog' + __gtype_name__ = "AdwcustomizerAppTypeDialog" gtk4_app_type = Gtk.Template.Child("gtk4-app-type") gtk3_app_type = Gtk.Template.Child("gtk3-app-type") - def __init__(self, heading, body, ok_response_name, ok_response_label, ok_response_appearance, **kwargs): + def __init__( + self, + heading, + body, + ok_response_name, + ok_response_label, + ok_response_appearance, + **kwargs + ): super().__init__(**kwargs) self.set_heading(heading) self.set_body(body) @@ -39,5 +50,5 @@ def __init__(self, heading, body, ok_response_name, ok_response_label, ok_respon def get_app_types(self): return { "gtk4": self.gtk4_app_type.get_active(), - "gtk3": self.gtk3_app_type.get_active() + "gtk3": self.gtk3_app_type.get_active(), } diff --git a/src/custom_css_group.py b/src/custom_css_group.py index 2e2d453bd..1f98ab800 100644 --- a/src/custom_css_group.py +++ b/src/custom_css_group.py @@ -7,20 +7,23 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/custom_css_group.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/custom_css_group.ui" +) class AdwcustomizerCustomCSSGroup(Adw.PreferencesGroup): - __gtype_name__ = 'AdwcustomizerCustomCSSGroup' + __gtype_name__ = "AdwcustomizerCustomCSSGroup" app_type_dropdown = Gtk.Template.Child("app-type-dropdown") custom_css_text_view = Gtk.Template.Child("custom-css-text-view") @@ -31,14 +34,21 @@ def __init__(self, **kwargs): def load_custom_css(self, custom_css): self.custom_css = custom_css - self.custom_css_text_view.get_buffer().set_text(list(self.custom_css.values())[self.app_type_dropdown.get_selected()]) + self.custom_css_text_view.get_buffer().set_text( + list(self.custom_css.values())[self.app_type_dropdown.get_selected()] + ) @Gtk.Template.Callback() def on_custom_css_changed(self, buffer): Gtk.Application.get_default().mark_as_dirty() - Gtk.Application.get_default().update_custom_css_text(list(self.custom_css.keys())[self.app_type_dropdown.get_selected()], buffer.props.text) + Gtk.Application.get_default().update_custom_css_text( + list(self.custom_css.keys())[self.app_type_dropdown.get_selected()], + buffer.props.text, + ) @Gtk.Template.Callback() def on_dropdown_notify(self, _unused, pspec): if pspec.name == "selected": - self.custom_css_text_view.get_buffer().set_text(list(self.custom_css.values())[self.app_type_dropdown.get_selected()]) + self.custom_css_text_view.get_buffer().set_text( + list(self.custom_css.values())[self.app_type_dropdown.get_selected()] + ) diff --git a/src/error.py b/src/error.py index 98fd3fdf1..2760bd544 100644 --- a/src/error.py +++ b/src/error.py @@ -7,20 +7,21 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/error.ui') + +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/error.ui") class AdwcustomizerError(Gtk.ListBoxRow): - __gtype_name__ = 'AdwcustomizerError' + __gtype_name__ = "AdwcustomizerError" error_label = Gtk.Template.Child("error-label") element_label = Gtk.Template.Child("element-label") diff --git a/src/main.py b/src/main.py index 4d4d6f45a..042eaf87b 100644 --- a/src/main.py +++ b/src/main.py @@ -89,10 +89,8 @@ def do_activate(self): GLib.Variant("s", "adwaita"), self.load_preset_action, ) - self.create_action("apply_color_scheme", - self.show_apply_color_scheme_dialog) - self.create_action("reset_color_scheme", - self.show_reset_color_scheme_dialog) + self.create_action("apply_color_scheme", self.show_apply_color_scheme_dialog) + self.create_action("reset_color_scheme", self.show_reset_color_scheme_dialog) self.create_action("save_preset", self.show_save_preset_dialog) self.create_action("about", self.show_about_window) @@ -115,7 +113,9 @@ def reload_user_defined_presets(self): self.props.active_window.presets_menu.remove(1) preset_directory = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), + "presets", + ) if not os.path.exists(preset_directory): os.makedirs(preset_directory) @@ -132,8 +132,7 @@ def reload_user_defined_presets(self): raise KeyError("variables") if preset.get("palette") is None: raise KeyError("palette") - self.custom_presets[file_name.replace( - ".json", "")] = preset["name"] + self.custom_presets[file_name.replace(".json", "")] = preset["name"] except Exception: self.global_errors.append( { @@ -143,7 +142,8 @@ def reload_user_defined_presets(self): } ) self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Failed to load preset"))) + Adw.Toast(title=_("Failed to load preset")) + ) self.props.active_window.update_errors(self.global_errors) @@ -176,8 +176,11 @@ def open_dir_callback(_, result): self.portal.open_uri( parent, - "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), "presets"), + "file://" + + os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), + "presets", + ), Xdp.OpenUriFlags.NONE, None, open_dir_callback, @@ -190,8 +193,7 @@ def load_preset_from_file(self, preset_path): self.load_preset_variables(json.loads(preset_text)) def load_preset_from_resource(self, preset_path): - preset_text = Gio.resources_lookup_data( - preset_path, 0).get_data().decode() + preset_text = Gio.resources_lookup_data(preset_path, 0).get_data().decode() self.load_preset_variables(json.loads(preset_text)) def load_preset_variables(self, preset): @@ -251,47 +253,40 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_color": self.rgba_from_argb(dark_theme.primary), "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), "accent_fg_color": self.rgba_from_argb(dark_theme.onPrimaryContainer), - "destructive_color": self.rgba_from_argb(dark_theme.error), "destructive_bg_color": self.rgba_from_argb(dark_theme.errorContainer), "destructive_fg_color": self.rgba_from_argb(dark_theme.onError), - "success_color": self.rgba_from_argb(dark_theme.tertiary), "success_bg_color": self.rgba_from_argb(dark_theme.onTertiary), "success_fg_color": self.rgba_from_argb(dark_theme.tertiaryContainer), - "warning_color": self.rgba_from_argb(dark_theme.secondaryContainer), "warning_bg_color": self.rgba_from_argb(dark_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": self.rgba_from_argb(dark_theme.error), "error_bg_color": self.rgba_from_argb(dark_theme.errorContainer), "error_fg_color": self.rgba_from_argb(dark_theme.onError), - "window_bg_color": self.rgba_from_argb(dark_theme.surface), "window_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "view_bg_color": self.rgba_from_argb(dark_theme.surface), "view_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_bg_color": self.rgba_from_argb(dark_theme.surface), "headerbar_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), + "headerbar_border_color": self.rgba_from_argb( + dark_theme.primary, "0.8" + ), "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), - "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), "card_shade_color": self.rgba_from_argb(dark_theme.shadow), - "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "popover_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), - "popover_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - + "popover_fg_color": self.rgba_from_argb( + dark_theme.onSecondaryContainer + ), "shade_color": self.rgba_from_argb(dark_theme.shadow), - "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) + "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline), } else: # light light_theme = theme["schemes"]["light"] @@ -299,47 +294,42 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_color": self.rgba_from_argb(light_theme.primary), "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), "accent_fg_color": self.rgba_from_argb(light_theme.onPrimaryContainer), - "destructive_color": self.rgba_from_argb(light_theme.error), "destructive_bg_color": self.rgba_from_argb(light_theme.errorContainer), "destructive_fg_color": self.rgba_from_argb(light_theme.onError), - "success_color": self.rgba_from_argb(light_theme.tertiary), "success_bg_color": self.rgba_from_argb(light_theme.onTertiary), "success_fg_color": self.rgba_from_argb(light_theme.tertiaryContainer), - "warning_color": self.rgba_from_argb(light_theme.secondaryContainer), "warning_bg_color": self.rgba_from_argb(light_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(light_theme.primary, "0.8"), - "error_color": self.rgba_from_argb(light_theme.error), "error_bg_color": self.rgba_from_argb(light_theme.errorContainer), "error_fg_color": self.rgba_from_argb(light_theme.onError), - "window_bg_color": self.rgba_from_argb(light_theme.surface), "window_fg_color": self.rgba_from_argb(light_theme.onSurface), - "view_bg_color": self.rgba_from_argb(light_theme.surface), "view_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_bg_color": self.rgba_from_argb(light_theme.surface), "headerbar_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_border_color": self.rgba_from_argb(light_theme.primary, "0.8"), + "headerbar_border_color": self.rgba_from_argb( + light_theme.primary, "0.8" + ), "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(light_theme.shadow), - "card_bg_color": self.rgba_from_argb(light_theme.primary, "0.05"), "card_fg_color": self.rgba_from_argb(light_theme.surfaceVariant), "card_shade_color": self.rgba_from_argb(light_theme.shadow), - "dialog_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), - "dialog_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - + "dialog_fg_color": self.rgba_from_argb( + light_theme.onSecondaryContainer + ), "popover_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), - "popover_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - + "popover_fg_color": self.rgba_from_argb( + light_theme.onSecondaryContainer + ), "shade_color": self.rgba_from_argb(light_theme.shadow), - "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline) + "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline), } for key in variable.keys(): @@ -395,8 +385,7 @@ def on_error(_, section, error): css_provider.connect("parsing-error", on_error) css_provider.load_from_data(gtk_css.encode()) - self.props.active_window.update_errors( - self.global_errors + parsing_errors) + self.props.active_window.update_errors(self.global_errors + parsing_errors) # loading with the priority above user to override the applied config if self.current_css_provider is not None: Gtk.StyleContext.remove_provider_for_display( @@ -415,8 +404,7 @@ def load_preset_action(self, _unused, *args): if args[0].get_string().startswith("custom-"): self.load_preset_from_file( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", args[0].get_string().replace("custom-", "", 1) + ".json", ) @@ -474,8 +462,7 @@ def show_save_preset_dialog(self, *_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", to_slug_case(self.preset_name) + ".json", ) @@ -485,8 +472,7 @@ def show_save_preset_dialog(self, *_args): dialog.add_response("cancel", _("Cancel")) dialog.add_response("save", _("Save")) - dialog.set_response_appearance( - "save", Adw.ResponseAppearance.SUGGESTED) + dialog.set_response_appearance("save", Adw.ResponseAppearance.SUGGESTED) dialog.set_default_response("cancel") dialog.set_close_response("cancel") @@ -498,7 +484,14 @@ def on_preset_entry_change(*_args): dialog.set_body( _( "Saving preset to {0}. If that preset already exists, it will be overwritten!" - ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets")) + ).format( + os.path.join( + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "presets", + ) + ) ) dialog.set_response_enabled("save", False) else: @@ -507,8 +500,9 @@ def on_preset_entry_change(*_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), "presets", to_slug_case(preset_entry.get_text()) + ".json", ) @@ -527,8 +521,7 @@ def save_preset(self, _unused, response, entry): if response == "save": with open( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", to_slug_case(entry.get_text()) + ".json", ), @@ -544,14 +537,19 @@ def save_preset(self, _unused, response, entry): file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Scheme successfully saved!"))) + Adw.Toast(title=_("Scheme successfully saved!")) + ) def apply_color_scheme(self, widget, response, switch): if response == "apply": if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0", + ) if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -561,7 +559,11 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0", + ) if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -572,7 +574,11 @@ def apply_color_scheme(self, widget, response, switch): else: if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0", + ) if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -582,7 +588,11 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0", + ) if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -591,14 +601,19 @@ def apply_color_scheme(self, widget, response, switch): ) as file: file.write(gtk3_css) self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Scheme set successfully!"))) + Adw.Toast(title=_("Scheme set successfully!")) + ) def reset_color_scheme(self, widget, response): if response == "reset": if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0/gtk.css") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0/gtk.css", + ) ) try: file.delete() @@ -608,14 +623,17 @@ def reset_color_scheme(self, widget, response): if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0/gtk.css") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0/gtk.css", + ) ) try: file.delete() except Exception: pass - self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Reset successfully!"))) + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( @@ -631,12 +649,8 @@ def show_about_window(self, *_args): "0xMRTT https://github.com/0xMRTT", "Verantor https://github.com/Verantor", ], - artists=[ - 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' - ], - designers=[ - 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' - ], + artists=['David "Daudix UFO" Lapshin https://github.com/daudix-UFO'], + designers=['David "Daudix UFO" Lapshin https://github.com/daudix-UFO'], # Translators: This is a place to put your credits (formats: "Name https://example.com" or "Name ", no quotes) and is not meant to be translated literally. translator_credits="""Maxime V https://www.transifex.com/user/profile/Adaoh/ FineFindus https://github.com/FineFindus @@ -676,8 +690,7 @@ def create_stateful_action( self, name, parameter_type, initial_state, callback, shortcuts=None ): """Add a stateful application action.""" - action = Gio.SimpleAction.new_stateful( - name, parameter_type, initial_state) + action = Gio.SimpleAction.new_stateful(name, parameter_type, initial_state) action.connect("activate", callback) self.add_action(action) if shortcuts: diff --git a/src/option.py b/src/option.py index ed98f2d12..885339f22 100644 --- a/src/option.py +++ b/src/option.py @@ -7,20 +7,21 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/option.ui') + +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/option.ui") class AdwcustomizerOption(Adw.ActionRow): - __gtype_name__ = 'AdwcustomizerOption' + __gtype_name__ = "AdwcustomizerOption" color_value = Gtk.Template.Child("color-value") text_value = Gtk.Template.Child("text-value") @@ -42,10 +43,14 @@ def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs): self.warning_button.set_visible(False) elif adw_gtk3_support == "partial": self.warning_button.add_css_class("warning") - self.warning_label.set_label(_("This option is only partially supported by the adw-gtk3 theme.")) + self.warning_label.set_label( + _("This option is only partially supported by the adw-gtk3 theme.") + ) elif adw_gtk3_support == "no": self.warning_button.add_css_class("error") - self.warning_label.set_label(_("This option is not supported by the adw-gtk3 theme.")) + self.warning_label.set_label( + _("This option is not supported by the adw-gtk3 theme.") + ) self.explanation_label.set_label(explanation or "") if explanation is None: @@ -53,7 +58,9 @@ def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs): @Gtk.Template.Callback() def on_color_value_changed(self, *_args): - self.update_value(self.color_value.get_rgba().to_string(), update_from="color_value") + self.update_value( + self.color_value.get_rgba().to_string(), update_from="color_value" + ) @Gtk.Template.Callback() def on_text_value_changed(self, *_args): @@ -86,7 +93,11 @@ def update_value(self, new_value, **kwargs): self.color_value.set_rgba(rgba) self.color_value.set_tooltip_text(_("Not a color, see text value")) - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "text_value" and new_value != "": + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "text_value" + and new_value != "" + ): Gtk.Application.get_default().variables[self.get_name()] = new_value Gtk.Application.get_default().mark_as_dirty() Gtk.Application.get_default().reload_variables() diff --git a/src/palette_shades.py b/src/palette_shades.py index f7eb9bf79..dcb0cc63d 100644 --- a/src/palette_shades.py +++ b/src/palette_shades.py @@ -7,20 +7,23 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/palette_shades.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/palette_shades.ui" +) class AdwcustomizerPaletteShades(Adw.ActionRow): - __gtype_name__ = 'AdwcustomizerPaletteShades' + __gtype_name__ = "AdwcustomizerPaletteShades" def __init__(self, prefix, color_title, n_shades, **kwargs): super().__init__(**kwargs) @@ -52,9 +55,17 @@ def update_shades(self, shades, **kwargs): if new_rgba.parse(shades[str(i)]): self.color_pickers[str(i)].set_rgba(new_rgba) self.color_pickers[str(i)].set_tooltip_text(shades[str(i)]) - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "color_value": - Gtk.Application.get_default().palette[self.prefix][str(i)] = shades[str(i)] + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "color_value" + ): + Gtk.Application.get_default().palette[self.prefix][str(i)] = shades[ + str(i) + ] - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "color_value": + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "color_value" + ): Gtk.Application.get_default().mark_as_dirty() Gtk.Application.get_default().reload_variables() diff --git a/src/plugin.py b/src/plugin.py index 16a234f24..cceb7e014 100644 --- a/src/plugin.py +++ b/src/plugin.py @@ -7,17 +7,18 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from .setting import AdwcustomizerSetting + class AdwcustomizerPlugin: def __init__(self): self.title = None @@ -48,7 +49,9 @@ def get_custom_settings_for_preset(self): def get_alias_values(self): alias_values = {} for key, value in self.alias_dict.items(): - alias_values[key] = self.colors.get(value, self.palette.get(value, self.custom_settings.get(value))) + alias_values[key] = self.colors.get( + value, self.palette.get(value, self.custom_settings.get(value)) + ) return alias_values def validate(self): @@ -58,4 +61,4 @@ def apply(self): raise NotImplementedError() def save(self): - pass \ No newline at end of file + pass diff --git a/src/plugins/__init__.py b/src/plugins/__init__.py index a66319289..f93ffe537 100644 --- a/src/plugins/__init__.py +++ b/src/plugins/__init__.py @@ -7,11 +7,11 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with this program. If not, see . \ No newline at end of file +# along with this program. If not, see . diff --git a/src/plugins/gtk4.py b/src/plugins/gtk4.py index b5a7d14f1..dd5fe68e9 100644 --- a/src/plugins/gtk4.py +++ b/src/plugins/gtk4.py @@ -7,16 +7,17 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from ..plugin import AdwcustomizerPlugin + class AdwcustomizerGtk4Plugin(AdwcustomizerPlugin): - pass \ No newline at end of file + pass diff --git a/src/plugins_list.py b/src/plugins_list.py index 3c7c04b35..d2c14499e 100644 --- a/src/plugins_list.py +++ b/src/plugins_list.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -20,22 +20,27 @@ import os from pathlib import Path import importlib + + class AdwcustomizerPluginsList: def __init__(self): - self.plugins = { # AdwCustomizerTeam plugins - "gtk4": AdwcustomizerGtk4Plugin() - } + self.plugins = {"gtk4": AdwcustomizerGtk4Plugin()} # AdwCustomizerTeam plugins self.add_user_plugins() def add_user_plugins(self): - self.user_plugin_dir = Path(os.environ.get("XDG_DATA_HOME", os.environ["HOME"])) / ".local" / "share" / "AdwCustomizer" / "plugins" + self.user_plugin_dir = ( + Path(os.environ.get("XDG_DATA_HOME", os.environ["HOME"])) + / ".local" + / "share" + / "AdwCustomizer" + / "plugins" + ) if self.user_plugin_dir.exists(): for path, _, name in os.walk(self.user_plugin_dir): print(name[0]) else: print("No plugins dir found") - def load_all_custom_settings(self, settings): for plugin_id, plugin in self.plugins.items(): plugin.load_custom_settings(settings[plugin_id]) @@ -43,4 +48,4 @@ def load_all_custom_settings(self, settings): def get_all_custom_settings_for_preset(self): custom_settings = {} for plugin_id, plugin in self.plugins.items(): - custom_settings[plugin_id] = plugin.get_custom_settings_for_preset() \ No newline at end of file + custom_settings[plugin_id] = plugin.get_custom_settings_for_preset() diff --git a/src/setting.py b/src/setting.py index 9a7492815..a2d3479b5 100644 --- a/src/setting.py +++ b/src/setting.py @@ -7,15 +7,16 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . + class AdwcustomizerSetting: def __init__(self, name, title, value_type, explanation=None, default_value=None): # TODO supported types: @@ -34,4 +35,4 @@ def __init__(self, name, title, value_type, explanation=None, default_value=None def set_value(self, new_value): # TODO checks - self.value = new_value \ No newline at end of file + self.value = new_value diff --git a/src/settings_schema.py b/src/settings_schema.py index ea9317441..ea22ce840 100644 --- a/src/settings_schema.py +++ b/src/settings_schema.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -21,117 +21,137 @@ { "name": "accent_colors", "title": _("Accent Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, and entries, to indicate that a widget is important, interactive, or currently active."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, and entries, to indicate that a widget is important, interactive, or currently active." + ), "variables": [ { "name": "accent_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "accent_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "accent_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "destructive_colors", "title": _("Destructive Colors"), - "description": _("These colors are used for buttons to indicate a dangerous action, such as deleting a file."), + "description": _( + "These colors are used for buttons to indicate a dangerous action, such as deleting a file." + ), "variables": [ { "name": "destructive_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "destructive_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "destructive_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "success_colors", "title": _("Success Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a success or a high level."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a success or a high level." + ), "variables": [ { "name": "success_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "success_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "success_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "warning_colors", "title": _("Warning Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a warning or a low level."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a warning or a low level." + ), "variables": [ { "name": "warning_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "warning_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "warning_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "error_colors", "title": _("Error Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, and entries, to indicate a failure."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, and entries, to indicate a failure." + ), "variables": [ { "name": "error_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "error_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "error_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "window_colors", @@ -141,66 +161,76 @@ { "name": "window_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "window_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "view_colors", "title": _("View Colors"), - "description": _("These colors are used in a variety of widgets, such as text views and entries."), + "description": _( + "These colors are used in a variety of widgets, such as text views and entries." + ), "variables": [ { "name": "view_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "view_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "headerbar_colors", "title": _("Header Bar Colors"), - "description": _("These colors are used for header bars, as well as widgets that are meant to be visually attached to it, such as search bars or tab bars."), + "description": _( + "These colors are used for header bars, as well as widgets that are meant to be visually attached to it, such as search bars or tab bars." + ), "variables": [ { "name": "headerbar_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "headerbar_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "headerbar_border_color", "title": _("Border Color"), - "explanation": _("The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout."), - "adw_gtk3_support": "no" + "explanation": _( + "The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout." + ), + "adw_gtk3_support": "no", }, { "name": "headerbar_backdrop_color", "title": _("Backdrop Color"), - "explanation": _("The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color."), - "adw_gtk3_support": "yes" + "explanation": _( + "The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color." + ), + "adw_gtk3_support": "yes", }, { "name": "headerbar_shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window."), - "adw_gtk3_support": "no" - } - ] + "explanation": _( + "The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window." + ), + "adw_gtk3_support": "no", + }, + ], }, { "name": "card_colors", @@ -210,20 +240,22 @@ { "name": "card_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "card_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "card_shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards."), - "adw_gtk3_support": "no" - } - ] + "explanation": _( + "The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards." + ), + "adw_gtk3_support": "no", + }, + ], }, { "name": "dialog_colors", @@ -233,14 +265,14 @@ { "name": "dialog_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "no" + "adw_gtk3_support": "no", }, { "name": "dialog_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "no" - } - ] + "adw_gtk3_support": "no", + }, + ], }, { "name": "popover_colors", @@ -250,14 +282,14 @@ { "name": "popover_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "popover_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "misc_colors", @@ -267,67 +299,32 @@ { "name": "shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders."), - "adw_gtk3_support": "no" + "explanation": _( + "The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders." + ), + "adw_gtk3_support": "no", }, { "name": "scrollbar_outline_color", "title": _("Scrollbar Outline Color"), - "explanation": _("The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color."), - "adw_gtk3_support": "no" - } - ] - } + "explanation": _( + "The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color." + ), + "adw_gtk3_support": "no", + }, + ], + }, ], "palette": [ - { - "prefix": "blue_", - "title": _("Blue"), - "n_shades": 5 - }, - { - "prefix": "green_", - "title": _("Green"), - "n_shades": 5 - }, - { - "prefix": "yellow_", - "title": _("Yellow"), - "n_shades": 5 - }, - { - "prefix": "orange_", - "title": _("Orange"), - "n_shades": 5 - }, - { - "prefix": "red_", - "title": _("Red"), - "n_shades": 5 - }, - { - "prefix": "purple_", - "title": _("Purple"), - "n_shades": 5 - }, - { - "prefix": "brown_", - "title": _("Brown"), - "n_shades": 5 - }, - { - "prefix": "light_", - "title": _("Light"), - "n_shades": 5 - }, - { - "prefix": "dark_", - "title": _("Dark"), - "n_shades": 5 - } + {"prefix": "blue_", "title": _("Blue"), "n_shades": 5}, + {"prefix": "green_", "title": _("Green"), "n_shades": 5}, + {"prefix": "yellow_", "title": _("Yellow"), "n_shades": 5}, + {"prefix": "orange_", "title": _("Orange"), "n_shades": 5}, + {"prefix": "red_", "title": _("Red"), "n_shades": 5}, + {"prefix": "purple_", "title": _("Purple"), "n_shades": 5}, + {"prefix": "brown_", "title": _("Brown"), "n_shades": 5}, + {"prefix": "light_", "title": _("Light"), "n_shades": 5}, + {"prefix": "dark_", "title": _("Dark"), "n_shades": 5}, ], - "custom_css_app_types": [ - "gtk4", - "gtk3" - ] + "custom_css_app_types": ["gtk4", "gtk3"], } diff --git a/src/window.py b/src/window.py index 1f10d3f0a..25d03cc83 100644 --- a/src/window.py +++ b/src/window.py @@ -36,9 +36,9 @@ from material_color_utilities_python import * -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui") class AdwcustomizerMainWindow(Adw.ApplicationWindow): - __gtype_name__ = 'AdwcustomizerMainWindow' + __gtype_name__ = "AdwcustomizerMainWindow" content = Gtk.Template.Child() toast_overlay = Gtk.Template.Child() @@ -54,14 +54,14 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) self.presets_dropdown.get_popover().connect( - "show", self.on_presets_dropdown_activate) + "show", self.on_presets_dropdown_activate + ) self.setup_monet_page() self.setup_plugins_page() self.setup_colors_page() - self.settings = Gio.Settings( - "com.github.AdwCustomizerTeam.AdwCustomizer") + self.settings = Gio.Settings("com.github.AdwCustomizerTeam.AdwCustomizer") self.settings.bind( "window-width", self, "default-width", Gio.SettingsBindFlags.DEFAULT @@ -93,7 +93,9 @@ def on_monet_file_chooser_response(self, widget, response): self.theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) + self.get_application().update_theme_from_monet( + self.theme, self.tone, self.monet_theme + ) def setup_monet_page(self): @@ -101,7 +103,10 @@ def setup_monet_page(self): self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) self.monet_pref_group.set_description( - _("Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow")) + _( + "Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow" + ) + ) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -111,21 +116,21 @@ def setup_monet_page(self): self.monet_file_chooser_button = Gtk.Button() self.monet_file_chooser_button.set_label(_("Choose a file")) - self.monet_file_chooser_button.set_icon_name( - "folder-pictures-symbolic") + self.monet_file_chooser_button.set_icon_name("folder-pictures-symbolic") self.monet_file_chooser_button.connect( - "clicked", self.on_file_picker_button_clicked) + "clicked", self.on_file_picker_button_clicked + ) self.monet_file_chooser_dialog.connect( - "response", self.on_monet_file_chooser_response) + "response", self.on_monet_file_chooser_response + ) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) self.monet_pref_group.add(self.monet_file_chooser_row) - self.monet_palette_shades = AdwcustomizerPaletteShades("monet", - "Monet Palette", - 6) - self.get_application( - ).pref_palette_shades["monet"] = self.monet_palette_shades + self.monet_palette_shades = AdwcustomizerPaletteShades( + "monet", "Monet Palette", 6 + ) + self.get_application().pref_palette_shades["monet"] = self.monet_palette_shades self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() @@ -168,14 +173,14 @@ def setup_colors_page(self): pref_group.set_description(group["description"]) for variable in group["variables"]: - pref_variable = AdwcustomizerOption(variable["name"], - variable["title"], - variable.get( - "explanation"), - variable["adw_gtk3_support"]) + pref_variable = AdwcustomizerOption( + variable["name"], + variable["title"], + variable.get("explanation"), + variable["adw_gtk3_support"], + ) pref_group.add(pref_variable) - self.get_application( - ).pref_variables[variable["name"]] = pref_variable + self.get_application().pref_variables[variable["name"]] = pref_variable self.content.add(pref_group) @@ -183,14 +188,16 @@ def setup_colors_page(self): palette_pref_group.set_name("palette_colors") palette_pref_group.set_title(_("Palette Colors")) palette_pref_group.set_description( - _("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) + _( + 'Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.' + ) + ) for color in settings_schema["palette"]: - palette_shades = AdwcustomizerPaletteShades(color["prefix"], - color["title"], - color["n_shades"]) + palette_shades = AdwcustomizerPaletteShades( + color["prefix"], color["title"], color["n_shades"] + ) palette_pref_group.add(palette_shades) - self.get_application( - ).pref_palette_shades[color["prefix"]] = palette_shades + self.get_application().pref_palette_shades[color["prefix"]] = palette_shades self.content.add(palette_pref_group) def update_errors(self, errors): @@ -200,8 +207,9 @@ def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) self.errors_button.set_visible(len(errors) > 0) for error in errors: - self.errors_list.append(AdwcustomizerError( - error["error"], error["element"], error["line"])) + self.errors_list.append( + AdwcustomizerError(error["error"], error["element"], error["line"]) + ) def on_presets_dropdown_activate(self, *args): self.get_application().reload_user_defined_presets() From f84080832408da0368c8ff33b488993b9e538235 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:44:51 +0200 Subject: [PATCH 132/149] add version --- meson.build | 6 +++++- src/info.py.in | 2 ++ src/main.py | 3 ++- src/meson.build | 11 +++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/info.py.in diff --git a/meson.build b/meson.build index 36f2ff2f4..e22a4fc1e 100644 --- a/meson.build +++ b/meson.build @@ -1,11 +1,15 @@ project('adwcustomizer', - version: 'git', + version: '0.1.0', meson_version: '>= 0.59.0', default_options: [ 'warning_level=2', 'werror=false', ], ) +dependency('glib-2.0') +dependency('pygobject-3.0') +dependency('libadwaita-1') + i18n = import('i18n') gnome = import('gnome') diff --git a/src/info.py.in b/src/info.py.in new file mode 100644 index 000000000..20fc34949 --- /dev/null +++ b/src/info.py.in @@ -0,0 +1,2 @@ +version = '@version@' +build_type = '@build_type@' \ No newline at end of file diff --git a/src/main.py b/src/main.py index 042eaf87b..142524a33 100644 --- a/src/main.py +++ b/src/main.py @@ -35,7 +35,7 @@ from .app_type_dialog import AdwcustomizerAppTypeDialog from .custom_css_group import AdwcustomizerCustomCSSGroup from .plugins_list import AdwcustomizerPluginsList - +from . import info def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -664,6 +664,7 @@ def show_about_window(self, *_args): Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, + version=f"{info.version}" ) about.present() diff --git a/src/meson.build b/src/meson.build index 7f45b1d13..b395392b1 100644 --- a/src/meson.build +++ b/src/meson.build @@ -40,6 +40,17 @@ configure_file( install_dir: get_option('bindir') ) +configure_file( + input: 'info.py.in', + output: '@BASENAME@', + install: true, + install_dir: python.get_install_dir() / 'adwcustomizer', + configuration: configuration_data({ + 'version': meson.project_version(), + 'build_type': get_option('buildtype'), + }), +) + adwcustomizer_sources = [ '__init__.py', 'settings_schema.py', From c775f93492d60738f4453c7f7323af2b82efabd9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:46:03 +0200 Subject: [PATCH 133/149] update meson build --- src/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index b395392b1..d3e13293a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -44,7 +44,7 @@ configure_file( input: 'info.py.in', output: '@BASENAME@', install: true, - install_dir: python.get_install_dir() / 'adwcustomizer', + install_dir: moduledir, configuration: configuration_data({ 'version': meson.project_version(), 'build_type': get_option('buildtype'), From 30ac48c58b3685a52a4b27b44d61fe2b90477094 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:47:30 +0200 Subject: [PATCH 134/149] format --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 142524a33..4849549f9 100644 --- a/src/main.py +++ b/src/main.py @@ -37,6 +37,7 @@ from .plugins_list import AdwcustomizerPluginsList from . import info + def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -664,7 +665,7 @@ def show_about_window(self, *_args): Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, - version=f"{info.version}" + version=f"{info.version}", ) about.present() From 63d59ffd66ece733b449f914eba171e4c2560345 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:51:30 +0200 Subject: [PATCH 135/149] udpate appstream metadata #77 --- ...github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index 9547dad90..86def6ddf 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -2,8 +2,11 @@ com.github.AdwCustomizerTeam.AdwCustomizer.desktop CC0-1.0 - MIT + GPL-3.0 - Change the look of Adwaita, with ease + Change the look of Adwaita, with ease - + https://github.com/AdwCustomizerTeam/AdwCustomizer/issues + https://github.com/AdwCustomizerTeam/AdwCustomizer + https://www.transifex.com/adwcustomizerteam/adwcustomizer/ + \ No newline at end of file From 6b64caccd48484c845c1c96e1f230fef629360f7 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 19:27:47 +0200 Subject: [PATCH 136/149] move menu button next to close button --- src/ui/window.blp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index 3b3abc816..da2d16a8c 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -45,11 +45,6 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } } - [end] - Gtk.MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } [end] MenuButton errors-button { @@ -58,6 +53,13 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { popover: errors-popover; } + + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + } Gtk.Box { From 2d7e04e3b7e0914df7a2bde1e2c9ffefdcafa9a5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 19:27:57 +0200 Subject: [PATCH 137/149] update appstream metadata --- data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index 86def6ddf..b6b00b08c 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -3,6 +3,8 @@ com.github.AdwCustomizerTeam.AdwCustomizer.desktop CC0-1.0 GPL-3.0 + Adwaita Manager + Change the look of Adwaita, with ease Change the look of Adwaita, with ease From 8d2facab423a51c45a07fd5debeca2b53703528f Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 20:12:34 +0200 Subject: [PATCH 138/149] switch back to main Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index 31be453cf..2bb34ef9d 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -71,7 +71,7 @@ { "type" : "git", "path" : ".", - "branch": "next" + "branch": "main" } ] } From 6405f813075861d95168c8018dba123736d029ed Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 20:13:21 +0200 Subject: [PATCH 139/149] auto instead of automatic Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 25d03cc83..2e35d7f4b 100644 --- a/src/window.py +++ b/src/window.py @@ -149,7 +149,7 @@ def setup_monet_page(self): self.monet_theme_row.set_title(_("Theme")) store = Gtk.StringList() - store.append("Automatic") + store.append("Auto") store.append("Dark") store.append("Light") self.monet_theme_row.set_model(store) From 405ad1d079e59ceaa645b28072ae6ccdd21d1f58 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:25:05 +0200 Subject: [PATCH 140/149] Update POT --- po/AdwCustomizer.pot | 229 +++++++++++++++++++++++++------------------ 1 file changed, 134 insertions(+), 95 deletions(-) diff --git a/po/AdwCustomizer.pot b/po/AdwCustomizer.pot index c45e60352..1d707805a 100644 --- a/po/AdwCustomizer.pot +++ b/po/AdwCustomizer.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-09 22:21+0300\n" +"POT-Creation-Date: 2022-08-12 11:24+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,11 +18,13 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: data/com.github.AdwCustomizerTeam.AdwCustomizer.desktop.in:3 -#: src/ui/window.blp:5 src/main.py:332 +#: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:6 +#: src/ui/window.blp:5 src/main.py:642 msgid "Adwaita Manager" msgstr "" #: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:7 +#: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:9 msgid "Change the look of Adwaita, with ease" msgstr "" @@ -70,225 +72,236 @@ msgstr "" msgid "Toggle Text Value" msgstr "" -#: src/ui/window.blp:13 src/main.py:245 +#: src/ui/window.blp:23 src/main.py:428 msgid "Apply" msgstr "" -#: src/ui/window.blp:20 -msgid "Save Preset" +#: src/ui/window.blp:35 +msgid "Presets" msgstr "" -#: src/ui/window.blp:36 -msgid "Presets" +#: src/ui/window.blp:42 +msgid "Save Preset" msgstr "" -#: src/ui/window.blp:58 +#: src/ui/window.blp:112 msgid "Built-in Presets" msgstr "" -#: src/ui/window.blp:73 +#: src/ui/window.blp:134 +msgid "Release Notes" +msgstr "" + +#: src/ui/window.blp:138 msgid "Reset Applied Color Scheme" msgstr "" -#: src/ui/window.blp:74 +#: src/ui/window.blp:142 msgid "About Adwaita Manager" msgstr "" -#: src/app_type_dialog.py:43 src/main.py:264 +#: src/app_type_dialog.py:44 src/main.py:474 msgid "Cancel" msgstr "" -#: src/main.py:123 +#: src/main.py:140 src/main.py:146 msgid "Failed to load preset" msgstr "" -#: src/main.py:139 +#: src/main.py:163 msgid "Open in File Manager" msgstr "" -#: src/main.py:142 +#: src/main.py:169 msgid "User Defined Presets" msgstr "" -#: src/main.py:203 +#: src/main.py:358 msgid "Unsaved changes" msgstr "" -#: src/main.py:243 +#: src/main.py:423 msgid "Apply this color scheme?" msgstr "" -#: src/main.py:244 +#: src/main.py:425 msgid "" "Warning: any custom CSS files for those app types will be irreversibly " "overwritten!" msgstr "" -#: src/main.py:251 +#: src/main.py:448 msgid "Reset applied color scheme?" msgstr "" -#: src/main.py:252 +#: src/main.py:449 msgid "Make sure you have the current settings saved as a preset." msgstr "" -#: src/main.py:253 +#: src/main.py:451 msgid "Reset" msgstr "" -#: src/main.py:260 +#: src/main.py:461 msgid "Save preset as..." msgstr "" -#: src/main.py:261 src/main.py:274 src/main.py:277 +#: src/main.py:463 src/main.py:487 src/main.py:501 #, python-brace-format msgid "" "Saving preset to {0}. If that preset already exists, it will be " "overwritten!" msgstr "" -#: src/main.py:265 +#: src/main.py:475 msgid "Save" msgstr "" -#: src/main.py:334 -msgid "Adwaita Manager Team" +#: src/main.py:541 +msgid "Scheme successfully saved!" msgstr "" -#. Translators: This is a place to put your credits (formats: "Name https://example.com" or "Name ", no quotes) and is not meant to be translated literally. -#: src/main.py:338 -msgid "translator-credits" +#: src/main.py:605 +msgid "Scheme set successfully!" msgstr "" -#: src/option.py:55 +#: src/main.py:637 +msgid "Reset successfully!" +msgstr "" + +#: src/main.py:644 +msgid "Adwaita Manager Team" +msgstr "" + +#: src/option.py:47 msgid "This option is only partially supported by the adw-gtk3 theme." msgstr "" -#: src/option.py:58 +#: src/option.py:52 msgid "This option is not supported by the adw-gtk3 theme." msgstr "" -#: src/option.py:97 +#: src/option.py:94 msgid "Not a color, see text value" msgstr "" -#: src/settings_schema.py:5 +#: src/settings_schema.py:23 msgid "Accent Colors" msgstr "" -#: src/settings_schema.py:6 +#: src/settings_schema.py:25 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, and entries, to indicate that a widget is important, interactive, or " "currently active." msgstr "" -#: src/settings_schema.py:10 src/settings_schema.py:33 -#: src/settings_schema.py:56 src/settings_schema.py:79 -#: src/settings_schema.py:102 +#: src/settings_schema.py:30 src/settings_schema.py:57 +#: src/settings_schema.py:84 src/settings_schema.py:111 +#: src/settings_schema.py:138 msgid "Standalone Color" msgstr "" -#: src/settings_schema.py:11 src/settings_schema.py:34 -#: src/settings_schema.py:57 src/settings_schema.py:80 -#: src/settings_schema.py:103 +#: src/settings_schema.py:32 src/settings_schema.py:59 +#: src/settings_schema.py:86 src/settings_schema.py:113 +#: src/settings_schema.py:140 msgid "" "The standalone colors are similar to the background ones, but provide better " "contrast when used as foreground color on top of a neutral background - for " "example, colorful text in a window." msgstr "" -#: src/settings_schema.py:16 src/settings_schema.py:39 -#: src/settings_schema.py:62 src/settings_schema.py:85 -#: src/settings_schema.py:108 src/settings_schema.py:125 -#: src/settings_schema.py:142 src/settings_schema.py:159 -#: src/settings_schema.py:194 src/settings_schema.py:217 -#: src/settings_schema.py:234 +#: src/settings_schema.py:38 src/settings_schema.py:65 +#: src/settings_schema.py:92 src/settings_schema.py:119 +#: src/settings_schema.py:146 src/settings_schema.py:163 +#: src/settings_schema.py:182 src/settings_schema.py:201 +#: src/settings_schema.py:242 src/settings_schema.py:267 +#: src/settings_schema.py:284 msgid "Background Color" msgstr "" -#: src/settings_schema.py:21 src/settings_schema.py:44 -#: src/settings_schema.py:67 src/settings_schema.py:90 -#: src/settings_schema.py:113 src/settings_schema.py:130 -#: src/settings_schema.py:147 src/settings_schema.py:164 -#: src/settings_schema.py:199 src/settings_schema.py:222 -#: src/settings_schema.py:239 +#: src/settings_schema.py:43 src/settings_schema.py:70 +#: src/settings_schema.py:97 src/settings_schema.py:124 +#: src/settings_schema.py:151 src/settings_schema.py:168 +#: src/settings_schema.py:187 src/settings_schema.py:206 +#: src/settings_schema.py:247 src/settings_schema.py:272 +#: src/settings_schema.py:289 msgid "Foreground Color" msgstr "" -#: src/settings_schema.py:28 +#: src/settings_schema.py:50 msgid "Destructive Colors" msgstr "" -#: src/settings_schema.py:29 +#: src/settings_schema.py:52 msgid "" "These colors are used for buttons to indicate a dangerous action, such as " "deleting a file." msgstr "" -#: src/settings_schema.py:51 +#: src/settings_schema.py:77 msgid "Success Colors" msgstr "" -#: src/settings_schema.py:52 +#: src/settings_schema.py:79 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, entries, and level bars, to indicate a success or a high level." msgstr "" -#: src/settings_schema.py:74 +#: src/settings_schema.py:104 msgid "Warning Colors" msgstr "" -#: src/settings_schema.py:75 +#: src/settings_schema.py:106 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, entries, and level bars, to indicate a warning or a low level." msgstr "" -#: src/settings_schema.py:97 +#: src/settings_schema.py:131 msgid "Error Colors" msgstr "" -#: src/settings_schema.py:98 +#: src/settings_schema.py:133 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, and entries, to indicate a failure." msgstr "" -#: src/settings_schema.py:120 +#: src/settings_schema.py:158 msgid "Window Colors" msgstr "" -#: src/settings_schema.py:121 +#: src/settings_schema.py:159 msgid "These colors are used primarily for windows." msgstr "" -#: src/settings_schema.py:137 +#: src/settings_schema.py:175 msgid "View Colors" msgstr "" -#: src/settings_schema.py:138 +#: src/settings_schema.py:177 msgid "" "These colors are used in a variety of widgets, such as text views and " "entries." msgstr "" -#: src/settings_schema.py:154 +#: src/settings_schema.py:194 msgid "Header Bar Colors" msgstr "" -#: src/settings_schema.py:155 +#: src/settings_schema.py:196 msgid "" "These colors are used for header bars, as well as widgets that are meant to " "be visually attached to it, such as search bars or tab bars." msgstr "" -#: src/settings_schema.py:169 +#: src/settings_schema.py:211 msgid "Border Color" msgstr "" -#: src/settings_schema.py:170 +#: src/settings_schema.py:213 msgid "" "The border color has the same default value as a foreground color, but " "doesn't change along with it. This can be useful if a light window has a " @@ -297,11 +310,11 @@ msgid "" "example, separators between the two header bars in a split header bar layout." msgstr "" -#: src/settings_schema.py:175 +#: src/settings_schema.py:219 msgid "Backdrop Color" msgstr "" -#: src/settings_schema.py:176 +#: src/settings_schema.py:221 msgid "" "The backdrop color is used instead of the background color when the window " "is not focused. By default it's an alias of the window's background color " @@ -309,113 +322,139 @@ msgid "" "it to a value matching your header bar background color." msgstr "" -#: src/settings_schema.py:181 src/settings_schema.py:204 -#: src/settings_schema.py:251 +#: src/settings_schema.py:227 src/settings_schema.py:252 +#: src/settings_schema.py:301 msgid "Shade Color" msgstr "" -#: src/settings_schema.py:182 +#: src/settings_schema.py:229 msgid "" "The shade color is used to provide a dark border for header bars and similar " "widgets that separates them from the main window." msgstr "" -#: src/settings_schema.py:189 +#: src/settings_schema.py:237 msgid "Card Colors" msgstr "" -#: src/settings_schema.py:190 +#: src/settings_schema.py:238 msgid "These colors are used for cards and boxed lists." msgstr "" -#: src/settings_schema.py:205 +#: src/settings_schema.py:254 msgid "" "The shade color is used for shadows that are used by cards to separate " "themselves from the window background, as well as for row dividers in the " "cards." msgstr "" -#: src/settings_schema.py:212 +#: src/settings_schema.py:262 msgid "Dialog Colors" msgstr "" -#: src/settings_schema.py:213 +#: src/settings_schema.py:263 msgid "These colors are used for message dialogs." msgstr "" -#: src/settings_schema.py:229 +#: src/settings_schema.py:279 msgid "Popover Colors" msgstr "" -#: src/settings_schema.py:230 +#: src/settings_schema.py:280 msgid "These colors are used for popovers." msgstr "" -#: src/settings_schema.py:246 +#: src/settings_schema.py:296 msgid "Miscalleneous Colors" msgstr "" -#: src/settings_schema.py:247 +#: src/settings_schema.py:297 msgid "Colors that don't fit in any particular group." msgstr "" -#: src/settings_schema.py:252 +#: src/settings_schema.py:303 msgid "" "The shade color is used by inline tab bars, as well as the transitions in " "leaflets and flaps, and info bar borders." msgstr "" -#: src/settings_schema.py:257 +#: src/settings_schema.py:309 msgid "Scrollbar Outline Color" msgstr "" -#: src/settings_schema.py:258 +#: src/settings_schema.py:311 msgid "" "The scrollbar outline color is used by scrollbars to ensure that overlay " "scrollbars are visible regardless of the content color." msgstr "" -#: src/settings_schema.py:267 +#: src/settings_schema.py:319 msgid "Blue" msgstr "" -#: src/settings_schema.py:272 +#: src/settings_schema.py:320 msgid "Green" msgstr "" -#: src/settings_schema.py:277 +#: src/settings_schema.py:321 msgid "Yellow" msgstr "" -#: src/settings_schema.py:282 +#: src/settings_schema.py:322 msgid "Orange" msgstr "" -#: src/settings_schema.py:287 +#: src/settings_schema.py:323 msgid "Red" msgstr "" -#: src/settings_schema.py:292 +#: src/settings_schema.py:324 msgid "Purple" msgstr "" -#: src/settings_schema.py:297 +#: src/settings_schema.py:325 msgid "Brown" msgstr "" -#: src/settings_schema.py:302 +#: src/settings_schema.py:326 msgid "Light" msgstr "" -#: src/settings_schema.py:307 +#: src/settings_schema.py:327 msgid "Dark" msgstr "" -#: src/window.py:70 +#: src/window.py:104 +msgid "Monet Engine" +msgstr "" + +#: src/window.py:107 +msgid "" +"Monet is an engine that generates Material Design 3 palette from backgrounds " +"color. The generation can be slow" +msgstr "" + +#: src/window.py:112 +msgid "Background Image" +msgstr "" + +#: src/window.py:118 +msgid "Choose a file" +msgstr "" + +#: src/window.py:137 +msgid "Tone" +msgstr "" + +#: src/window.py:149 +msgid "Theme" +msgstr "" + +#: src/window.py:189 msgid "Palette Colors" msgstr "" -#: src/window.py:71 +#: src/window.py:192 msgid "" "Named palette colors used by some applications. Default colors follow the GNOME Human " From deb7a6f40df1acb07f1d291f3c471dc81fa71cd5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:27:19 +0200 Subject: [PATCH 141/149] add devel flatpak --- .github/workflows/flatpak-nightly.yml | 4 +- ...AdwCustomizerTeam.AdwCustomizer.Devel.json | 82 +++++++++++++++++++ 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index fa297f23a..613457218 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -14,6 +14,6 @@ jobs: uses: actions/checkout@v3.0.2 - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 with: - bundle: com.github.AdwCustomizerTeam.AdwCustomizer.flatpak - manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.json + bundle: com.github.AdwCustomizerTeam.AdwCustomizer.Devel.flatpak + manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json cache-key: flatpak-builder-${{ github.sha }}-nightly \ No newline at end of file diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json b/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json new file mode 100644 index 000000000..31be453cf --- /dev/null +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json @@ -0,0 +1,82 @@ +{ + "app-id" : "com.github.AdwCustomizerTeam.AdwCustomizer", + "runtime" : "org.gnome.Platform", + "runtime-version" : "master", + "sdk" : "org.gnome.Sdk", + "command" : "adwcustomizer", + "finish-args" : [ + "--share=network", + "--share=ipc", + "--socket=fallback-x11", + "--device=dri", + "--socket=wayland", + "--filesystem=xdg-config/gtk-3.0", + "--filesystem=xdg-config/gtk-4.0" + ], + "cleanup" : [ + "/include", + "/lib/pkgconfig", + "/man", + "/share/doc", + "/share/gtk-doc", + "/share/man", + "/share/pkgconfig", + "*.la", + "*.a" + ], + "modules" : [ + "pypi-dependencies.json", + { + "name" : "blueprint-compiler", + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "url" : "https://gitlab.gnome.org/jwestman/blueprint-compiler", + "branch" : "main" + } + ] + }, + { + "name": "libportal", + "buildsystem": "meson", + "config-opts": ["-Ddocs=false", "-Dvapi=false", "-Dbackends=gtk4"], + "sources": [ + { + "type": "git", + "url": "https://github.com/flatpak/libportal", + "branch": "main" + } + ] + }, + { + "name": "material-color-utilities-python", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"material_color_utilities_python~=0.1.0\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "path": "./monet/material_color_utilities_python-0.1.0-py3-none-any.whl", + "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" + } + ] + }, + { + "name" : "adwcustomizer", + "builddir" : true, + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "path" : ".", + "branch": "next" + } + ] + } + ], + "build-options" : { + "env" : { } + } +} From e13af9f723333ad3b2311b4cf9393f2d2a9d37d8 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:28:57 +0200 Subject: [PATCH 142/149] update license --- po/AdwCustomizer.pot | 2 +- po/update_potfile.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/po/AdwCustomizer.pot b/po/AdwCustomizer.pot index 1d707805a..13f7a243a 100644 --- a/po/AdwCustomizer.pot +++ b/po/AdwCustomizer.pot @@ -1,6 +1,6 @@ # Adwaita Manager POT file # Copyright (C) 2022 Adwaita Manager Team -# This file is distributed under the MIT/X11 license. +# This file is distributed under the GNU GPLv3 license. # Adwaita Manager Team, 2022. # #, fuzzy diff --git a/po/update_potfile.sh b/po/update_potfile.sh index b20cc2c9e..8c9c7f35f 100755 --- a/po/update_potfile.sh +++ b/po/update_potfile.sh @@ -3,7 +3,7 @@ po_dir=$(dirname "$(realpath "$0")") xgettext -f "$po_dir"/POTFILES -o "$po_dir"/AdwCustomizer.pot --add-comments=Translators --keyword=_ --keyword=C_1c,2 --from-code=UTF-8 sed -i "s/SOME DESCRIPTIVE TITLE./Adwaita Manager POT file/" "$po_dir"/AdwCustomizer.pot sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/$(date +%Y) Adwaita Manager Team/" "$po_dir"/AdwCustomizer.pot -sed -i "s@same license as the PACKAGE package.@MIT/X11 license.@" "$po_dir"/AdwCustomizer.pot +sed -i "s@same license as the PACKAGE package.@GNU GPLv3 license.@" "$po_dir"/AdwCustomizer.pot sed -i "s/FIRST AUTHOR , YEAR./Adwaita Manager Team, $(date +%Y)./" "$po_dir"/AdwCustomizer.pot regex="$po_dir/([a-zA-Z_]*).po" From a9fe0b768dc3df47b20f63c3697a1b0e79e8efa4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:30:51 +0200 Subject: [PATCH 143/149] reverse button order --- src/ui/window.blp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index da2d16a8c..ba11eeb97 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -29,6 +29,12 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { stack: view_stack; } + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + [end] MenuButton presets-dropdown { menu-model: presets-menu; @@ -54,11 +60,6 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } - [end] - Gtk.MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } } From b23768a060e4f8cdae68493158d5342a0c17eaa4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:38:35 +0200 Subject: [PATCH 144/149] change card fg color --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 4849549f9..50f452655 100644 --- a/src/main.py +++ b/src/main.py @@ -278,7 +278,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), - "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), + "card_fg_color": self.rgba_from_argb(dark_theme.onSurface), "card_shade_color": self.rgba_from_argb(dark_theme.shadow), "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), From 36ec03fe62cfd1a38580200a8c55bdd2404a7939 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:49:29 +0200 Subject: [PATCH 145/149] update releases notes --- ...ustomizerTeam.AdwCustomizer.appdata.xml.in | 16 +++++++++ src/main.py | 34 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index b431f38a0..f75d2b327 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -104,6 +104,22 @@ First release of Adwaita Manager. + + Add AdwViewSwitcher in the header bar. + Move CSS to the "Advanced" tab + Move the rest to the "Colours" tab + Add Monet tab which generates a theme from a background + Add disk saved and disk unsaved icon in the header bar + Update about dialog + Change license to GNU GPLv3 + Begin plugin support + Move preset selector to a drop-down called palette (icon palette) + Add ability to apply the theme onlyfor dark theme or oy for light theme + Automaticly use Adwaita-dark preset if the user prefered scheme is dark. + Added Flatpak CI build + Added issue template for bug and feature request + `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch + diff --git a/src/main.py b/src/main.py index 50f452655..bed21e1f7 100644 --- a/src/main.py +++ b/src/main.py @@ -666,6 +666,40 @@ def show_about_window(self, *_args): copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, version=f"{info.version}", + release_notes=""" + + + Add AdwViewSwitcher in the header bar. + Move CSS to the "Advanced" tab + Move the rest to the "Colours" tab + Add Monet tab which generates a theme from a background + Add disk saved and disk unsaved icon in the header bar + Update about dialog + Change license to GNU GPLv3 + Begin plugin support + Move preset selector to a drop-down called palette (icon palette) + Add ability to apply the theme onlyfor dark theme or oy for light theme + Automaticly use Adwaita-dark preset if the user prefered scheme is dark. + Added Flatpak CI build + Added issue template for bug and feature request + `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch + + + """, + comments=""" + + Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. + + With Adwaita Manager you can: + + Change any color of Adwaita theme + Apply Material 3 colors from wallaper + Use other users presets + Change advanced options with CSS + Extend functionality using plugins + + This app is written in Python and uses GTK 4 and libadwaita. + """ ) about.present() From 262a690da3ab80eb3ca9bed8fff6b358ee981864 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:54:45 +0200 Subject: [PATCH 146/149] remove markup --- src/main.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index bed21e1f7..1f93c3fb5 100644 --- a/src/main.py +++ b/src/main.py @@ -667,7 +667,6 @@ def show_about_window(self, *_args): license_type=Gtk.License.GPL_3_0, version=f"{info.version}", release_notes=""" - Add AdwViewSwitcher in the header bar. Move CSS to the "Advanced" tab @@ -684,13 +683,11 @@ def show_about_window(self, *_args): Added issue template for bug and feature request `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch -
Q*O> zUKbJ=ennydC{Ffh2Y0z6k1`xs2v<8_wC%g+6^PUPL?yrs%DF&Or&v9o{RG0uk{aqN zWT7)jw=`a_L_a%z;H3E^SHf$>=(`VpzyLMx{FW?HJ(q8(xFQ&9t%*Wb*>#{y&^uTe zM%is3J$R;Z)f$$5E$M)ry_M>76bzwoz-~Yenc?DBkqOBf_xMU-GW{)KZBEot{XD0! z!H^FW7v*16FGPcA2dB-*L#D9m!uxTrYnE~iH(+DJrq!@ftkuIs;)9c6+s#*=3?5CyF%J#~nX$A} z)zjKK0i&T;Ao;z{8v|nL(ZsvL!05DVK-O{g zT=`joGp#H+E-a3N;y~82-cYh@^G1^d*k7ZW4hZQ?Qs+VvOP>4y25W6GRC%ccqa!@6 z#IR1Mjx;N=Qu9ny0Kb;p$$!wQZiL(9DyQpwF;#=@LXim}!oh#LEx@<`x-*fy)9pP1=Q>p8d@Mt^$$;XPJx}3TaP?alvG8;9;v1K$- zkaN`%@!`Tfr4l5 zqUns|6TIm^+b+z@E3>|<_g4d@chT!Rk>_|NvuDAR-`_o0*ch0Z{Gm?!WA~7tV)JI1 z5$S1F@2wHxfgol!oQ1zLjuRZQ4N8FQqc4&}oYj|@g^bNw6Ws6KW<1ccN&vc#IQ_RP zkDHguC3szDW`p_2pDH!>TA*0cp^)xnEI^mrieF>IOznN2H;EaFZ>NbE2xXhx?k)7# zCE10(@nA4;^-Oy*z#W_Pl|+V7Ie_Za050r%Wr57=BpBr*u$j8+L)c!RUPifqmtV|? zBU}7RyF$}zJN?eN90pX33NFhSN@?i>s{^Sq2wuC6x^d*#oGnA21^Uv$fe)ZV8)1YC zA<{z-F~0`Z=+&-zArun_Ubw$>RS%q8?G7S3t77a5&-FB90C>1BLn9;6Ti_&PJ+y)3 zK4B9_Jl{S-tP~*e({)#qPX1M?p6zrk*s4$|Ex!p9f3tRi(o^7X>y0HJ0iF58I#JN5 ztVW;uAG#aMND4Z1m2re<5FVAUZ(^9!`cmekYM#^+G~g7mi8h@p6H_j#w!~H>K#+F)eP?#$L`!^SWsaS;Q$rjcskY5krlNu73YH}v z8a<-kRs4*5p@UfmbChZ&WSKrKmJRBt;|XE`0E=tudrp6}?vfFeK7~a<;IePtLTvnD ze6r*s2NgHMdr`zYK_;0%kl9zVgrYrjqm)+Bv?^jktJd$Xe1}>bDHMP2|N!J!($cIFTLWSMlX1!hkanNvKAH z(egZzYEv&uMc1J*>kU)~0Zv$?RI9)vo`PUVgJEwH4+kwjkGv;HlfTG9Oe26 z7pqN+zOF&2ILMi zJbkq)o3bKI5Cgv@+T6=6PkuEbFy`wM9}}4C+o-2*py384HnL=0Fm(}aaz?8>Qnb<1 z+f~-cuX!L=YYlt<`;_$&Z;sD@m*vf6B!s8FC=ep|*L-NMUc_f!^y_q6@P#bxs~sw-bRa-W)Lm*KUjWy1wh< z3}in`j8p_%0sk$Gnq`i8+P3W?HB1Yt#*=gufr=W;S3>KDF|vlQn6XNgy&2*F9={Yh z(#jl9rMYw!(O}1Ul~>%|diE#ynxDoWm%yT!7@c|p*$Mb^-kKHdvI{9CPjaBYKIOGw zrOn-x-fTU%QAQUH>|iU9$;v#$8zSc$DtDkt&lO;%ev~e$<{0(ZauOSa5t@CPzR1Lq zm-Fs*e#Mx7p_(VeEu}@I;eeSEbWq<~u0W~)?hP%SgQpkO8{GPdP&%|ZxNkdMm!FZ4 z?WPPhvBCe*hBne_;sA(2UE@I<@v0Z4nLPgKoK*k;cRxn{DOFwrr*Z<0GzrRkD9a*+ zU)YGF?b?m$Ss$#T@9to+CIQvD7rg!ph}K)f67mIA%s)OU>h&MvmOr3<+SRXxbEj5*w&Jq=cBgi9a`>TV@kbATUTWSeE!(CEB0a|dg&P;^Cvhf|CB8Q-E{@k- z%`NZ_Ewy9KXt2GePljx>_8C+9RfDXcrx=~R3qHp0T-fzq(UYiI$R2h+(Xi%KJn zD~K~k@RJWCd>>v5zU~esjnWy5i=&tiIS6DR)>E8w>r$D$ku$fV{6c(5;Jotn8YKHu z>v!opyW`w`dkRIy8SxKh#UuG9zB)D=g+yMP{*AcUK%=An%Dx|0b1^W!@u|(j5~ld+ zm5GQB&eu}f596*h`+ZyxR#L^*=~AR9nwedFnK9s-qD32wR7In3 z`t8}+%+$m0>$;1SO@jx)EADvmx}>UvvM`V*2sBM3FYAc-6rmWBr`zu^rV zbELWK;y0Y7$YdEgVwx;w+xd0;@EG$Bw^ z`A*f~dq`J%WO)!V?0xViMNcqeW<}v7AZqYU&&cK;B{>%|YA>cYTq2#o^;c@oTAvi2 zP=ws`zrV2aXgm2Zqdwo$;=}!ujg`}n>)(I%_A*tQAENlr z!Yywd{e@wysTdwBn~|DFJ_jLKDAIoBA7RwiEU;lip^8>kts8xJx-ZceiwA1a02Cv$ z>NtKL=~}2or6Gt$=Rlu$1FfMTWwL&!Z({OlxQR*ob+NM7i7F3ehOJxY=MsidnEIW| zA>*c#uv&!_^;;9jU?f7qP1MK@SNcXnbLO&Ip#RWsuigqgUmQ&%9^T> zrs~lIl4PnN*CV`bgmi6FDCk(^N*jyg_au&hm)I|4R=WC<6{9vAIip~BYlhSbOqk~i z#+o7}S=e#;bM;7dth!-a_!Loyd(by84<0^O7$sXLt2@GjYdJ8Y7@G_Ybx2Vg+p%Nd z>6#P|0`x!ft6wC9O#yP?O1niozu0>L-MRK(go+s67JzC#$Da(xoPwwc06mC#-> z&nP3ZPmQMwNXfHN`Yya!Yw$6es`>Y_u;|S?atu^3jFgrhz3HW%V5}K`T_1$wcpMOQ>I3cWXga}H7Lg%(-c62p5Bk6#6Olwk5`4K3qMcU*>8f^||1 zM$=o#^OP9aT)jGqp$ErN?>RlCwXahl%@J&^+S1|T@i5+3KB>5ID>zHJfZ;lxyi<%e zOt4o9*>z)CO|a7%jNHl`x=k0dx9kx837g%@U}>OTs2mMF0&?Qv?dh^w7|!(T7Ka4@ z0wDT>9Q8=1E*{9<^a0P6oU{7AmB$6%b>RJ4NnYHJF*Q-mGw*c?8247a|%oa zw+XOgDV!N&cU@4LVP0u$pO2{*v{p4Sci5l2A}9&99Zo^sUW-^GhsJ#Fd!7aGIbol5 zR^g*frXg6hmmA{P+XCMKh|N@>573U?15=!VR3CotgM|oU#(+j zspPFy^CzebHSBr6G~!EGP~FFDwf+otO&yy=N&vT%ns~^!j3#++Y8aDs!=F;# zpL;+BYiI?-9!n%Xg_Nr;Kbz>Z7Ej!wc$(@~F& zjMqG`H!SN8Z$_o*q-X~jsud{*-q2Bf1p9EHVGq8&o3!VFaR?EQk-uY1u0a)#mQdjE zo~!_LRt4v9XL~pQfP6>A0r;;op#;K$P3Gfs1*@JzAb-Ob{XZ%xE2b~Qog=^Im7MJin4i|yP`8&5@K5oEY6DzIMk6M+LE1sY^+C$-;?WFnRRkJZZI7y!FK}dUS zW_V;L^~7oj7{HY#)|C&%h1JM-*f4>uGHrL=<1<2>Y-VoNq6 z=cR@H?{`xF@jw;DMBXThw#`Y#p@*dLtP0K3LtszqHr zmqln4OU8&_2cG-9M_|<50qkaC`2wdyAf~XM2nZx{kReF>H=&lN$Db6oy(M#|4{i~^ zx${zXAGPBMJ^WI19jZM%Kf%Tq-hq9V?$B})-W3~SklHllw_v?RPF`qkAX&+q!LYL! zQDoX<5Qz0!o-I6I@`lQAAeO0Q-A2N>)p-uR8I@%*rT#hrE>Cq_BKTaL+*u9XSE}7T zg1kkzZuQ|S423ov%4F>K-Y9-8V<1w})hw1y8Qi5T{GK?gnVw_` zCwmL95YP2sV6H3anUgf)h2N>=`^Gxa^=4NDvqv&UbP=DL>QTtXO}BakwY0H0%>*~r zwI?srO>|$0x|@N;jv8L11FGXIhGx*Hck+4XX=tN993A6pv`9xyj3$g!3u3~sfPyBG zjpCZtbNsK3a0393UgcvweTTwN!rwWgFIM7M{-sqD_PcEa3wO69Q{~E zz>l0tPf~nqg{BMR7D<`sTsqa=7(!MFe!k;mt(c<@;;}YWqxh{6b;~`^k;;5%3hCtA zgbQT?>8A}mVq?2TcnPUOMIq5Q^dSagcrg%`7G@P*TE^Ax5aPa<^nI1SULei+i2}&u zxR+&ZEHeD$XmQ-L>pblMx6sx;yGuw-vsJ7r5FDiCI30u_g--g$*7 zOGkm~;XPPp4e~b0atwvr;ege7$VCTzvL~oTIy?qUmiNPF@q9wsApc_3>uMy@MpZDz zNLsp zE=Q>atDvPI!Td`~v=t%d{xVWVZOJIVnl{x{w?O4;9dX*IyE^ew{#U1p=@8 zW_RjhVy4{D<>6eD2l>5Gl=L2?v=+BNC1=;06GrNb5HBLya#->H%?Ji^hu4xhOaTzb zzTi2p`&P(RhI)Xmzw=o&P0%5Cw||9~mj(tw1AX@7`9HE?J^$g40`U9s?e8*E{aa3~ zm%u;X{(R*8qx^6~`dI*e9?w7i9q@moym|@$GUe4T_~GA%|Cs>mCH4=jpH=^nCFW-V z_+33~Y5ZN)U*wE=3H~x?%r9_}=hOM`fd9-O^Ah=`c=j*kc;w$h{!>c(CGJZx%wM>8 z&-dQHQ{(?t8uKO157?hi{f9aHX94)R6aPKUzhs~OOP72p684K>^q(-ikPLg-j+cT} zzgP-M|3N!m%2&Ol`2qXCKd!@9e^2wTpu_+2xLzt8{c4B+`9EOzU-gb&w&tZ+%`dKX z%74K1vswQpUGtLZr6R~LrtRk}fPdGUe-iv#u;!ooATMcNDn|UGp?&tD{D08=(vNsa z^)le}7nS<+7WMx_^&|ZBCCd-gpZ)EJJN?fB@LL!9dzSxnu78RD(z*T@KC|#|uR(h{yXR|Tx4IuzjTrPRe7q{zYG7H9f1G6huwT5Scxi9=MX~k& sp!jKhc**ke5dMpW&Ger) Date: Thu, 11 Aug 2022 11:29:51 +0200 Subject: [PATCH 064/149] use local file --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index d162543b7..31be453cf 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -57,7 +57,7 @@ ], "sources": [ { - "type": "url", + "type": "file", "path": "./monet/material_color_utilities_python-0.1.0-py3-none-any.whl", "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" } From 4d74bc5cf92bbe1813f5b1e6e5e0e51a72558831 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 11:49:04 +0200 Subject: [PATCH 065/149] add tone row --- src/window.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 3a705f98a..11b6724fc 100644 --- a/src/window.py +++ b/src/window.py @@ -81,11 +81,16 @@ def on_file_picker_button_clicked(self, *args): def on_monet_file_chooser_response(self, widget, response): if response == Gtk.ResponseType.ACCEPT: - image_file = self.monet_file_chooser_dialog.get_file() - image_basename = image_file.get_basename() + self.monet_image_file = self.monet_file_chooser_dialog.get_file() + image_basename = self.monet_image_file.get_basename() self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() + self.monet_img = Image.open(self.monet_image_file) + self.monet_theme = themeFromImage(self.monet_img) + self.monet_palette = self.monet_theme["palette"] + self.get_application().update_theme_from_monet(self.monet_theme) + def setup_monet_page(self): @@ -126,6 +131,10 @@ def setup_monet_page(self): self.content_monet.add(monet_pref_group) + self.tone_row = Adw.ComboRow() + self.tone_row.set_title(_("Tone")) + print(dir(self.tone_row)) + def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() for app_type in settings_schema["custom_css_app_types"]: From aad88ff496f9aa86a198cc763b40fb002d9356aa Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:03:21 +0200 Subject: [PATCH 066/149] add tone row --- src/window.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 11b6724fc..19122fad4 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] - self.get_application().update_theme_from_monet(self.monet_theme) + #self.get_application().update_theme_from_monet(self.monet_theme, self.tone_row.get_selected_item()) def setup_monet_page(self): @@ -133,6 +133,22 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) + + store = Gtk.ListStore(str) + store_values = [ + "1", + "5", + "10", + "15", + "20", + "25", + "United Kingdom", + "United States of America", + "Uruguay", + ] + for v in store_values: + store.append([v]) + self.tone_row.set_list_factory(store) print(dir(self.tone_row)) def setup_plugins_page(self): From 07e22ed96ec3235362fe97b9eba18dc42d3e7607 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:04:09 +0200 Subject: [PATCH 067/149] update list factory --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 19122fad4..f84a5318a 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListStore(str) + store = Gtk.ListItemFactory(str) store_values = [ "1", "5", From e1ff0aa84875576437f24bf4eb582d27a9d37b03 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:04:34 +0200 Subject: [PATCH 068/149] fix bug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index f84a5318a..8353a828f 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListItemFactory(str) + store = Gtk.ListItemFactory() store_values = [ "1", "5", From ce2067fd00189e92983b24011ea4127c983e9300 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:05:14 +0200 Subject: [PATCH 069/149] add debug info --- src/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window.py b/src/window.py index 8353a828f..7bc102f3e 100644 --- a/src/window.py +++ b/src/window.py @@ -135,6 +135,7 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.ListItemFactory() + print(dir(store)) store_values = [ "1", "5", From 11448c487a8b9a63e843163b5332e1438e99268b Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:06:23 +0200 Subject: [PATCH 070/149] update tone row --- src/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 7bc102f3e..a99b42d00 100644 --- a/src/window.py +++ b/src/window.py @@ -147,8 +147,7 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - for v in store_values: - store.append([v]) + store.set_data(store_values) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From c81d7af57511aa01501975cab814d9d510c70e0d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:07:34 +0200 Subject: [PATCH 071/149] update tone row --- src/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index a99b42d00..0e61c581d 100644 --- a/src/window.py +++ b/src/window.py @@ -147,7 +147,8 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - store.set_data(store_values) + store.replace_qdata(store_values) + store.replace_data(store_values) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From 352ae0c33575f76f96b6c8371f7aa79153cafcef Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:09:18 +0200 Subject: [PATCH 072/149] use GtkStringList --- src/window.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/window.py b/src/window.py index 0e61c581d..b35550b53 100644 --- a/src/window.py +++ b/src/window.py @@ -134,7 +134,7 @@ def setup_monet_page(self): self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) - store = Gtk.ListItemFactory() + store = Gtk.StringList() print(dir(store)) store_values = [ "1", @@ -147,8 +147,8 @@ def setup_monet_page(self): "United States of America", "Uruguay", ] - store.replace_qdata(store_values) - store.replace_data(store_values) + for v in store_values: + store.append([v]) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From c50cb8d000238e685bab787f1ad7518763088934 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:09:42 +0200 Subject: [PATCH 073/149] fix error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b35550b53..b28bac1d1 100644 --- a/src/window.py +++ b/src/window.py @@ -148,7 +148,7 @@ def setup_monet_page(self): "Uruguay", ] for v in store_values: - store.append([v]) + store.append(v) self.tone_row.set_list_factory(store) print(dir(self.tone_row)) From 5744873bb80e64db6949e5ac5bff2e2f9a2df308 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:10:26 +0200 Subject: [PATCH 074/149] use set_model --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b28bac1d1..258025af3 100644 --- a/src/window.py +++ b/src/window.py @@ -149,7 +149,7 @@ def setup_monet_page(self): ] for v in store_values: store.append(v) - self.tone_row.set_list_factory(store) + self.tone_row.set_model(store) print(dir(self.tone_row)) def setup_plugins_page(self): From 35f78ffb9cfdbac53cd1468e2eb3ab99dc17db9c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:11:07 +0200 Subject: [PATCH 075/149] add tone row to the page --- src/window.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 258025af3..434c417a6 100644 --- a/src/window.py +++ b/src/window.py @@ -135,7 +135,6 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - print(dir(store)) store_values = [ "1", "5", @@ -150,7 +149,7 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - print(dir(self.tone_row)) + self.content_monet.add(self.tone_row) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From d3d5c3987e153922a51467b62499900a522b5895 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:11:47 +0200 Subject: [PATCH 076/149] update pref group --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 434c417a6..7ce2b1cf8 100644 --- a/src/window.py +++ b/src/window.py @@ -129,7 +129,6 @@ def setup_monet_page(self): self.palette_picker.add_suffix(picker) monet_pref_group.add(self.palette_picker) - self.content_monet.add(monet_pref_group) self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) @@ -149,7 +148,8 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - self.content_monet.add(self.tone_row) + monet_pref_group.add(self.tone_row) + self.content_monet.add(monet_pref_group) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From 7c50a5dc38c068761ecb9e509f6a62b7e301988e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:19:28 +0200 Subject: [PATCH 077/149] set colorpalette --- src/window.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/window.py b/src/window.py index 7ce2b1cf8..4ae21ec71 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,25 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] - #self.get_application().update_theme_from_monet(self.monet_theme, self.tone_row.get_selected_item()) + self.tone = self.tone_row.get_selected_item() + + i = 0 + """ + {'primary': , + 'secondary': , + 'tertiary': , + 'neutral': , + 'neutralVariant': , + 'error': } + """ + print(self.monet_palette) + print(self.monet_theme) + for color in self.monet_palette.values(): + i+=1 + color = color.tone(self.tone) + self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + + #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): @@ -119,7 +137,7 @@ def setup_monet_page(self): self.palette_picker.set_title(_("Monet Palette")) self.palette_picker self.palette_pickers = {} - for i in range(5): + for i in range(6): i = i+1 picker = Gtk.ColorButton() picker.set_name(str(i)) @@ -141,9 +159,7 @@ def setup_monet_page(self): "15", "20", "25", - "United Kingdom", - "United States of America", - "Uruguay", + "30" ] for v in store_values: store.append(v) From b2a5ddd77d5096076242d8cf9192f9079b8181ae Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:20:34 +0200 Subject: [PATCH 078/149] add debug --- src/window.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/window.py b/src/window.py index 4ae21ec71..b554ae472 100644 --- a/src/window.py +++ b/src/window.py @@ -86,6 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() + dir(self.monet_img) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From 26a74fe18f7075f6733f52b76da136449ff534db Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:21:09 +0200 Subject: [PATCH 079/149] fix bug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b554ae472..fb291e46c 100644 --- a/src/window.py +++ b/src/window.py @@ -86,7 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - dir(self.monet_img) + dir(self.monet_image_file) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From f3755eb8a1dc1dc32a0820af5b3ae53cbba5a0da Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:21:48 +0200 Subject: [PATCH 080/149] print debug --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index fb291e46c..de17ed356 100644 --- a/src/window.py +++ b/src/window.py @@ -86,7 +86,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - dir(self.monet_image_file) + print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] From dbff368414eb89e07e9d65a284aad21806b23ef0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:24:58 +0200 Subject: [PATCH 081/149] use path instead of g object --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index de17ed356..83dec7b83 100644 --- a/src/window.py +++ b/src/window.py @@ -87,7 +87,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() print(dir(self.monet_image_file)) - self.monet_img = Image.open(self.monet_image_file) + self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palette"] self.tone = self.tone_row.get_selected_item() From 028bad472421942cd85ece601bfe80362dfccb8e Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:25:47 +0200 Subject: [PATCH 082/149] fix typo error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 83dec7b83..4780fa299 100644 --- a/src/window.py +++ b/src/window.py @@ -89,7 +89,7 @@ def on_monet_file_chooser_response(self, widget, response): print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) - self.monet_palette = self.monet_theme["palette"] + self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() i = 0 From d1aa1a93cd637ad3b5cdb7a573c21a5e2e459c29 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:27:07 +0200 Subject: [PATCH 083/149] convert into int --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 4780fa299..4f5d6a4c8 100644 --- a/src/window.py +++ b/src/window.py @@ -86,11 +86,11 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - print(dir(self.monet_image_file)) self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() + print(dir(self.tone)) i = 0 """ @@ -105,7 +105,7 @@ def on_monet_file_chooser_response(self, widget, response): print(self.monet_theme) for color in self.monet_palette.values(): i+=1 - color = color.tone(self.tone) + color = color.tone(int(self.tone)) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) From d08f4acba7bd2fa80014900ad50437f8b8b3df31 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:28:31 +0200 Subject: [PATCH 084/149] fix error --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 4f5d6a4c8..275917824 100644 --- a/src/window.py +++ b/src/window.py @@ -90,7 +90,7 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - print(dir(self.tone)) + print(dir(self.tone.get_string())) i = 0 """ @@ -105,7 +105,7 @@ def on_monet_file_chooser_response(self, widget, response): print(self.monet_theme) for color in self.monet_palette.values(): i+=1 - color = color.tone(int(self.tone)) + color = color.tone(int(self.tone.get_string())) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) From 20d21ba39cd6a7c521ba1004e13a1f550b1bd4f5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:29:49 +0200 Subject: [PATCH 085/149] print debug --- src/window.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 275917824..866929fe4 100644 --- a/src/window.py +++ b/src/window.py @@ -90,7 +90,6 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_theme = themeFromImage(self.monet_img) self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - print(dir(self.tone.get_string())) i = 0 """ @@ -106,8 +105,10 @@ def on_monet_file_chooser_response(self, widget, response): for color in self.monet_palette.values(): i+=1 color = color.tone(int(self.tone.get_string())) + print(color) self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + self.palette_pickers["1"].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): From fd5e7ac4994d76520564c938527751523d7b26bb Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:38:57 +0200 Subject: [PATCH 086/149] add toast when reset --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index e94f41da8..3b2e0e9a2 100644 --- a/src/main.py +++ b/src/main.py @@ -433,6 +433,7 @@ def reset_color_scheme(self, widget, response): file.delete() except Exception: pass + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( From 071bcaf2145fbdd43adb394cd8083e9ebf43dfff Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:44:22 +0200 Subject: [PATCH 087/149] update palette --- src/window.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/window.py b/src/window.py index 866929fe4..0c2b77390 100644 --- a/src/window.py +++ b/src/window.py @@ -102,22 +102,33 @@ def on_monet_file_chooser_response(self, widget, response): """ print(self.monet_palette) print(self.monet_theme) + self.monet_pref_group.remove(self.palette_picker) + + self.palette_picker = Adw.ActionRow() + self.palette_picker.set_name("monet_palette") + self.palette_picker.set_title(_("Monet Palette")) + self.palette_picker + self.palette_pickers = {} + i = 0 for color in self.monet_palette.values(): - i+=1 + i = i+1 + picker = Gtk.ColorButton() + picker.set_name(str(i)) color = color.tone(int(self.tone.get_string())) - print(color) - self.palette_pickers[str(i)].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) - - self.palette_pickers["1"].set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + picker.set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) + picker.set_valign(Gtk.Align.CENTER) + self.palette_pickers[str(i)] = picker + self.palette_picker.add_suffix(picker) + self.monet_pref_group.add(self.palette_picker) #self.get_application().update_theme_from_monet(self.monet_theme) def setup_monet_page(self): - monet_pref_group = Adw.PreferencesGroup() - monet_pref_group.set_name("monet") - monet_pref_group.set_title(_("Monet Engine")) - monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + self.monet_pref_group = Adw.PreferencesGroup() + self.monet_pref_group.set_name("monet") + self.monet_pref_group.set_title(_("Monet Engine")) + self.monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -132,7 +143,7 @@ def setup_monet_page(self): self.monet_file_chooser_button.connect("clicked", self.on_file_picker_button_clicked ) self.monet_file_chooser_dialog.connect("response", self.on_monet_file_chooser_response ) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) - monet_pref_group.add(self.monet_file_chooser_row) + self.monet_pref_group.add(self.monet_file_chooser_row) self.palette_picker = Adw.ActionRow() self.palette_picker.set_name("monet_palette") @@ -147,7 +158,7 @@ def setup_monet_page(self): picker.set_valign(Gtk.Align.CENTER) self.palette_pickers[str(i)] = picker self.palette_picker.add_suffix(picker) - monet_pref_group.add(self.palette_picker) + self.monet_pref_group.add(self.palette_picker) self.tone_row = Adw.ComboRow() From 2257a5afeea8c505e8d005afa551eda5d0c3c41a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:45:10 +0200 Subject: [PATCH 088/149] fix bug --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 0c2b77390..07e160ed9 100644 --- a/src/window.py +++ b/src/window.py @@ -177,8 +177,8 @@ def setup_monet_page(self): for v in store_values: store.append(v) self.tone_row.set_model(store) - monet_pref_group.add(self.tone_row) - self.content_monet.add(monet_pref_group) + self.monet_pref_group.add(self.tone_row) + self.content_monet.add(self.monet_pref_group) def setup_plugins_page(self): custom_css_group = AdwcustomizerCustomCSSGroup() From 160e46863ad81602915df718ee421f17772bca09 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:55:12 +0200 Subject: [PATCH 089/149] update tone generation --- src/main.py | 3 ++ src/window.py | 99 ++++++++++++++++----------------------------------- 2 files changed, 33 insertions(+), 69 deletions(-) diff --git a/src/main.py b/src/main.py index 3b2e0e9a2..cb961f23a 100644 --- a/src/main.py +++ b/src/main.py @@ -206,6 +206,9 @@ def load_preset_variables(self, preset): self.reload_variables() + def update_theme_from_monet(self, theme, tone): + pass + def generate_gtk_css(self, app_type): final_css = "" for key in self.variables.keys(): diff --git a/src/window.py b/src/window.py index 07e160ed9..394b64723 100644 --- a/src/window.py +++ b/src/window.py @@ -35,6 +35,7 @@ from .custom_css_group import AdwcustomizerCustomCSSGroup from material_color_utilities_python import * + @Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') class AdwcustomizerMainWindow(Adw.ApplicationWindow): __gtype_name__ = 'AdwcustomizerMainWindow' @@ -52,7 +53,8 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) - self.presets_dropdown.get_popover().connect("show", self.on_presets_dropdown_activate) + self.presets_dropdown.get_popover().connect( + "show", self.on_presets_dropdown_activate) self.setup_monet_page() self.setup_plugins_page() @@ -81,99 +83,54 @@ def on_file_picker_button_clicked(self, *args): def on_monet_file_chooser_response(self, widget, response): if response == Gtk.ResponseType.ACCEPT: - self.monet_image_file = self.monet_file_chooser_dialog.get_file() + self.monet_image_file = self.monet_file_chooser_dialog.get_file() image_basename = self.monet_image_file.get_basename() self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) - self.monet_palette = self.monet_theme["palettes"] self.tone = self.tone_row.get_selected_item() - - i = 0 - """ - {'primary': , - 'secondary': , - 'tertiary': , - 'neutral': , - 'neutralVariant': , - 'error': } - """ - print(self.monet_palette) - print(self.monet_theme) - self.monet_pref_group.remove(self.palette_picker) - - self.palette_picker = Adw.ActionRow() - self.palette_picker.set_name("monet_palette") - self.palette_picker.set_title(_("Monet Palette")) - self.palette_picker - self.palette_pickers = {} - i = 0 - for color in self.monet_palette.values(): - i = i+1 - picker = Gtk.ColorButton() - picker.set_name(str(i)) - color = color.tone(int(self.tone.get_string())) - picker.set_rgba(Gdk.RGBA(red=redFromArgb(color), green=greenFromArgb(color), blue=blueFromArgb(color), alpha=alphaFromArgb(color))) - picker.set_valign(Gtk.Align.CENTER) - self.palette_pickers[str(i)] = picker - self.palette_picker.add_suffix(picker) - self.monet_pref_group.add(self.palette_picker) - #self.get_application().update_theme_from_monet(self.monet_theme) + self.get_application().update_theme_from_monet(self.monet_theme, self.tone) def setup_monet_page(self): - self.monet_pref_group = Adw.PreferencesGroup() self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) - self.monet_pref_group.set_description(_("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + self.monet_pref_group.set_description( + _("Monet is an engine that generates Material Design 3 palette from backgrounds color")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) - + self.monet_file_chooser_dialog = Gtk.FileChooserNative() self.monet_file_chooser_dialog.set_transient_for(self) self.monet_file_chooser_button = Gtk.Button() self.monet_file_chooser_button.set_label(_("Choose a file")) - self.monet_file_chooser_button.set_icon_name("folder-pictures-symbolic") + self.monet_file_chooser_button.set_icon_name( + "folder-pictures-symbolic") - self.monet_file_chooser_button.connect("clicked", self.on_file_picker_button_clicked ) - self.monet_file_chooser_dialog.connect("response", self.on_monet_file_chooser_response ) + self.monet_file_chooser_button.connect( + "clicked", self.on_file_picker_button_clicked) + self.monet_file_chooser_dialog.connect( + "response", self.on_monet_file_chooser_response) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) self.monet_pref_group.add(self.monet_file_chooser_row) - self.palette_picker = Adw.ActionRow() - self.palette_picker.set_name("monet_palette") - self.palette_picker.set_title(_("Monet Palette")) - self.palette_picker - self.palette_pickers = {} - for i in range(6): - i = i+1 - picker = Gtk.ColorButton() - picker.set_name(str(i)) - picker.set_rgba(Gdk.RGBA(red=0, green=0, blue=0, alpha=0)) - picker.set_valign(Gtk.Align.CENTER) - self.palette_pickers[str(i)] = picker - self.palette_picker.add_suffix(picker) + self.monet_palette_shades = AdwcustomizerPaletteShades("monet", + "Monet Palette", + 6) self.monet_pref_group.add(self.palette_picker) - self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - store_values = [ - "1", - "5", - "10", - "15", - "20", - "25", - "30" - ] + store_values = ["1"] + for i in range(5, 100, 5): + store_values.append(str(i)) for v in store_values: store.append(v) self.tone_row.set_model(store) @@ -198,26 +155,29 @@ def setup_colors_page(self): for variable in group["variables"]: pref_variable = AdwcustomizerOption(variable["name"], variable["title"], - variable.get("explanation"), + variable.get( + "explanation"), variable["adw_gtk3_support"]) pref_group.add(pref_variable) - self.get_application().pref_variables[variable["name"]] = pref_variable + self.get_application( + ).pref_variables[variable["name"]] = pref_variable self.content.add(pref_group) palette_pref_group = Adw.PreferencesGroup() palette_pref_group.set_name("palette_colors") palette_pref_group.set_title(_("Palette Colors")) - palette_pref_group.set_description(_("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) + palette_pref_group.set_description( + _("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) for color in settings_schema["palette"]: palette_shades = AdwcustomizerPaletteShades(color["prefix"], color["title"], color["n_shades"]) palette_pref_group.add(palette_shades) - self.get_application().pref_palette_shades[color["prefix"]] = palette_shades + self.get_application( + ).pref_palette_shades[color["prefix"]] = palette_shades self.content.add(palette_pref_group) - def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) while child is not None: @@ -225,7 +185,8 @@ def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) self.errors_button.set_visible(len(errors) > 0) for error in errors: - self.errors_list.append(AdwcustomizerError(error["error"], error["element"], error["line"])) + self.errors_list.append(AdwcustomizerError( + error["error"], error["element"], error["line"])) def on_presets_dropdown_activate(self, *args): self.get_application().reload_user_defined_presets() From 5d6f4697e512f1016f194709edbd054e00694e87 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:55:49 +0200 Subject: [PATCH 090/149] fix error --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 394b64723..67ca2771b 100644 --- a/src/window.py +++ b/src/window.py @@ -122,7 +122,7 @@ def setup_monet_page(self): self.monet_palette_shades = AdwcustomizerPaletteShades("monet", "Monet Palette", 6) - self.monet_pref_group.add(self.palette_picker) + self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() self.tone_row.set_title(_("Tone")) From 93f07e1ff673d3c187ddc776cc3fef445807cd58 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 12:57:29 +0200 Subject: [PATCH 091/149] add 0xMRTT as translator --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index cb961f23a..a8671c20e 100644 --- a/src/main.py +++ b/src/main.py @@ -449,8 +449,8 @@ def show_about_window(self, *_args): issue_url="https://github.com/AdwCustomizerTeam/AdwCustomizer/issues", developers=[ 'Artyom "ArtyIF" Fomin https://github.com/ArtyIF', - "Verantor https://github.com/Verantor", "0xMRTT https://github.com/0xMRTT", + "Verantor https://github.com/Verantor", ], artists=[ 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' @@ -466,6 +466,7 @@ def show_about_window(self, *_args): Renato Corrêa https://www.transifex.com/user/profile/renatocrrs/ Aggelos Tselios https://www.transifex.com/user/profile/AndroGR/ David "Daudix UFO" Lapshin https://github.com/daudix-UFO' + 0xMRTT https://github.com/0xMRTT Juanjo Cillero https://www.transifex.com/user/profile/renux918/ Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", From f390b01cda4ac7e39caccb1433dcca37a8dc9ec4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 13:02:13 +0200 Subject: [PATCH 092/149] remove PR --- .github/workflows/flatpak-nightly.yml | 1 - .github/workflows/flatpak.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index e05befe07..fa297f23a 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -2,7 +2,6 @@ name: Build flatpak nightly on: push: branches: [next] - pull_request: jobs: flatpak: name: "Flatpak" diff --git a/.github/workflows/flatpak.yml b/.github/workflows/flatpak.yml index 8d1b02d48..69360a41c 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/flatpak.yml @@ -2,7 +2,6 @@ name: Build flatpak on: push: branches: [main] - pull_request: jobs: flatpak: name: "Flatpak" From 9aae287cb07333be89d0374f74bed067f8a56366 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:22:08 +0200 Subject: [PATCH 093/149] use palette shades --- src/main.py | 11 ++++++++++- src/window.py | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a8671c20e..f4c360cdd 100644 --- a/src/main.py +++ b/src/main.py @@ -26,6 +26,7 @@ import gi from gi.repository import Gtk, Gdk, Gio, Adw, GLib, Xdp, XdpGtk4 +from material_color_utilities_python import * from .settings_schema import settings_schema from .window import AdwcustomizerMainWindow @@ -207,7 +208,15 @@ def load_preset_variables(self, preset): self.reload_variables() def update_theme_from_monet(self, theme, tone): - pass + palettes = theme["palettes"] + + palette = {} + i = 0 + for color in palettes.values(): + i += 1 + palette[str(i)] = hexFromArgb(color.tone(tone)) + + self.pref_palette_shades["monet"].update_shades() def generate_gtk_css(self, app_type): final_css = "" diff --git a/src/window.py b/src/window.py index 67ca2771b..b92e6eeed 100644 --- a/src/window.py +++ b/src/window.py @@ -122,6 +122,8 @@ def setup_monet_page(self): self.monet_palette_shades = AdwcustomizerPaletteShades("monet", "Monet Palette", 6) + self.get_application( + ).pref_palette_shades["monet"] = self.monet_palette_shades self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() From 91d7e5f7bb578df08e07bcb1e326e332b8a108bc Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:23:31 +0200 Subject: [PATCH 094/149] fix error --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index f4c360cdd..274dae147 100644 --- a/src/main.py +++ b/src/main.py @@ -214,7 +214,7 @@ def update_theme_from_monet(self, theme, tone): i = 0 for color in palettes.values(): i += 1 - palette[str(i)] = hexFromArgb(color.tone(tone)) + palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) self.pref_palette_shades["monet"].update_shades() From c98f8df6101f5fad3639dc9f3423073d85837eac Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:24:16 +0200 Subject: [PATCH 095/149] add missin arg --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 274dae147..fbaf678a4 100644 --- a/src/main.py +++ b/src/main.py @@ -216,7 +216,7 @@ def update_theme_from_monet(self, theme, tone): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) - self.pref_palette_shades["monet"].update_shades() + self.pref_palette_shades["monet"].update_shades(palette) def generate_gtk_css(self, app_type): final_css = "" From 3ad2ebc2586d394dcb40e421a4270512f7f36226 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:25:48 +0200 Subject: [PATCH 096/149] add debug --- src/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.py b/src/main.py index fbaf678a4..ff7dceddf 100644 --- a/src/main.py +++ b/src/main.py @@ -216,6 +216,8 @@ def update_theme_from_monet(self, theme, tone): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) + print(palette) + self.pref_palette_shades["monet"].update_shades(palette) def generate_gtk_css(self, app_type): From b26d9a8df76e83ad27f41280a857f60f40273644 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:45:45 +0200 Subject: [PATCH 097/149] remove tone 1 --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index b92e6eeed..efc166bea 100644 --- a/src/window.py +++ b/src/window.py @@ -130,7 +130,7 @@ def setup_monet_page(self): self.tone_row.set_title(_("Tone")) store = Gtk.StringList() - store_values = ["1"] + store_values = [] for i in range(5, 100, 5): store_values.append(str(i)) for v in store_values: From d5bce25c1e699e947049bfa4af0c4e1159fa006d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 14:55:00 +0200 Subject: [PATCH 098/149] add theme row --- src/window.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/window.py b/src/window.py index efc166bea..5bfb54f19 100644 --- a/src/window.py +++ b/src/window.py @@ -137,6 +137,16 @@ def setup_monet_page(self): store.append(v) self.tone_row.set_model(store) self.monet_pref_group.add(self.tone_row) + + self.monet_theme_row = Adw.ComboRow() + self.monet_theme_row.set_title(_("Theme")) + + store = Gtk.StringList() + store.append("Dark") + store.append("Light") + self.monet_theme_row.set_model(store) + self.monet_pref_group.add(self.monet_theme_row) + self.content_monet.add(self.monet_pref_group) def setup_plugins_page(self): From e2c9b1717836ff21233cecb7e7b102fedc181f08 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:00:07 +0200 Subject: [PATCH 099/149] add monet theme selector --- src/main.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++- src/window.py | 3 ++- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index ff7dceddf..a37cd3993 100644 --- a/src/main.py +++ b/src/main.py @@ -207,9 +207,11 @@ def load_preset_variables(self, preset): self.reload_variables() - def update_theme_from_monet(self, theme, tone): + def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] + monet_theme = monet_theme.get_string() + palette = {} i = 0 for color in palettes.values(): @@ -220,6 +222,56 @@ def update_theme_from_monet(self, theme, tone): self.pref_palette_shades["monet"].update_shades(palette) + print(theme) + + self.variable = { + "accent_color": theme["schemes"]["light"]["primary"], + "accent_bg_color": theme["schemes"]["light"]["primaryContainer"], + "accent_fg_color": theme["schemes"]["light"]["onPrimaryContainer"], + + "destructive_color": theme["schemes"]["light"][""], + "destructive_bg_color": theme["schemes"]["light"][""], + "destructive_fg_color": theme["schemes"]["light"][""], + + "success_color": theme["schemes"]["light"][""], + "success_bg_color": theme["schemes"]["light"][""], + "success_fg_color": theme["schemes"]["light"][""], + + "warning_color": theme["schemes"]["light"][""], + "warning_bg_color": theme["schemes"]["light"][""], + "warning_fg_color": "rgba(0, 0, 0, 0.8)", + + "error_color": theme["schemes"]["light"][""], + "error_bg_color": theme["schemes"]["light"][""], + "error_fg_color": theme["schemes"]["light"][""], + + "window_bg_color": theme["schemes"]["light"][""], + "window_fg_color": theme["schemes"]["light"][""], + + "view_bg_color": theme["schemes"]["light"][""], + "view_fg_color": theme["schemes"]["light"][""], + + "headerbar_bg_color": theme["schemes"]["light"][""], + "headerbar_fg_color": "rgba(0, 0, 0, 0.8)", + "headerbar_border_color": "rgba(0, 0, 0, 0.8)", + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": "rgba(0, 0, 0, 0.07)", + + "card_bg_color": theme["schemes"]["light"][""], + "card_fg_color": "rgba(0, 0, 0, 0.8)", + "card_shade_color": "rgba(0, 0, 0, 0.07)", + + "dialog_bg_color": theme["schemes"]["light"][""], + "dialog_fg_color": "rgba(0, 0, 0, 0.8)", + + "popover_bg_color": theme["schemes"]["light"][""], + "popover_fg_color": "rgba(0, 0, 0, 0.8)", + + "shade_color": theme["schemes"]["light"][""], + "scrollbar_outline_color": theme["schemes"]["light"][""] + } + + def generate_gtk_css(self, app_type): final_css = "" for key in self.variables.keys(): diff --git a/src/window.py b/src/window.py index 5bfb54f19..d38272320 100644 --- a/src/window.py +++ b/src/window.py @@ -91,7 +91,8 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_img = Image.open(self.monet_image_file.get_path()) self.monet_theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() - self.get_application().update_theme_from_monet(self.monet_theme, self.tone) + self.monet_theme = self.monet_theme_row.get_selected_item() + self.get_application().update_theme_from_monet(self.monet_theme, self.tone, self.monet_theme) def setup_monet_page(self): From d2bde49e06d23a38d29d181bd8d80c38e56e9f68 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:00:33 +0200 Subject: [PATCH 100/149] add debug info --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index a37cd3993..c0d609958 100644 --- a/src/main.py +++ b/src/main.py @@ -222,6 +222,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): self.pref_palette_shades["monet"].update_shades(palette) + print(monet_theme) print(theme) self.variable = { From 47c4218523062b457958d1a3048eca133d6084fa Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:03:57 +0200 Subject: [PATCH 101/149] fix duplicated name --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index d38272320..08e14604d 100644 --- a/src/window.py +++ b/src/window.py @@ -89,10 +89,10 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_dialog.hide() self.monet_img = Image.open(self.monet_image_file.get_path()) - self.monet_theme = themeFromImage(self.monet_img) + self.theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.monet_theme, self.tone, self.monet_theme) + self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) def setup_monet_page(self): From f5f8580b2e1a5ba31ea2dc6079ff7dcc1a498705 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:39:31 +0200 Subject: [PATCH 102/149] add automatic theme generation. Need test --- src/main.py | 137 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 101 insertions(+), 36 deletions(-) diff --git a/src/main.py b/src/main.py index c0d609958..314d21aeb 100644 --- a/src/main.py +++ b/src/main.py @@ -207,10 +207,22 @@ def load_preset_variables(self, preset): self.reload_variables() + + def rgba_from_argb(self, argb, alpha = None) -> str: + base = "rgba({}, {}, {}, {})" + + red = redFromArgb(argb) + green = greenFromArgb(argb) + blue = blueFromArgb(argb) + if not alpha: + alpha = alphaFromArgb(argb) + + return base.format(red, green, blue, alpha) + def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] - monet_theme = monet_theme.get_string() + monet_theme = monet_theme.get_string().lower() # dark / light palette = {} i = 0 @@ -225,53 +237,106 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(monet_theme) print(theme) - self.variable = { - "accent_color": theme["schemes"]["light"]["primary"], - "accent_bg_color": theme["schemes"]["light"]["primaryContainer"], - "accent_fg_color": theme["schemes"]["light"]["onPrimaryContainer"], + if monet_theme == "dark": + dark_theme = theme["schemes"]["dark"].toJSON() + self.variable = { + "accent_color": dark_theme["primary"], + "accent_bg_color": dark_theme["primaryContainer"], + "accent_fg_color": dark_theme["onPrimaryContainer"], + + "destructive_color": dark_theme["error"], + "destructive_bg_color": dark_theme["errorContainer"], + "destructive_fg_color": dark_theme["onError"], + + "success_color": dark_theme["tertiary"], + "success_bg_color": dark_theme["onTertiary"], + "success_fg_color": dark_theme["tertiaryContainer"], + + "warning_color": dark_theme["secondaryContainer"], + "warning_bg_color": dark_theme["inversePrimary"], + "warning_fg_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + + "error_color": dark_theme["error"], + "error_bg_color": dark_theme["errorContainer"], + "error_fg_color": dark_theme["onError"], + + "window_bg_color": dark_theme["surface"], + "window_fg_color": dark_theme["onSurface"], - "destructive_color": theme["schemes"]["light"][""], - "destructive_bg_color": theme["schemes"]["light"][""], - "destructive_fg_color": theme["schemes"]["light"][""], + "view_bg_color": dark_theme["surface"], + "view_fg_color": dark_theme["onSurface"], - "success_color": theme["schemes"]["light"][""], - "success_bg_color": theme["schemes"]["light"][""], - "success_fg_color": theme["schemes"]["light"][""], + "headerbar_bg_color": dark_theme["surface"], + "headerbar_fg_color": dark_theme["onSurface"], + "headerbar_border_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": dark_theme["shadow"], - "warning_color": theme["schemes"]["light"][""], - "warning_bg_color": theme["schemes"]["light"][""], - "warning_fg_color": "rgba(0, 0, 0, 0.8)", + "card_bg_color": self.rgba_from_argb(dark_theme["primary"], "0.05"), + "card_fg_color": dark_theme["surfaceVariant"], + "card_shade_color": dark_theme["shadow"], - "error_color": theme["schemes"]["light"][""], - "error_bg_color": theme["schemes"]["light"][""], - "error_fg_color": theme["schemes"]["light"][""], + "dialog_bg_color": dark_theme["secondaryContainer"], + "dialog_fg_color": dark_theme["onSecondaryContainer"], - "window_bg_color": theme["schemes"]["light"][""], - "window_fg_color": theme["schemes"]["light"][""], + "popover_bg_color": dark_theme["secondaryContainer"], + "popover_fg_color": dark_theme["onSecondaryContainer"], - "view_bg_color": theme["schemes"]["light"][""], - "view_fg_color": theme["schemes"]["light"][""], + "shade_color": dark_theme["shadow"], + "scrollbar_outline_color": dark_theme["outline"] + } + else: # light + light_theme = theme["schemes"]["light"].toJSON() + self.variable = { + "accent_color": light_theme["primary"], + "accent_bg_color": light_theme["primaryContainer"], + "accent_fg_color": light_theme["onPrimaryContainer"], - "headerbar_bg_color": theme["schemes"]["light"][""], - "headerbar_fg_color": "rgba(0, 0, 0, 0.8)", - "headerbar_border_color": "rgba(0, 0, 0, 0.8)", - "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": "rgba(0, 0, 0, 0.07)", + "destructive_color": light_theme["error"], + "destructive_bg_color": light_theme["errorContainer"], + "destructive_fg_color": light_theme["onError"], - "card_bg_color": theme["schemes"]["light"][""], - "card_fg_color": "rgba(0, 0, 0, 0.8)", - "card_shade_color": "rgba(0, 0, 0, 0.07)", + "success_color": light_theme["tertiary"], + "success_bg_color": light_theme["onTertiary"], + "success_fg_color": light_theme["tertiaryContainer"], - "dialog_bg_color": theme["schemes"]["light"][""], - "dialog_fg_color": "rgba(0, 0, 0, 0.8)", + "warning_color": light_theme["secondaryContainer"], + "warning_bg_color": light_theme["inversePrimary"], + "warning_fg_color": self.rgba_from_argb(light_theme["primary"], "0.8"), - "popover_bg_color": theme["schemes"]["light"][""], - "popover_fg_color": "rgba(0, 0, 0, 0.8)", + "error_color": light_theme["error"], + "error_bg_color": light_theme["errorContainer"], + "error_fg_color": light_theme["onError"], - "shade_color": theme["schemes"]["light"][""], - "scrollbar_outline_color": theme["schemes"]["light"][""] - } + "window_bg_color": light_theme["surface"], + "window_fg_color": light_theme["onSurface"], + "view_bg_color": light_theme["surface"], + "view_fg_color": light_theme["onSurface"], + + "headerbar_bg_color": light_theme["surface"], + "headerbar_fg_color": light_theme["onSurface"], + "headerbar_border_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "headerbar_backdrop_color": "@window_bg_color", + "headerbar_shade_color": light_theme["shadow"], + + "card_bg_color": self.rgba_from_argb(light_theme["primary"], "0.05"), + "card_fg_color": light_theme["surfaceVariant"], + "card_shade_color": light_theme["shadow"], + + "dialog_bg_color": light_theme["secondaryContainer"], + "dialog_fg_color": light_theme["onSecondaryContainer"], + + "popover_bg_color": light_theme["secondaryContainer"], + "popover_fg_color": light_theme["onSecondaryContainer"], + + "shade_color": light_theme["shadow"], + "scrollbar_outline_color": light_theme["outline"] + } + + for key in self.variables.keys(): + if key in self.pref_variables: + self.pref_variables[key].update_value(self.variables[key]) def generate_gtk_css(self, app_type): final_css = "" From eb52f52fbb6c7fe4dc92771af839a39776c0e840 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:41:46 +0200 Subject: [PATCH 103/149] fix error --- src/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 314d21aeb..9e08e3b0d 100644 --- a/src/main.py +++ b/src/main.py @@ -239,7 +239,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"].toJSON() - self.variable = { + variable = { "accent_color": dark_theme["primary"], "accent_bg_color": dark_theme["primaryContainer"], "accent_fg_color": dark_theme["onPrimaryContainer"], @@ -287,7 +287,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): } else: # light light_theme = theme["schemes"]["light"].toJSON() - self.variable = { + variable = { "accent_color": light_theme["primary"], "accent_bg_color": light_theme["primaryContainer"], "accent_fg_color": light_theme["onPrimaryContainer"], @@ -334,9 +334,9 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "scrollbar_outline_color": light_theme["outline"] } - for key in self.variables.keys(): + for key in variables.keys(): if key in self.pref_variables: - self.pref_variables[key].update_value(self.variables[key]) + self.pref_variables[key].update_value(variables[key]) def generate_gtk_css(self, app_type): final_css = "" From 8c25c94e9545968462508b63e50772cff267050c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:44:12 +0200 Subject: [PATCH 104/149] add reload --- src/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.py b/src/main.py index 9e08e3b0d..0dab116bd 100644 --- a/src/main.py +++ b/src/main.py @@ -337,6 +337,8 @@ def update_theme_from_monet(self, theme, tone, monet_theme): for key in variables.keys(): if key in self.pref_variables: self.pref_variables[key].update_value(variables[key]) + + self.reload_variables() def generate_gtk_css(self, app_type): final_css = "" From aada5ae201fd69e6ec9a7e8458eda551b912f6f0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:46:00 +0200 Subject: [PATCH 105/149] add conditon --- src/window.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/window.py b/src/window.py index 08e14604d..205942adc 100644 --- a/src/window.py +++ b/src/window.py @@ -88,11 +88,12 @@ def on_monet_file_chooser_response(self, widget, response): self.monet_file_chooser_button.set_label(image_basename) self.monet_file_chooser_dialog.hide() - self.monet_img = Image.open(self.monet_image_file.get_path()) - self.theme = themeFromImage(self.monet_img) - self.tone = self.tone_row.get_selected_item() - self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) + if response == Gtk.ResponseType.ACCEPT: + self.monet_img = Image.open(self.monet_image_file.get_path()) + self.theme = themeFromImage(self.monet_img) + self.tone = self.tone_row.get_selected_item() + self.monet_theme = self.monet_theme_row.get_selected_item() + self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) def setup_monet_page(self): From df673661572dccafe6ee7d0aad165b7e7905d29c Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:57:41 +0200 Subject: [PATCH 106/149] fix error --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 0dab116bd..4089c2bb2 100644 --- a/src/main.py +++ b/src/main.py @@ -240,7 +240,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"].toJSON() variable = { - "accent_color": dark_theme["primary"], + "accent_color": dark_theme.primary, "accent_bg_color": dark_theme["primaryContainer"], "accent_fg_color": dark_theme["onPrimaryContainer"], @@ -334,9 +334,9 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "scrollbar_outline_color": light_theme["outline"] } - for key in variables.keys(): + for key in variable.keys(): if key in self.pref_variables: - self.pref_variables[key].update_value(variables[key]) + self.pref_variables[key].update_value(variable[key]) self.reload_variables() From 686035177b84911702658937f9e43bcbee7e2173 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 15:58:53 +0200 Subject: [PATCH 107/149] fix bug --- src/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 4089c2bb2..a8870f66b 100644 --- a/src/main.py +++ b/src/main.py @@ -238,11 +238,11 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(theme) if monet_theme == "dark": - dark_theme = theme["schemes"]["dark"].toJSON() + dark_theme = theme["schemes"]["dark"] variable = { "accent_color": dark_theme.primary, - "accent_bg_color": dark_theme["primaryContainer"], - "accent_fg_color": dark_theme["onPrimaryContainer"], + "accent_bg_color": dark_theme.primaryContainer, + "accent_fg_color": dark_theme.onPrimaryContainer, "destructive_color": dark_theme["error"], "destructive_bg_color": dark_theme["errorContainer"], From a4f48a11b44b4d988423015097f967923932c390 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:03:34 +0200 Subject: [PATCH 108/149] update dark sheme --- src/main.py | 60 ++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/main.py b/src/main.py index a8870f66b..143e5d934 100644 --- a/src/main.py +++ b/src/main.py @@ -244,49 +244,49 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_bg_color": dark_theme.primaryContainer, "accent_fg_color": dark_theme.onPrimaryContainer, - "destructive_color": dark_theme["error"], - "destructive_bg_color": dark_theme["errorContainer"], - "destructive_fg_color": dark_theme["onError"], + "destructive_color": dark_theme.error, + "destructive_bg_color": dark_theme.errorContainer, + "destructive_fg_color": dark_theme.onError, - "success_color": dark_theme["tertiary"], - "success_bg_color": dark_theme["onTertiary"], - "success_fg_color": dark_theme["tertiaryContainer"], + "success_color": dark_theme.tertiary, + "success_bg_color": dark_theme.onTertiary, + "success_fg_color": dark_theme.tertiaryContainer, - "warning_color": dark_theme["secondaryContainer"], - "warning_bg_color": dark_theme["inversePrimary"], - "warning_fg_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "warning_color": dark_theme.secondaryContainer, + "warning_bg_color": dark_theme.inversePrimary, + "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": dark_theme["error"], - "error_bg_color": dark_theme["errorContainer"], - "error_fg_color": dark_theme["onError"], + "error_color": dark_theme.error, + "error_bg_color": dark_theme.errorContainer, + "error_fg_color": dark_theme.onError, - "window_bg_color": dark_theme["surface"], - "window_fg_color": dark_theme["onSurface"], + "window_bg_color": dark_theme.surface, + "window_fg_color": dark_theme.onSurface, - "view_bg_color": dark_theme["surface"], - "view_fg_color": dark_theme["onSurface"], + "view_bg_color": dark_theme.surface, + "view_fg_color": dark_theme.onSurface, - "headerbar_bg_color": dark_theme["surface"], - "headerbar_fg_color": dark_theme["onSurface"], - "headerbar_border_color": self.rgba_from_argb(dark_theme["primary"], "0.8"), + "headerbar_bg_color": dark_theme.surface, + "headerbar_fg_color": dark_theme.onSurface, + "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": dark_theme["shadow"], + "headerbar_shade_color": dark_theme.shadow, - "card_bg_color": self.rgba_from_argb(dark_theme["primary"], "0.05"), - "card_fg_color": dark_theme["surfaceVariant"], - "card_shade_color": dark_theme["shadow"], + "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), + "card_fg_color": dark_theme.surfaceVariant, + "card_shade_color": dark_theme.shadow, - "dialog_bg_color": dark_theme["secondaryContainer"], - "dialog_fg_color": dark_theme["onSecondaryContainer"], + "dialog_bg_color": dark_theme.secondaryContainer, + "dialog_fg_color": dark_theme.onSecondaryContainer, - "popover_bg_color": dark_theme["secondaryContainer"], - "popover_fg_color": dark_theme["onSecondaryContainer"], + "popover_bg_color": dark_theme.secondaryContainer, + "popover_fg_color": dark_theme.onSecondaryContainer, - "shade_color": dark_theme["shadow"], - "scrollbar_outline_color": dark_theme["outline"] + "shade_color": dark_theme.shadow, + "scrollbar_outline_color": dark_theme.outline } else: # light - light_theme = theme["schemes"]["light"].toJSON() + light_theme = theme["schemes"]["light"] variable = { "accent_color": light_theme["primary"], "accent_bg_color": light_theme["primaryContainer"], From 2382062177dc2b6be2ec8508a9adac34753d51c0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:06:55 +0200 Subject: [PATCH 109/149] convert to rgba --- src/main.py | 58 ++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/main.py b/src/main.py index 143e5d934..c7231e161 100644 --- a/src/main.py +++ b/src/main.py @@ -240,50 +240,50 @@ def update_theme_from_monet(self, theme, tone, monet_theme): if monet_theme == "dark": dark_theme = theme["schemes"]["dark"] variable = { - "accent_color": dark_theme.primary, - "accent_bg_color": dark_theme.primaryContainer, - "accent_fg_color": dark_theme.onPrimaryContainer, + "accent_color": self.rgba_from_argb(dark_theme.primary), + "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), + "accent_fg_color": self.rgba_from_argb(dark_theme.onPrimaryContainer), - "destructive_color": dark_theme.error, - "destructive_bg_color": dark_theme.errorContainer, - "destructive_fg_color": dark_theme.onError, + "destructive_color": self.rgba_from_argb(dark_theme.error), + "destructive_bg_color": self.rgba_from_argb(dark_theme.errorContainer), + "destructive_fg_color": self.rgba_from_argb(dark_theme.onError), - "success_color": dark_theme.tertiary, - "success_bg_color": dark_theme.onTertiary, - "success_fg_color": dark_theme.tertiaryContainer, + "success_color": self.rgba_from_argb(dark_theme.tertiary), + "success_bg_color": self.rgba_from_argb(dark_theme.onTertiary), + "success_fg_color": self.rgba_from_argb(dark_theme.tertiaryContainer), - "warning_color": dark_theme.secondaryContainer, - "warning_bg_color": dark_theme.inversePrimary, + "warning_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "warning_bg_color": self.rgba_from_argb(dark_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": dark_theme.error, - "error_bg_color": dark_theme.errorContainer, - "error_fg_color": dark_theme.onError, + "error_color": self.rgba_from_argb(dark_theme.error), + "error_bg_color": self.rgba_from_argb(dark_theme.errorContainer), + "error_fg_color": self.rgba_from_argb(dark_theme.onError), - "window_bg_color": dark_theme.surface, - "window_fg_color": dark_theme.onSurface, + "window_bg_color": self.rgba_from_argb(dark_theme.surface), + "window_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "view_bg_color": dark_theme.surface, - "view_fg_color": dark_theme.onSurface, + "view_bg_color": self.rgba_from_argb(dark_theme.surface), + "view_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_bg_color": dark_theme.surface, - "headerbar_fg_color": dark_theme.onSurface, + "headerbar_bg_color": self.rgba_from_argb(dark_theme.surface), + "headerbar_fg_color": self.rgba_from_argb(dark_theme.onSurface), "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": dark_theme.shadow, + "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), - "card_fg_color": dark_theme.surfaceVariant, - "card_shade_color": dark_theme.shadow, + "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), + "card_shade_color": self.rgba_from_argb(dark_theme.shadow), - "dialog_bg_color": dark_theme.secondaryContainer, - "dialog_fg_color": dark_theme.onSecondaryContainer, + "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "popover_bg_color": dark_theme.secondaryContainer, - "popover_fg_color": dark_theme.onSecondaryContainer, + "popover_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), + "popover_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "shade_color": dark_theme.shadow, - "scrollbar_outline_color": dark_theme.outline + "shade_color": self.rgba_from_argb(dark_theme.shadow), + "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) } else: # light light_theme = theme["schemes"]["light"] From 1b12e486244c38b0a0d14f59cd01be66825e4cd0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:17:35 +0200 Subject: [PATCH 110/149] update tones --- src/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.py b/src/window.py index 205942adc..e5f413426 100644 --- a/src/window.py +++ b/src/window.py @@ -101,7 +101,7 @@ def setup_monet_page(self): self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) self.monet_pref_group.set_description( - _("Monet is an engine that generates Material Design 3 palette from backgrounds color")) + _("Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow")) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -133,7 +133,7 @@ def setup_monet_page(self): store = Gtk.StringList() store_values = [] - for i in range(5, 100, 5): + for i in range(20, 80, 5): store_values.append(str(i)) for v in store_values: store.append(v) From 0324b9575947bacabbf1099c2107cd3e5491dc08 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:22:34 +0200 Subject: [PATCH 111/149] add automatic preset load --- src/main.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index c7231e161..92fa90dd4 100644 --- a/src/main.py +++ b/src/main.py @@ -96,9 +96,17 @@ def do_activate(self): self.create_action("about", self.show_about_window) self.reload_user_defined_presets() - self.load_preset_from_resource( - "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita.json" - ) + + self.style_manager = Adw.StyleManager.get_default() + + if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: + self.load_preset_from_resource( + "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" + ) + else: + self.load_preset_from_resource( + "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita.json" + ) self.win.present() From f996aeeaccec757a7cca2cadf3826a373f770b92 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:23:08 +0200 Subject: [PATCH 112/149] add debug --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index 92fa90dd4..3a430c01d 100644 --- a/src/main.py +++ b/src/main.py @@ -99,6 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() + print(self.style_manager.get_color_scheme()) if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From 7bf5edf685f16b39bc8870924be508fca5278e34 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:24:40 +0200 Subject: [PATCH 113/149] add more debug --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 3a430c01d..661823e7f 100644 --- a/src/main.py +++ b/src/main.py @@ -98,8 +98,9 @@ def do_activate(self): self.reload_user_defined_presets() self.style_manager = Adw.StyleManager.get_default() - + print(dir(self.style_manager)) print(self.style_manager.get_color_scheme()) + print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From e939dcdd1722e8790964544e8665721ec61e793d Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:25:41 +0200 Subject: [PATCH 114/149] fix bug --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 661823e7f..8a2c5bc14 100644 --- a/src/main.py +++ b/src/main.py @@ -99,9 +99,10 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) + print(self.style_manager.get_default()) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) - if self.style_manager.get_color_scheme() == Adw.ColorScheme.DARK: + if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" ) From 004bf83923814f8d75d30179de80a9f2b12d76b5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:26:48 +0200 Subject: [PATCH 115/149] add debug --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 8a2c5bc14..e7c33d578 100644 --- a/src/main.py +++ b/src/main.py @@ -99,7 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) - print(self.style_manager.get_default()) + print(dir(self.style_manager.get_default())) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: From 3339808f0a28dd33710138e43516508069c986d0 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:28:27 +0200 Subject: [PATCH 116/149] add debug --- src/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.py b/src/main.py index e7c33d578..4eceea150 100644 --- a/src/main.py +++ b/src/main.py @@ -100,6 +100,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) print(dir(self.style_manager.get_default())) + print(self.style_manager.get_default().get_color_scheme()) print(self.style_manager.get_color_scheme()) print(dir(self.style_manager.get_color_scheme())) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: From aff7cf44f647e3d2fd89dfeabaf543c03f5f4198 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:33:27 +0200 Subject: [PATCH 117/149] fix style manager --- src/main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 4eceea150..e19935439 100644 --- a/src/main.py +++ b/src/main.py @@ -99,10 +99,7 @@ def do_activate(self): self.style_manager = Adw.StyleManager.get_default() print(dir(self.style_manager)) - print(dir(self.style_manager.get_default())) - print(self.style_manager.get_default().get_color_scheme()) - print(self.style_manager.get_color_scheme()) - print(dir(self.style_manager.get_color_scheme())) + print(self.style_manager.get_dark()) if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" From 8f2b40d01fe75f1ef4b3c412829d396d1f4e7568 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:34:28 +0200 Subject: [PATCH 118/149] add automatic preset choice if dark or ligjt --- src/main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index e19935439..a6578d3e4 100644 --- a/src/main.py +++ b/src/main.py @@ -98,9 +98,7 @@ def do_activate(self): self.reload_user_defined_presets() self.style_manager = Adw.StyleManager.get_default() - print(dir(self.style_manager)) - print(self.style_manager.get_dark()) - if self.style_manager.get_default() == Adw.ColorScheme.PREFER_DARK: + if self.style_manager.get_dark(): self.load_preset_from_resource( "/com/github/AdwCustomizerTeam/AdwCustomizer/presets/adwaita-dark.json" ) From 9f222bd06e2a5db7cec0593cf79bef2e4957d300 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:37:03 +0200 Subject: [PATCH 119/149] add automatic color choice for monet --- src/main.py | 7 ++++++- src/window.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a6578d3e4..4868c1575 100644 --- a/src/main.py +++ b/src/main.py @@ -243,7 +243,12 @@ def update_theme_from_monet(self, theme, tone, monet_theme): print(monet_theme) print(theme) - + if monet_theme == "automatic": + if self.style_manager.get_dark(): + monet_theme = "dark" + else: + monet_theme = "light" + if monet_theme == "dark": dark_theme = theme["schemes"]["dark"] variable = { diff --git a/src/window.py b/src/window.py index e5f413426..1f10d3f0a 100644 --- a/src/window.py +++ b/src/window.py @@ -144,6 +144,7 @@ def setup_monet_page(self): self.monet_theme_row.set_title(_("Theme")) store = Gtk.StringList() + store.append("Automatic") store.append("Dark") store.append("Light") self.monet_theme_row.set_model(store) From 28e6218038ed4f67c50b67d3bc350d704a748c76 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:39:34 +0200 Subject: [PATCH 120/149] update light theme scheme --- src/main.py | 64 ++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/main.py b/src/main.py index 4868c1575..6aa3b4843 100644 --- a/src/main.py +++ b/src/main.py @@ -300,50 +300,50 @@ def update_theme_from_monet(self, theme, tone, monet_theme): else: # light light_theme = theme["schemes"]["light"] variable = { - "accent_color": light_theme["primary"], - "accent_bg_color": light_theme["primaryContainer"], - "accent_fg_color": light_theme["onPrimaryContainer"], + "accent_color": self.rgba_from_argb(light_theme.primary), + "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), + "accent_fg_color": self.rgba_from_argb(light_theme.onPrimaryContainer), - "destructive_color": light_theme["error"], - "destructive_bg_color": light_theme["errorContainer"], - "destructive_fg_color": light_theme["onError"], + "destructive_color": self.rgba_from_argb(light_theme.error), + "destructive_bg_color": self.rgba_from_argb(light_theme.errorContainer), + "destructive_fg_color": self.rgba_from_argb(light_theme.onError), - "success_color": light_theme["tertiary"], - "success_bg_color": light_theme["onTertiary"], - "success_fg_color": light_theme["tertiaryContainer"], + "success_color": self.rgba_from_argb(light_theme.tertiary), + "success_bg_color": self.rgba_from_argb(light_theme.onTertiary), + "success_fg_color": self.rgba_from_argb(light_theme.tertiaryContainer), - "warning_color": light_theme["secondaryContainer"], - "warning_bg_color": light_theme["inversePrimary"], - "warning_fg_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "warning_color": self.rgba_from_argb(light_theme.secondaryContainer), + "warning_bg_color": self.rgba_from_argb(light_theme.inversePrimary), + "warning_fg_color": self.rgba_from_argb(light_theme.primary, "0.8"), - "error_color": light_theme["error"], - "error_bg_color": light_theme["errorContainer"], - "error_fg_color": light_theme["onError"], + "error_color": self.rgba_from_argb(light_theme.error), + "error_bg_color": self.rgba_from_argb(light_theme.errorContainer), + "error_fg_color": self.rgba_from_argb(light_theme.onError), - "window_bg_color": light_theme["surface"], - "window_fg_color": light_theme["onSurface"], + "window_bg_color": self.rgba_from_argb(light_theme.surface), + "window_fg_color": self.rgba_from_argb(light_theme.onSurface), - "view_bg_color": light_theme["surface"], - "view_fg_color": light_theme["onSurface"], + "view_bg_color": self.rgba_from_argb(light_theme.surface), + "view_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_bg_color": light_theme["surface"], - "headerbar_fg_color": light_theme["onSurface"], - "headerbar_border_color": self.rgba_from_argb(light_theme["primary"], "0.8"), + "headerbar_bg_color": self.rgba_from_argb(light_theme.surface), + "headerbar_fg_color": self.rgba_from_argb(light_theme.onSurface), + "headerbar_border_color": self.rgba_from_argb(light_theme.primary, "0.8"), "headerbar_backdrop_color": "@window_bg_color", - "headerbar_shade_color": light_theme["shadow"], + "headerbar_shade_color": self.rgba_from_argb(light_theme.shadow), - "card_bg_color": self.rgba_from_argb(light_theme["primary"], "0.05"), - "card_fg_color": light_theme["surfaceVariant"], - "card_shade_color": light_theme["shadow"], + "card_bg_color": self.rgba_from_argb(light_theme.primary, "0.05"), + "card_fg_color": self.rgba_from_argb(light_theme.surfaceVariant), + "card_shade_color": self.rgba_from_argb(light_theme.shadow), - "dialog_bg_color": light_theme["secondaryContainer"], - "dialog_fg_color": light_theme["onSecondaryContainer"], + "dialog_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), + "dialog_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - "popover_bg_color": light_theme["secondaryContainer"], - "popover_fg_color": light_theme["onSecondaryContainer"], + "popover_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), + "popover_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - "shade_color": light_theme["shadow"], - "scrollbar_outline_color": light_theme["outline"] + "shade_color": self.rgba_from_argb(light_theme.shadow), + "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline) } for key in variable.keys(): From 8e51c880acbddaf88d0f68b1940931835a57e6b2 Mon Sep 17 00:00:00 2001 From: David Lapshin Date: Thu, 11 Aug 2022 17:48:22 +0300 Subject: [PATCH 121/149] Fix missing settings-symbolic & open-menu-symbolic --- src/adwcustomizer.gresource.xml | 8 ++++++-- ...thub.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg | 2 -- ...AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg | 8 ++++++++ ....AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg | 2 ++ src/ui/window.blp | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) delete mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg create mode 100644 src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg diff --git a/src/adwcustomizer.gresource.xml b/src/adwcustomizer.gresource.xml index dc6a30581..fa71a5932 100644 --- a/src/adwcustomizer.gresource.xml +++ b/src/adwcustomizer.gresource.xml @@ -42,11 +42,15 @@ >icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg + alias="open-menu-symbolic.svg" + >icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg icons/com.github.AdwCustomizerTeam.AdwCustomizer-disk-unsaved-fill-symbolic.svg + icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg deleted file mode 100644 index 50b8a3c4d..000000000 --- a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-menu-symbolic.svg +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg new file mode 100644 index 000000000..7f4474335 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-open-menu-symbolic.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg new file mode 100644 index 000000000..408d7e5d4 --- /dev/null +++ b/src/icons/com.github.AdwCustomizerTeam.AdwCustomizer-settings-symbolic.svg @@ -0,0 +1,2 @@ + + diff --git a/src/ui/window.blp b/src/ui/window.blp index e9e6deb74..3b3abc816 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -47,7 +47,7 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { [end] Gtk.MenuButton { - icon-name: "menu-symbolic"; + icon-name: "open-menu-symbolic"; menu-model: main-menu; } From 84dda5f78d499801a49c20ed7163bfec4854f006 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 16:53:41 +0200 Subject: [PATCH 122/149] add switch to select dark or light apply --- src/main.py | 72 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/src/main.py b/src/main.py index 6aa3b4843..819f4dd10 100644 --- a/src/main.py +++ b/src/main.py @@ -443,7 +443,13 @@ def show_apply_color_scheme_dialog(self, *_args): Adw.ResponseAppearance.SUGGESTED, transient_for=self.props.active_window, ) - dialog.connect("response", self.apply_color_scheme) + + switch = Gtk.Switch() + print(dir(switch)) + + dialog.set_extra_child(switch) + + dialog.connect("response", self.apply_color_scheme, switch) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -534,28 +540,50 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response): + def apply_color_scheme(self, widget, response, switch): if response == "apply": - if widget.get_app_types()["gtk4"]: - gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") - if not os.path.exists(gtk4_dir): - os.makedirs(gtk4_dir) - gtk4_css = self.generate_gtk_css("gtk4") - with open( - os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8" - ) as file: - file.write(gtk4_css) - if widget.get_app_types()["gtk3"]: - gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") - if not os.path.exists(gtk3_dir): - os.makedirs(gtk3_dir) - gtk3_css = self.generate_gtk_css("gtk3") - with open( - os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" - ) as file: - file.write(gtk3_css) + if switch.get_active(): + if widget.get_app_types()["gtk4"]: + gtk4_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + if not os.path.exists(gtk4_dir): + os.makedirs(gtk4_dir) + gtk4_css = self.generate_gtk_css("gtk4") + with open( + os.path.join(gtk4_dir, "gtk-dark.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk4_css) + if widget.get_app_types()["gtk3"]: + gtk3_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + if not os.path.exists(gtk3_dir): + os.makedirs(gtk3_dir) + gtk3_css = self.generate_gtk_css("gtk3") + with open( + os.path.join(gtk3_dir, "gtk-dark.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk3_css) + else: + if widget.get_app_types()["gtk4"]: + gtk4_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + if not os.path.exists(gtk4_dir): + os.makedirs(gtk4_dir) + gtk4_css = self.generate_gtk_css("gtk4") + with open( + os.path.join(gtk4_dir, "gtk.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk4_css) + if widget.get_app_types()["gtk3"]: + gtk3_dir = os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + if not os.path.exists(gtk3_dir): + os.makedirs(gtk3_dir) + gtk3_css = self.generate_gtk_css("gtk3") + with open( + os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" + ) as file: + file.write(gtk3_css) self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): From 5e96066b9c4b1578a159c564f9931efeacbd0c19 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 17:57:02 +0200 Subject: [PATCH 123/149] change license Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 819f4dd10..a8e7e471a 100644 --- a/src/main.py +++ b/src/main.py @@ -641,7 +641,7 @@ def show_about_window(self, *_args): Juanjo Cillero https://www.transifex.com/user/profile/renux918/ Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", - license_type=Gtk.License.MIT_X11, + license_type=Gtk.License.GPL_3_0, ) about.present() From f054988887d13b1517b79cba8f9a69957d671ad4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:21:13 +0200 Subject: [PATCH 124/149] rework apply --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index a8e7e471a..fc68884de 100644 --- a/src/main.py +++ b/src/main.py @@ -444,7 +444,7 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - switch = Gtk.Switch() + switch = Adw.ActionRow() print(dir(switch)) dialog.set_extra_child(switch) From 7639f5313c1e8a1d031adcbb3bed350edb153cf9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:24:37 +0200 Subject: [PATCH 125/149] update comborow --- src/main.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main.py b/src/main.py index fc68884de..04ac224e6 100644 --- a/src/main.py +++ b/src/main.py @@ -444,12 +444,18 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - switch = Adw.ActionRow() - print(dir(switch)) + comborow = Adw.ComboRow() + comborow.set_title(_("Apply as dark theme")) - dialog.set_extra_child(switch) + store = Gtk.StringList() + store.append("Dark") + store.append("Light") + comborow.set_model(store) + print(dir(comborow)) - dialog.connect("response", self.apply_color_scheme, switch) + dialog.set_extra_child(comborow) + + dialog.connect("response", self.apply_color_scheme, comborow) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -540,9 +546,9 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response, switch): + def apply_color_scheme(self, widget, response, comborow): if response == "apply": - if switch.get_active(): + if comborow.get_string().lower() == "dark": if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") From ac53e2e876add0dad2e4871bd7b3a66ea0ab0df7 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:31:44 +0200 Subject: [PATCH 126/149] use switch instead --- src/main.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main.py b/src/main.py index 04ac224e6..f76002025 100644 --- a/src/main.py +++ b/src/main.py @@ -444,18 +444,18 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - comborow = Adw.ComboRow() - comborow.set_title(_("Apply as dark theme")) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - store = Gtk.StringList() - store.append("Dark") - store.append("Light") - comborow.set_model(store) - print(dir(comborow)) + label = Gtk.Label(text="Export as Dark theme") + switch = Gtk.Switch() - dialog.set_extra_child(comborow) + box.append(label) + box.append(switch) + print(dir(switch)) - dialog.connect("response", self.apply_color_scheme, comborow) + dialog.set_extra_child(box) + + dialog.connect("response", self.apply_color_scheme, switch) dialog.present() def show_reset_color_scheme_dialog(self, *_args): @@ -546,9 +546,9 @@ def save_preset(self, _unused, response, entry): self.clear_dirty() self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) - def apply_color_scheme(self, widget, response, comborow): + def apply_color_scheme(self, widget, response, switch): if response == "apply": - if comborow.get_string().lower() == "dark": + if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") From 4278e213228f94e38423a59aa46942ed2b00b4db Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:32:46 +0200 Subject: [PATCH 127/149] fix bug --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index f76002025..b681a0398 100644 --- a/src/main.py +++ b/src/main.py @@ -446,7 +446,7 @@ def show_apply_color_scheme_dialog(self, *_args): box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - label = Gtk.Label(text="Export as Dark theme") + label = Gtk.Label(label="Export as Dark theme") switch = Gtk.Switch() box.append(label) From 18bb8725ee3e5420d4b5d249e344699b7c1ea30a Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:35:23 +0200 Subject: [PATCH 128/149] increase spacing --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index b681a0398..959b83397 100644 --- a/src/main.py +++ b/src/main.py @@ -444,7 +444,7 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=30) label = Gtk.Label(label="Export as Dark theme") switch = Gtk.Switch() From b6105f6302a28c6ad4f2f6b9b033b6e2e8ca59cf Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:38:00 +0200 Subject: [PATCH 129/149] update label --- src/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 959b83397..8595303d5 100644 --- a/src/main.py +++ b/src/main.py @@ -444,9 +444,9 @@ def show_apply_color_scheme_dialog(self, *_args): transient_for=self.props.active_window, ) - box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=30) + box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=6) - label = Gtk.Label(label="Export as Dark theme") + label = Gtk.Label(label="Apply as Dark theme") switch = Gtk.Switch() box.append(label) From b7c6be25e731b205bf7a8c7ecb45bee60a10b014 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:39:24 +0200 Subject: [PATCH 130/149] format --- src/main.py | 72 +++++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/main.py b/src/main.py index 8595303d5..4d4d6f45a 100644 --- a/src/main.py +++ b/src/main.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -36,6 +36,7 @@ from .custom_css_group import AdwcustomizerCustomCSSGroup from .plugins_list import AdwcustomizerPluginsList + def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -114,7 +115,7 @@ def reload_user_defined_presets(self): self.props.active_window.presets_menu.remove(1) preset_directory = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets") if not os.path.exists(preset_directory): os.makedirs(preset_directory) @@ -141,7 +142,8 @@ def reload_user_defined_presets(self): "line": traceback.format_exc().strip(), } ) - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Failed to load preset"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Failed to load preset"))) self.props.active_window.update_errors(self.global_errors) @@ -174,7 +176,8 @@ def open_dir_callback(_, result): self.portal.open_uri( parent, - "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets"), + "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets"), Xdp.OpenUriFlags.NONE, None, open_dir_callback, @@ -214,8 +217,7 @@ def load_preset_variables(self, preset): self.reload_variables() - - def rgba_from_argb(self, argb, alpha = None) -> str: + def rgba_from_argb(self, argb, alpha=None) -> str: base = "rgba({}, {}, {}, {})" red = redFromArgb(argb) @@ -229,28 +231,22 @@ def rgba_from_argb(self, argb, alpha = None) -> str: def update_theme_from_monet(self, theme, tone, monet_theme): palettes = theme["palettes"] - monet_theme = monet_theme.get_string().lower() # dark / light + monet_theme = monet_theme.get_string().lower() # dark / light palette = {} i = 0 for color in palettes.values(): i += 1 palette[str(i)] = hexFromArgb(color.tone(int(tone.get_string()))) - - print(palette) - self.pref_palette_shades["monet"].update_shades(palette) - - print(monet_theme) - print(theme) if monet_theme == "automatic": if self.style_manager.get_dark(): monet_theme = "dark" else: monet_theme = "light" - + if monet_theme == "dark": - dark_theme = theme["schemes"]["dark"] + dark_theme = theme["schemes"]["dark"] variable = { "accent_color": self.rgba_from_argb(dark_theme.primary), "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), @@ -297,8 +293,8 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "shade_color": self.rgba_from_argb(dark_theme.shadow), "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) } - else: # light - light_theme = theme["schemes"]["light"] + else: # light + light_theme = theme["schemes"]["light"] variable = { "accent_color": self.rgba_from_argb(light_theme.primary), "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), @@ -349,7 +345,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): for key in variable.keys(): if key in self.pref_variables: self.pref_variables[key].update_value(variable[key]) - + self.reload_variables() def generate_gtk_css(self, app_type): @@ -419,7 +415,8 @@ def load_preset_action(self, _unused, *args): if args[0].get_string().startswith("custom-"): self.load_preset_from_file( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", args[0].get_string().replace("custom-", "", 1) + ".json", ) @@ -451,7 +448,6 @@ def show_apply_color_scheme_dialog(self, *_args): box.append(label) box.append(switch) - print(dir(switch)) dialog.set_extra_child(box) @@ -478,7 +474,8 @@ def show_save_preset_dialog(self, *_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(self.preset_name) + ".json", ) @@ -501,7 +498,7 @@ def on_preset_entry_change(*_args): dialog.set_body( _( "Saving preset to {0}. If that preset already exists, it will be overwritten!" - ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "presets")) + ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets")) ) dialog.set_response_enabled("save", False) else: @@ -510,7 +507,8 @@ def on_preset_entry_change(*_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(preset_entry.get_text()) + ".json", ) @@ -529,7 +527,8 @@ def save_preset(self, _unused, response, entry): if response == "save": with open( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), + os.environ.get("XDG_CONFIG_HOME", + os.environ["HOME"] + "/.config"), "presets", to_slug_case(entry.get_text()) + ".json", ), @@ -544,14 +543,15 @@ def save_preset(self, _unused, response, entry): } file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme successfully saved!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Scheme successfully saved!"))) def apply_color_scheme(self, widget, response, switch): if response == "apply": if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -561,7 +561,7 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -572,7 +572,7 @@ def apply_color_scheme(self, widget, response, switch): else: if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -582,7 +582,7 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -590,30 +590,32 @@ def apply_color_scheme(self, widget, response, switch): os.path.join(gtk3_dir, "gtk.css"), "w", encoding="utf-8" ) as file: file.write(gtk3_css) - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Scheme set successfully!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Scheme set successfully!"))) def reset_color_scheme(self, widget, response): if response == "reset": if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-4.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0/gtk.css") ) try: file.delete() except Exception: pass - + if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" ), "gtk-3.0/gtk.css") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0/gtk.css") ) try: file.delete() except Exception: pass - self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) + self.win.toast_overlay.add_toast( + Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( From 1ee3b7c0bf0d349004c57742ef8498cb4b501df5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:39:52 +0200 Subject: [PATCH 131/149] format --- src/app_type_dialog.py | 23 +++- src/custom_css_group.py | 24 ++-- src/error.py | 9 +- src/main.py | 157 +++++++++++++------------ src/option.py | 27 +++-- src/palette_shades.py | 25 ++-- src/plugin.py | 11 +- src/plugins/__init__.py | 6 +- src/plugins/gtk4.py | 7 +- src/plugins_list.py | 21 ++-- src/setting.py | 7 +- src/settings_schema.py | 251 ++++++++++++++++++++-------------------- src/window.py | 70 ++++++----- 13 files changed, 355 insertions(+), 283 deletions(-) diff --git a/src/app_type_dialog.py b/src/app_type_dialog.py index be2707fe2..f7f88133d 100644 --- a/src/app_type_dialog.py +++ b/src/app_type_dialog.py @@ -7,25 +7,36 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/app_type_dialog.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/app_type_dialog.ui" +) class AdwcustomizerAppTypeDialog(Adw.MessageDialog): - __gtype_name__ = 'AdwcustomizerAppTypeDialog' + __gtype_name__ = "AdwcustomizerAppTypeDialog" gtk4_app_type = Gtk.Template.Child("gtk4-app-type") gtk3_app_type = Gtk.Template.Child("gtk3-app-type") - def __init__(self, heading, body, ok_response_name, ok_response_label, ok_response_appearance, **kwargs): + def __init__( + self, + heading, + body, + ok_response_name, + ok_response_label, + ok_response_appearance, + **kwargs + ): super().__init__(**kwargs) self.set_heading(heading) self.set_body(body) @@ -39,5 +50,5 @@ def __init__(self, heading, body, ok_response_name, ok_response_label, ok_respon def get_app_types(self): return { "gtk4": self.gtk4_app_type.get_active(), - "gtk3": self.gtk3_app_type.get_active() + "gtk3": self.gtk3_app_type.get_active(), } diff --git a/src/custom_css_group.py b/src/custom_css_group.py index 2e2d453bd..1f98ab800 100644 --- a/src/custom_css_group.py +++ b/src/custom_css_group.py @@ -7,20 +7,23 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/custom_css_group.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/custom_css_group.ui" +) class AdwcustomizerCustomCSSGroup(Adw.PreferencesGroup): - __gtype_name__ = 'AdwcustomizerCustomCSSGroup' + __gtype_name__ = "AdwcustomizerCustomCSSGroup" app_type_dropdown = Gtk.Template.Child("app-type-dropdown") custom_css_text_view = Gtk.Template.Child("custom-css-text-view") @@ -31,14 +34,21 @@ def __init__(self, **kwargs): def load_custom_css(self, custom_css): self.custom_css = custom_css - self.custom_css_text_view.get_buffer().set_text(list(self.custom_css.values())[self.app_type_dropdown.get_selected()]) + self.custom_css_text_view.get_buffer().set_text( + list(self.custom_css.values())[self.app_type_dropdown.get_selected()] + ) @Gtk.Template.Callback() def on_custom_css_changed(self, buffer): Gtk.Application.get_default().mark_as_dirty() - Gtk.Application.get_default().update_custom_css_text(list(self.custom_css.keys())[self.app_type_dropdown.get_selected()], buffer.props.text) + Gtk.Application.get_default().update_custom_css_text( + list(self.custom_css.keys())[self.app_type_dropdown.get_selected()], + buffer.props.text, + ) @Gtk.Template.Callback() def on_dropdown_notify(self, _unused, pspec): if pspec.name == "selected": - self.custom_css_text_view.get_buffer().set_text(list(self.custom_css.values())[self.app_type_dropdown.get_selected()]) + self.custom_css_text_view.get_buffer().set_text( + list(self.custom_css.values())[self.app_type_dropdown.get_selected()] + ) diff --git a/src/error.py b/src/error.py index 98fd3fdf1..2760bd544 100644 --- a/src/error.py +++ b/src/error.py @@ -7,20 +7,21 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/error.ui') + +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/error.ui") class AdwcustomizerError(Gtk.ListBoxRow): - __gtype_name__ = 'AdwcustomizerError' + __gtype_name__ = "AdwcustomizerError" error_label = Gtk.Template.Child("error-label") element_label = Gtk.Template.Child("element-label") diff --git a/src/main.py b/src/main.py index 4d4d6f45a..042eaf87b 100644 --- a/src/main.py +++ b/src/main.py @@ -89,10 +89,8 @@ def do_activate(self): GLib.Variant("s", "adwaita"), self.load_preset_action, ) - self.create_action("apply_color_scheme", - self.show_apply_color_scheme_dialog) - self.create_action("reset_color_scheme", - self.show_reset_color_scheme_dialog) + self.create_action("apply_color_scheme", self.show_apply_color_scheme_dialog) + self.create_action("reset_color_scheme", self.show_reset_color_scheme_dialog) self.create_action("save_preset", self.show_save_preset_dialog) self.create_action("about", self.show_about_window) @@ -115,7 +113,9 @@ def reload_user_defined_presets(self): self.props.active_window.presets_menu.remove(1) preset_directory = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets") + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), + "presets", + ) if not os.path.exists(preset_directory): os.makedirs(preset_directory) @@ -132,8 +132,7 @@ def reload_user_defined_presets(self): raise KeyError("variables") if preset.get("palette") is None: raise KeyError("palette") - self.custom_presets[file_name.replace( - ".json", "")] = preset["name"] + self.custom_presets[file_name.replace(".json", "")] = preset["name"] except Exception: self.global_errors.append( { @@ -143,7 +142,8 @@ def reload_user_defined_presets(self): } ) self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Failed to load preset"))) + Adw.Toast(title=_("Failed to load preset")) + ) self.props.active_window.update_errors(self.global_errors) @@ -176,8 +176,11 @@ def open_dir_callback(_, result): self.portal.open_uri( parent, - "file://" + os.path.join(os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), "presets"), + "file://" + + os.path.join( + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), + "presets", + ), Xdp.OpenUriFlags.NONE, None, open_dir_callback, @@ -190,8 +193,7 @@ def load_preset_from_file(self, preset_path): self.load_preset_variables(json.loads(preset_text)) def load_preset_from_resource(self, preset_path): - preset_text = Gio.resources_lookup_data( - preset_path, 0).get_data().decode() + preset_text = Gio.resources_lookup_data(preset_path, 0).get_data().decode() self.load_preset_variables(json.loads(preset_text)) def load_preset_variables(self, preset): @@ -251,47 +253,40 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_color": self.rgba_from_argb(dark_theme.primary), "accent_bg_color": self.rgba_from_argb(dark_theme.primaryContainer), "accent_fg_color": self.rgba_from_argb(dark_theme.onPrimaryContainer), - "destructive_color": self.rgba_from_argb(dark_theme.error), "destructive_bg_color": self.rgba_from_argb(dark_theme.errorContainer), "destructive_fg_color": self.rgba_from_argb(dark_theme.onError), - "success_color": self.rgba_from_argb(dark_theme.tertiary), "success_bg_color": self.rgba_from_argb(dark_theme.onTertiary), "success_fg_color": self.rgba_from_argb(dark_theme.tertiaryContainer), - "warning_color": self.rgba_from_argb(dark_theme.secondaryContainer), "warning_bg_color": self.rgba_from_argb(dark_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(dark_theme.primary, "0.8"), - "error_color": self.rgba_from_argb(dark_theme.error), "error_bg_color": self.rgba_from_argb(dark_theme.errorContainer), "error_fg_color": self.rgba_from_argb(dark_theme.onError), - "window_bg_color": self.rgba_from_argb(dark_theme.surface), "window_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "view_bg_color": self.rgba_from_argb(dark_theme.surface), "view_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_bg_color": self.rgba_from_argb(dark_theme.surface), "headerbar_fg_color": self.rgba_from_argb(dark_theme.onSurface), - "headerbar_border_color": self.rgba_from_argb(dark_theme.primary, "0.8"), + "headerbar_border_color": self.rgba_from_argb( + dark_theme.primary, "0.8" + ), "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), - "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), "card_shade_color": self.rgba_from_argb(dark_theme.shadow), - "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - "popover_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), - "popover_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), - + "popover_fg_color": self.rgba_from_argb( + dark_theme.onSecondaryContainer + ), "shade_color": self.rgba_from_argb(dark_theme.shadow), - "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline) + "scrollbar_outline_color": self.rgba_from_argb(dark_theme.outline), } else: # light light_theme = theme["schemes"]["light"] @@ -299,47 +294,42 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "accent_color": self.rgba_from_argb(light_theme.primary), "accent_bg_color": self.rgba_from_argb(light_theme.primaryContainer), "accent_fg_color": self.rgba_from_argb(light_theme.onPrimaryContainer), - "destructive_color": self.rgba_from_argb(light_theme.error), "destructive_bg_color": self.rgba_from_argb(light_theme.errorContainer), "destructive_fg_color": self.rgba_from_argb(light_theme.onError), - "success_color": self.rgba_from_argb(light_theme.tertiary), "success_bg_color": self.rgba_from_argb(light_theme.onTertiary), "success_fg_color": self.rgba_from_argb(light_theme.tertiaryContainer), - "warning_color": self.rgba_from_argb(light_theme.secondaryContainer), "warning_bg_color": self.rgba_from_argb(light_theme.inversePrimary), "warning_fg_color": self.rgba_from_argb(light_theme.primary, "0.8"), - "error_color": self.rgba_from_argb(light_theme.error), "error_bg_color": self.rgba_from_argb(light_theme.errorContainer), "error_fg_color": self.rgba_from_argb(light_theme.onError), - "window_bg_color": self.rgba_from_argb(light_theme.surface), "window_fg_color": self.rgba_from_argb(light_theme.onSurface), - "view_bg_color": self.rgba_from_argb(light_theme.surface), "view_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_bg_color": self.rgba_from_argb(light_theme.surface), "headerbar_fg_color": self.rgba_from_argb(light_theme.onSurface), - "headerbar_border_color": self.rgba_from_argb(light_theme.primary, "0.8"), + "headerbar_border_color": self.rgba_from_argb( + light_theme.primary, "0.8" + ), "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(light_theme.shadow), - "card_bg_color": self.rgba_from_argb(light_theme.primary, "0.05"), "card_fg_color": self.rgba_from_argb(light_theme.surfaceVariant), "card_shade_color": self.rgba_from_argb(light_theme.shadow), - "dialog_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), - "dialog_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - + "dialog_fg_color": self.rgba_from_argb( + light_theme.onSecondaryContainer + ), "popover_bg_color": self.rgba_from_argb(light_theme.secondaryContainer), - "popover_fg_color": self.rgba_from_argb(light_theme.onSecondaryContainer), - + "popover_fg_color": self.rgba_from_argb( + light_theme.onSecondaryContainer + ), "shade_color": self.rgba_from_argb(light_theme.shadow), - "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline) + "scrollbar_outline_color": self.rgba_from_argb(light_theme.outline), } for key in variable.keys(): @@ -395,8 +385,7 @@ def on_error(_, section, error): css_provider.connect("parsing-error", on_error) css_provider.load_from_data(gtk_css.encode()) - self.props.active_window.update_errors( - self.global_errors + parsing_errors) + self.props.active_window.update_errors(self.global_errors + parsing_errors) # loading with the priority above user to override the applied config if self.current_css_provider is not None: Gtk.StyleContext.remove_provider_for_display( @@ -415,8 +404,7 @@ def load_preset_action(self, _unused, *args): if args[0].get_string().startswith("custom-"): self.load_preset_from_file( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", args[0].get_string().replace("custom-", "", 1) + ".json", ) @@ -474,8 +462,7 @@ def show_save_preset_dialog(self, *_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", to_slug_case(self.preset_name) + ".json", ) @@ -485,8 +472,7 @@ def show_save_preset_dialog(self, *_args): dialog.add_response("cancel", _("Cancel")) dialog.add_response("save", _("Save")) - dialog.set_response_appearance( - "save", Adw.ResponseAppearance.SUGGESTED) + dialog.set_response_appearance("save", Adw.ResponseAppearance.SUGGESTED) dialog.set_default_response("cancel") dialog.set_close_response("cancel") @@ -498,7 +484,14 @@ def on_preset_entry_change(*_args): dialog.set_body( _( "Saving preset to {0}. If that preset already exists, it will be overwritten!" - ).format(os.path.join(os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets")) + ).format( + os.path.join( + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "presets", + ) + ) ) dialog.set_response_enabled("save", False) else: @@ -507,8 +500,9 @@ def on_preset_entry_change(*_args): "Saving preset to {0}. If that preset already exists, it will be overwritten!" ).format( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), "presets", to_slug_case(preset_entry.get_text()) + ".json", ) @@ -527,8 +521,7 @@ def save_preset(self, _unused, response, entry): if response == "save": with open( os.path.join( - os.environ.get("XDG_CONFIG_HOME", - os.environ["HOME"] + "/.config"), + os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "presets", to_slug_case(entry.get_text()) + ".json", ), @@ -544,14 +537,19 @@ def save_preset(self, _unused, response, entry): file.write(json.dumps(object_to_write, indent=4)) self.clear_dirty() self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Scheme successfully saved!"))) + Adw.Toast(title=_("Scheme successfully saved!")) + ) def apply_color_scheme(self, widget, response, switch): if response == "apply": if switch.get_active(): if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0", + ) if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -561,7 +559,11 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0", + ) if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -572,7 +574,11 @@ def apply_color_scheme(self, widget, response, switch): else: if widget.get_app_types()["gtk4"]: gtk4_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0", + ) if not os.path.exists(gtk4_dir): os.makedirs(gtk4_dir) gtk4_css = self.generate_gtk_css("gtk4") @@ -582,7 +588,11 @@ def apply_color_scheme(self, widget, response, switch): file.write(gtk4_css) if widget.get_app_types()["gtk3"]: gtk3_dir = os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0", + ) if not os.path.exists(gtk3_dir): os.makedirs(gtk3_dir) gtk3_css = self.generate_gtk_css("gtk3") @@ -591,14 +601,19 @@ def apply_color_scheme(self, widget, response, switch): ) as file: file.write(gtk3_css) self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Scheme set successfully!"))) + Adw.Toast(title=_("Scheme set successfully!")) + ) def reset_color_scheme(self, widget, response): if response == "reset": if widget.get_app_types()["gtk4"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-4.0/gtk.css") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-4.0/gtk.css", + ) ) try: file.delete() @@ -608,14 +623,17 @@ def reset_color_scheme(self, widget, response): if widget.get_app_types()["gtk3"]: file = Gio.File.new_for_path( os.path.join( - os.environ.get("XDG_CONFIG_HOME", os.environ["HOME"] + "/.config"), "gtk-3.0/gtk.css") + os.environ.get( + "XDG_CONFIG_HOME", os.environ["HOME"] + "/.config" + ), + "gtk-3.0/gtk.css", + ) ) try: file.delete() except Exception: pass - self.win.toast_overlay.add_toast( - Adw.Toast(title=_("Reset successfully!"))) + self.win.toast_overlay.add_toast(Adw.Toast(title=_("Reset successfully!"))) def show_about_window(self, *_args): about = Adw.AboutWindow( @@ -631,12 +649,8 @@ def show_about_window(self, *_args): "0xMRTT https://github.com/0xMRTT", "Verantor https://github.com/Verantor", ], - artists=[ - 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' - ], - designers=[ - 'David "Daudix UFO" Lapshin https://github.com/daudix-UFO' - ], + artists=['David "Daudix UFO" Lapshin https://github.com/daudix-UFO'], + designers=['David "Daudix UFO" Lapshin https://github.com/daudix-UFO'], # Translators: This is a place to put your credits (formats: "Name https://example.com" or "Name ", no quotes) and is not meant to be translated literally. translator_credits="""Maxime V https://www.transifex.com/user/profile/Adaoh/ FineFindus https://github.com/FineFindus @@ -676,8 +690,7 @@ def create_stateful_action( self, name, parameter_type, initial_state, callback, shortcuts=None ): """Add a stateful application action.""" - action = Gio.SimpleAction.new_stateful( - name, parameter_type, initial_state) + action = Gio.SimpleAction.new_stateful(name, parameter_type, initial_state) action.connect("activate", callback) self.add_action(action) if shortcuts: diff --git a/src/option.py b/src/option.py index ed98f2d12..885339f22 100644 --- a/src/option.py +++ b/src/option.py @@ -7,20 +7,21 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/option.ui') + +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/option.ui") class AdwcustomizerOption(Adw.ActionRow): - __gtype_name__ = 'AdwcustomizerOption' + __gtype_name__ = "AdwcustomizerOption" color_value = Gtk.Template.Child("color-value") text_value = Gtk.Template.Child("text-value") @@ -42,10 +43,14 @@ def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs): self.warning_button.set_visible(False) elif adw_gtk3_support == "partial": self.warning_button.add_css_class("warning") - self.warning_label.set_label(_("This option is only partially supported by the adw-gtk3 theme.")) + self.warning_label.set_label( + _("This option is only partially supported by the adw-gtk3 theme.") + ) elif adw_gtk3_support == "no": self.warning_button.add_css_class("error") - self.warning_label.set_label(_("This option is not supported by the adw-gtk3 theme.")) + self.warning_label.set_label( + _("This option is not supported by the adw-gtk3 theme.") + ) self.explanation_label.set_label(explanation or "") if explanation is None: @@ -53,7 +58,9 @@ def __init__(self, name, title, explanation, adw_gtk3_support="yes", **kwargs): @Gtk.Template.Callback() def on_color_value_changed(self, *_args): - self.update_value(self.color_value.get_rgba().to_string(), update_from="color_value") + self.update_value( + self.color_value.get_rgba().to_string(), update_from="color_value" + ) @Gtk.Template.Callback() def on_text_value_changed(self, *_args): @@ -86,7 +93,11 @@ def update_value(self, new_value, **kwargs): self.color_value.set_rgba(rgba) self.color_value.set_tooltip_text(_("Not a color, see text value")) - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "text_value" and new_value != "": + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "text_value" + and new_value != "" + ): Gtk.Application.get_default().variables[self.get_name()] = new_value Gtk.Application.get_default().mark_as_dirty() Gtk.Application.get_default().reload_variables() diff --git a/src/palette_shades.py b/src/palette_shades.py index f7eb9bf79..dcb0cc63d 100644 --- a/src/palette_shades.py +++ b/src/palette_shades.py @@ -7,20 +7,23 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from gi.repository import Gtk, Gdk, Adw -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/palette_shades.ui') + +@Gtk.Template( + resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/palette_shades.ui" +) class AdwcustomizerPaletteShades(Adw.ActionRow): - __gtype_name__ = 'AdwcustomizerPaletteShades' + __gtype_name__ = "AdwcustomizerPaletteShades" def __init__(self, prefix, color_title, n_shades, **kwargs): super().__init__(**kwargs) @@ -52,9 +55,17 @@ def update_shades(self, shades, **kwargs): if new_rgba.parse(shades[str(i)]): self.color_pickers[str(i)].set_rgba(new_rgba) self.color_pickers[str(i)].set_tooltip_text(shades[str(i)]) - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "color_value": - Gtk.Application.get_default().palette[self.prefix][str(i)] = shades[str(i)] + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "color_value" + ): + Gtk.Application.get_default().palette[self.prefix][str(i)] = shades[ + str(i) + ] - if Gtk.Application.get_default().is_ready and kwargs.get("update_from") == "color_value": + if ( + Gtk.Application.get_default().is_ready + and kwargs.get("update_from") == "color_value" + ): Gtk.Application.get_default().mark_as_dirty() Gtk.Application.get_default().reload_variables() diff --git a/src/plugin.py b/src/plugin.py index 16a234f24..cceb7e014 100644 --- a/src/plugin.py +++ b/src/plugin.py @@ -7,17 +7,18 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from .setting import AdwcustomizerSetting + class AdwcustomizerPlugin: def __init__(self): self.title = None @@ -48,7 +49,9 @@ def get_custom_settings_for_preset(self): def get_alias_values(self): alias_values = {} for key, value in self.alias_dict.items(): - alias_values[key] = self.colors.get(value, self.palette.get(value, self.custom_settings.get(value))) + alias_values[key] = self.colors.get( + value, self.palette.get(value, self.custom_settings.get(value)) + ) return alias_values def validate(self): @@ -58,4 +61,4 @@ def apply(self): raise NotImplementedError() def save(self): - pass \ No newline at end of file + pass diff --git a/src/plugins/__init__.py b/src/plugins/__init__.py index a66319289..f93ffe537 100644 --- a/src/plugins/__init__.py +++ b/src/plugins/__init__.py @@ -7,11 +7,11 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License -# along with this program. If not, see . \ No newline at end of file +# along with this program. If not, see . diff --git a/src/plugins/gtk4.py b/src/plugins/gtk4.py index b5a7d14f1..dd5fe68e9 100644 --- a/src/plugins/gtk4.py +++ b/src/plugins/gtk4.py @@ -7,16 +7,17 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . from ..plugin import AdwcustomizerPlugin + class AdwcustomizerGtk4Plugin(AdwcustomizerPlugin): - pass \ No newline at end of file + pass diff --git a/src/plugins_list.py b/src/plugins_list.py index 3c7c04b35..d2c14499e 100644 --- a/src/plugins_list.py +++ b/src/plugins_list.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -20,22 +20,27 @@ import os from pathlib import Path import importlib + + class AdwcustomizerPluginsList: def __init__(self): - self.plugins = { # AdwCustomizerTeam plugins - "gtk4": AdwcustomizerGtk4Plugin() - } + self.plugins = {"gtk4": AdwcustomizerGtk4Plugin()} # AdwCustomizerTeam plugins self.add_user_plugins() def add_user_plugins(self): - self.user_plugin_dir = Path(os.environ.get("XDG_DATA_HOME", os.environ["HOME"])) / ".local" / "share" / "AdwCustomizer" / "plugins" + self.user_plugin_dir = ( + Path(os.environ.get("XDG_DATA_HOME", os.environ["HOME"])) + / ".local" + / "share" + / "AdwCustomizer" + / "plugins" + ) if self.user_plugin_dir.exists(): for path, _, name in os.walk(self.user_plugin_dir): print(name[0]) else: print("No plugins dir found") - def load_all_custom_settings(self, settings): for plugin_id, plugin in self.plugins.items(): plugin.load_custom_settings(settings[plugin_id]) @@ -43,4 +48,4 @@ def load_all_custom_settings(self, settings): def get_all_custom_settings_for_preset(self): custom_settings = {} for plugin_id, plugin in self.plugins.items(): - custom_settings[plugin_id] = plugin.get_custom_settings_for_preset() \ No newline at end of file + custom_settings[plugin_id] = plugin.get_custom_settings_for_preset() diff --git a/src/setting.py b/src/setting.py index 9a7492815..a2d3479b5 100644 --- a/src/setting.py +++ b/src/setting.py @@ -7,15 +7,16 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . + class AdwcustomizerSetting: def __init__(self, name, title, value_type, explanation=None, default_value=None): # TODO supported types: @@ -34,4 +35,4 @@ def __init__(self, name, title, value_type, explanation=None, default_value=None def set_value(self, new_value): # TODO checks - self.value = new_value \ No newline at end of file + self.value = new_value diff --git a/src/settings_schema.py b/src/settings_schema.py index ea9317441..ea22ce840 100644 --- a/src/settings_schema.py +++ b/src/settings_schema.py @@ -7,12 +7,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -21,117 +21,137 @@ { "name": "accent_colors", "title": _("Accent Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, and entries, to indicate that a widget is important, interactive, or currently active."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, and entries, to indicate that a widget is important, interactive, or currently active." + ), "variables": [ { "name": "accent_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "accent_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "accent_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "destructive_colors", "title": _("Destructive Colors"), - "description": _("These colors are used for buttons to indicate a dangerous action, such as deleting a file."), + "description": _( + "These colors are used for buttons to indicate a dangerous action, such as deleting a file." + ), "variables": [ { "name": "destructive_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "destructive_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "destructive_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "success_colors", "title": _("Success Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a success or a high level."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a success or a high level." + ), "variables": [ { "name": "success_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "success_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "success_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "warning_colors", "title": _("Warning Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a warning or a low level."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, entries, and level bars, to indicate a warning or a low level." + ), "variables": [ { "name": "warning_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "warning_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "warning_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "error_colors", "title": _("Error Colors"), - "description": _("These colors are used across many different widgets, such as buttons, labels, and entries, to indicate a failure."), + "description": _( + "These colors are used across many different widgets, such as buttons, labels, and entries, to indicate a failure." + ), "variables": [ { "name": "error_color", "title": _("Standalone Color"), - "explanation": _("The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window."), - "adw_gtk3_support": "yes" + "explanation": _( + "The standalone colors are similar to the background ones, but provide better contrast when used as foreground color on top of a neutral background - for example, colorful text in a window." + ), + "adw_gtk3_support": "yes", }, { "name": "error_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "error_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "partial" - } - ] + "adw_gtk3_support": "partial", + }, + ], }, { "name": "window_colors", @@ -141,66 +161,76 @@ { "name": "window_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "window_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "view_colors", "title": _("View Colors"), - "description": _("These colors are used in a variety of widgets, such as text views and entries."), + "description": _( + "These colors are used in a variety of widgets, such as text views and entries." + ), "variables": [ { "name": "view_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "view_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "headerbar_colors", "title": _("Header Bar Colors"), - "description": _("These colors are used for header bars, as well as widgets that are meant to be visually attached to it, such as search bars or tab bars."), + "description": _( + "These colors are used for header bars, as well as widgets that are meant to be visually attached to it, such as search bars or tab bars." + ), "variables": [ { "name": "headerbar_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "headerbar_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "headerbar_border_color", "title": _("Border Color"), - "explanation": _("The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout."), - "adw_gtk3_support": "no" + "explanation": _( + "The border color has the same default value as a foreground color, but doesn't change along with it. This can be useful if a light window has a dark header bar with light text; in this case it may be desirable to keep the border dark. This variable is only used for vertical borders - for example, separators between the two header bars in a split header bar layout." + ), + "adw_gtk3_support": "no", }, { "name": "headerbar_backdrop_color", "title": _("Backdrop Color"), - "explanation": _("The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color."), - "adw_gtk3_support": "yes" + "explanation": _( + "The backdrop color is used instead of the background color when the window is not focused. By default it's an alias of the window's background color and changes together with it. When changing this variable, make sure to set it to a value matching your header bar background color." + ), + "adw_gtk3_support": "yes", }, { "name": "headerbar_shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window."), - "adw_gtk3_support": "no" - } - ] + "explanation": _( + "The shade color is used to provide a dark border for header bars and similar widgets that separates them from the main window." + ), + "adw_gtk3_support": "no", + }, + ], }, { "name": "card_colors", @@ -210,20 +240,22 @@ { "name": "card_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "card_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "card_shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards."), - "adw_gtk3_support": "no" - } - ] + "explanation": _( + "The shade color is used for shadows that are used by cards to separate themselves from the window background, as well as for row dividers in the cards." + ), + "adw_gtk3_support": "no", + }, + ], }, { "name": "dialog_colors", @@ -233,14 +265,14 @@ { "name": "dialog_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "no" + "adw_gtk3_support": "no", }, { "name": "dialog_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "no" - } - ] + "adw_gtk3_support": "no", + }, + ], }, { "name": "popover_colors", @@ -250,14 +282,14 @@ { "name": "popover_bg_color", "title": _("Background Color"), - "adw_gtk3_support": "yes" + "adw_gtk3_support": "yes", }, { "name": "popover_fg_color", "title": _("Foreground Color"), - "adw_gtk3_support": "yes" - } - ] + "adw_gtk3_support": "yes", + }, + ], }, { "name": "misc_colors", @@ -267,67 +299,32 @@ { "name": "shade_color", "title": _("Shade Color"), - "explanation": _("The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders."), - "adw_gtk3_support": "no" + "explanation": _( + "The shade color is used by inline tab bars, as well as the transitions in leaflets and flaps, and info bar borders." + ), + "adw_gtk3_support": "no", }, { "name": "scrollbar_outline_color", "title": _("Scrollbar Outline Color"), - "explanation": _("The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color."), - "adw_gtk3_support": "no" - } - ] - } + "explanation": _( + "The scrollbar outline color is used by scrollbars to ensure that overlay scrollbars are visible regardless of the content color." + ), + "adw_gtk3_support": "no", + }, + ], + }, ], "palette": [ - { - "prefix": "blue_", - "title": _("Blue"), - "n_shades": 5 - }, - { - "prefix": "green_", - "title": _("Green"), - "n_shades": 5 - }, - { - "prefix": "yellow_", - "title": _("Yellow"), - "n_shades": 5 - }, - { - "prefix": "orange_", - "title": _("Orange"), - "n_shades": 5 - }, - { - "prefix": "red_", - "title": _("Red"), - "n_shades": 5 - }, - { - "prefix": "purple_", - "title": _("Purple"), - "n_shades": 5 - }, - { - "prefix": "brown_", - "title": _("Brown"), - "n_shades": 5 - }, - { - "prefix": "light_", - "title": _("Light"), - "n_shades": 5 - }, - { - "prefix": "dark_", - "title": _("Dark"), - "n_shades": 5 - } + {"prefix": "blue_", "title": _("Blue"), "n_shades": 5}, + {"prefix": "green_", "title": _("Green"), "n_shades": 5}, + {"prefix": "yellow_", "title": _("Yellow"), "n_shades": 5}, + {"prefix": "orange_", "title": _("Orange"), "n_shades": 5}, + {"prefix": "red_", "title": _("Red"), "n_shades": 5}, + {"prefix": "purple_", "title": _("Purple"), "n_shades": 5}, + {"prefix": "brown_", "title": _("Brown"), "n_shades": 5}, + {"prefix": "light_", "title": _("Light"), "n_shades": 5}, + {"prefix": "dark_", "title": _("Dark"), "n_shades": 5}, ], - "custom_css_app_types": [ - "gtk4", - "gtk3" - ] + "custom_css_app_types": ["gtk4", "gtk3"], } diff --git a/src/window.py b/src/window.py index 1f10d3f0a..25d03cc83 100644 --- a/src/window.py +++ b/src/window.py @@ -36,9 +36,9 @@ from material_color_utilities_python import * -@Gtk.Template(resource_path='/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui') +@Gtk.Template(resource_path="/com/github/AdwCustomizerTeam/AdwCustomizer/ui/window.ui") class AdwcustomizerMainWindow(Adw.ApplicationWindow): - __gtype_name__ = 'AdwcustomizerMainWindow' + __gtype_name__ = "AdwcustomizerMainWindow" content = Gtk.Template.Child() toast_overlay = Gtk.Template.Child() @@ -54,14 +54,14 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow): def __init__(self, **kwargs): super().__init__(**kwargs) self.presets_dropdown.get_popover().connect( - "show", self.on_presets_dropdown_activate) + "show", self.on_presets_dropdown_activate + ) self.setup_monet_page() self.setup_plugins_page() self.setup_colors_page() - self.settings = Gio.Settings( - "com.github.AdwCustomizerTeam.AdwCustomizer") + self.settings = Gio.Settings("com.github.AdwCustomizerTeam.AdwCustomizer") self.settings.bind( "window-width", self, "default-width", Gio.SettingsBindFlags.DEFAULT @@ -93,7 +93,9 @@ def on_monet_file_chooser_response(self, widget, response): self.theme = themeFromImage(self.monet_img) self.tone = self.tone_row.get_selected_item() self.monet_theme = self.monet_theme_row.get_selected_item() - self.get_application().update_theme_from_monet(self.theme, self.tone, self.monet_theme) + self.get_application().update_theme_from_monet( + self.theme, self.tone, self.monet_theme + ) def setup_monet_page(self): @@ -101,7 +103,10 @@ def setup_monet_page(self): self.monet_pref_group.set_name("monet") self.monet_pref_group.set_title(_("Monet Engine")) self.monet_pref_group.set_description( - _("Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow")) + _( + "Monet is an engine that generates Material Design 3 palette from backgrounds color. The generation can be slow" + ) + ) self.monet_file_chooser_row = Adw.ActionRow() self.monet_file_chooser_row.set_title(_("Background Image")) @@ -111,21 +116,21 @@ def setup_monet_page(self): self.monet_file_chooser_button = Gtk.Button() self.monet_file_chooser_button.set_label(_("Choose a file")) - self.monet_file_chooser_button.set_icon_name( - "folder-pictures-symbolic") + self.monet_file_chooser_button.set_icon_name("folder-pictures-symbolic") self.monet_file_chooser_button.connect( - "clicked", self.on_file_picker_button_clicked) + "clicked", self.on_file_picker_button_clicked + ) self.monet_file_chooser_dialog.connect( - "response", self.on_monet_file_chooser_response) + "response", self.on_monet_file_chooser_response + ) self.monet_file_chooser_row.add_suffix(self.monet_file_chooser_button) self.monet_pref_group.add(self.monet_file_chooser_row) - self.monet_palette_shades = AdwcustomizerPaletteShades("monet", - "Monet Palette", - 6) - self.get_application( - ).pref_palette_shades["monet"] = self.monet_palette_shades + self.monet_palette_shades = AdwcustomizerPaletteShades( + "monet", "Monet Palette", 6 + ) + self.get_application().pref_palette_shades["monet"] = self.monet_palette_shades self.monet_pref_group.add(self.monet_palette_shades) self.tone_row = Adw.ComboRow() @@ -168,14 +173,14 @@ def setup_colors_page(self): pref_group.set_description(group["description"]) for variable in group["variables"]: - pref_variable = AdwcustomizerOption(variable["name"], - variable["title"], - variable.get( - "explanation"), - variable["adw_gtk3_support"]) + pref_variable = AdwcustomizerOption( + variable["name"], + variable["title"], + variable.get("explanation"), + variable["adw_gtk3_support"], + ) pref_group.add(pref_variable) - self.get_application( - ).pref_variables[variable["name"]] = pref_variable + self.get_application().pref_variables[variable["name"]] = pref_variable self.content.add(pref_group) @@ -183,14 +188,16 @@ def setup_colors_page(self): palette_pref_group.set_name("palette_colors") palette_pref_group.set_title(_("Palette Colors")) palette_pref_group.set_description( - _("Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.")) + _( + 'Named palette colors used by some applications. Default colors follow the GNOME Human Interface Guidelines.' + ) + ) for color in settings_schema["palette"]: - palette_shades = AdwcustomizerPaletteShades(color["prefix"], - color["title"], - color["n_shades"]) + palette_shades = AdwcustomizerPaletteShades( + color["prefix"], color["title"], color["n_shades"] + ) palette_pref_group.add(palette_shades) - self.get_application( - ).pref_palette_shades[color["prefix"]] = palette_shades + self.get_application().pref_palette_shades[color["prefix"]] = palette_shades self.content.add(palette_pref_group) def update_errors(self, errors): @@ -200,8 +207,9 @@ def update_errors(self, errors): child = self.errors_list.get_row_at_index(0) self.errors_button.set_visible(len(errors) > 0) for error in errors: - self.errors_list.append(AdwcustomizerError( - error["error"], error["element"], error["line"])) + self.errors_list.append( + AdwcustomizerError(error["error"], error["element"], error["line"]) + ) def on_presets_dropdown_activate(self, *args): self.get_application().reload_user_defined_presets() From f84080832408da0368c8ff33b488993b9e538235 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:44:51 +0200 Subject: [PATCH 132/149] add version --- meson.build | 6 +++++- src/info.py.in | 2 ++ src/main.py | 3 ++- src/meson.build | 11 +++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 src/info.py.in diff --git a/meson.build b/meson.build index 36f2ff2f4..e22a4fc1e 100644 --- a/meson.build +++ b/meson.build @@ -1,11 +1,15 @@ project('adwcustomizer', - version: 'git', + version: '0.1.0', meson_version: '>= 0.59.0', default_options: [ 'warning_level=2', 'werror=false', ], ) +dependency('glib-2.0') +dependency('pygobject-3.0') +dependency('libadwaita-1') + i18n = import('i18n') gnome = import('gnome') diff --git a/src/info.py.in b/src/info.py.in new file mode 100644 index 000000000..20fc34949 --- /dev/null +++ b/src/info.py.in @@ -0,0 +1,2 @@ +version = '@version@' +build_type = '@build_type@' \ No newline at end of file diff --git a/src/main.py b/src/main.py index 042eaf87b..142524a33 100644 --- a/src/main.py +++ b/src/main.py @@ -35,7 +35,7 @@ from .app_type_dialog import AdwcustomizerAppTypeDialog from .custom_css_group import AdwcustomizerCustomCSSGroup from .plugins_list import AdwcustomizerPluginsList - +from . import info def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -664,6 +664,7 @@ def show_about_window(self, *_args): Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, + version=f"{info.version}" ) about.present() diff --git a/src/meson.build b/src/meson.build index 7f45b1d13..b395392b1 100644 --- a/src/meson.build +++ b/src/meson.build @@ -40,6 +40,17 @@ configure_file( install_dir: get_option('bindir') ) +configure_file( + input: 'info.py.in', + output: '@BASENAME@', + install: true, + install_dir: python.get_install_dir() / 'adwcustomizer', + configuration: configuration_data({ + 'version': meson.project_version(), + 'build_type': get_option('buildtype'), + }), +) + adwcustomizer_sources = [ '__init__.py', 'settings_schema.py', From c775f93492d60738f4453c7f7323af2b82efabd9 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:46:03 +0200 Subject: [PATCH 133/149] update meson build --- src/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index b395392b1..d3e13293a 100644 --- a/src/meson.build +++ b/src/meson.build @@ -44,7 +44,7 @@ configure_file( input: 'info.py.in', output: '@BASENAME@', install: true, - install_dir: python.get_install_dir() / 'adwcustomizer', + install_dir: moduledir, configuration: configuration_data({ 'version': meson.project_version(), 'build_type': get_option('buildtype'), From 30ac48c58b3685a52a4b27b44d61fe2b90477094 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:47:30 +0200 Subject: [PATCH 134/149] format --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 142524a33..4849549f9 100644 --- a/src/main.py +++ b/src/main.py @@ -37,6 +37,7 @@ from .plugins_list import AdwcustomizerPluginsList from . import info + def to_slug_case(non_slug): return re.sub(r"[^0-9a-z]+", "-", anyascii(non_slug).lower()).strip("-") @@ -664,7 +665,7 @@ def show_about_window(self, *_args): Taylan Tatlı https://www.transifex.com/user/profile/TaylanTatli34/""", copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, - version=f"{info.version}" + version=f"{info.version}", ) about.present() From 63d59ffd66ece733b449f914eba171e4c2560345 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 18:51:30 +0200 Subject: [PATCH 135/149] udpate appstream metadata #77 --- ...github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index 9547dad90..86def6ddf 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -2,8 +2,11 @@ com.github.AdwCustomizerTeam.AdwCustomizer.desktop CC0-1.0 - MIT + GPL-3.0 - Change the look of Adwaita, with ease + Change the look of Adwaita, with ease - + https://github.com/AdwCustomizerTeam/AdwCustomizer/issues + https://github.com/AdwCustomizerTeam/AdwCustomizer + https://www.transifex.com/adwcustomizerteam/adwcustomizer/ + \ No newline at end of file From 6b64caccd48484c845c1c96e1f230fef629360f7 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 19:27:47 +0200 Subject: [PATCH 136/149] move menu button next to close button --- src/ui/window.blp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index 3b3abc816..da2d16a8c 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -45,11 +45,6 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } } - [end] - Gtk.MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } [end] MenuButton errors-button { @@ -58,6 +53,13 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { popover: errors-popover; } + + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + } Gtk.Box { From 2d7e04e3b7e0914df7a2bde1e2c9ffefdcafa9a5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 19:27:57 +0200 Subject: [PATCH 137/149] update appstream metadata --- data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index 86def6ddf..b6b00b08c 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -3,6 +3,8 @@ com.github.AdwCustomizerTeam.AdwCustomizer.desktop CC0-1.0 GPL-3.0 + Adwaita Manager + Change the look of Adwaita, with ease Change the look of Adwaita, with ease From 8d2facab423a51c45a07fd5debeca2b53703528f Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 20:12:34 +0200 Subject: [PATCH 138/149] switch back to main Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- com.github.AdwCustomizerTeam.AdwCustomizer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.json b/com.github.AdwCustomizerTeam.AdwCustomizer.json index 31be453cf..2bb34ef9d 100644 --- a/com.github.AdwCustomizerTeam.AdwCustomizer.json +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.json @@ -71,7 +71,7 @@ { "type" : "git", "path" : ".", - "branch": "next" + "branch": "main" } ] } From 6405f813075861d95168c8018dba123736d029ed Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Thu, 11 Aug 2022 20:13:21 +0200 Subject: [PATCH 139/149] auto instead of automatic Signed-off-by: 0xMRTT <0xMRTT@tuta.io> --- src/window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.py b/src/window.py index 25d03cc83..2e35d7f4b 100644 --- a/src/window.py +++ b/src/window.py @@ -149,7 +149,7 @@ def setup_monet_page(self): self.monet_theme_row.set_title(_("Theme")) store = Gtk.StringList() - store.append("Automatic") + store.append("Auto") store.append("Dark") store.append("Light") self.monet_theme_row.set_model(store) From 405ad1d079e59ceaa645b28072ae6ccdd21d1f58 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:25:05 +0200 Subject: [PATCH 140/149] Update POT --- po/AdwCustomizer.pot | 229 +++++++++++++++++++++++++------------------ 1 file changed, 134 insertions(+), 95 deletions(-) diff --git a/po/AdwCustomizer.pot b/po/AdwCustomizer.pot index c45e60352..1d707805a 100644 --- a/po/AdwCustomizer.pot +++ b/po/AdwCustomizer.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-09 22:21+0300\n" +"POT-Creation-Date: 2022-08-12 11:24+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,11 +18,13 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: data/com.github.AdwCustomizerTeam.AdwCustomizer.desktop.in:3 -#: src/ui/window.blp:5 src/main.py:332 +#: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:6 +#: src/ui/window.blp:5 src/main.py:642 msgid "Adwaita Manager" msgstr "" #: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:7 +#: data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in:9 msgid "Change the look of Adwaita, with ease" msgstr "" @@ -70,225 +72,236 @@ msgstr "" msgid "Toggle Text Value" msgstr "" -#: src/ui/window.blp:13 src/main.py:245 +#: src/ui/window.blp:23 src/main.py:428 msgid "Apply" msgstr "" -#: src/ui/window.blp:20 -msgid "Save Preset" +#: src/ui/window.blp:35 +msgid "Presets" msgstr "" -#: src/ui/window.blp:36 -msgid "Presets" +#: src/ui/window.blp:42 +msgid "Save Preset" msgstr "" -#: src/ui/window.blp:58 +#: src/ui/window.blp:112 msgid "Built-in Presets" msgstr "" -#: src/ui/window.blp:73 +#: src/ui/window.blp:134 +msgid "Release Notes" +msgstr "" + +#: src/ui/window.blp:138 msgid "Reset Applied Color Scheme" msgstr "" -#: src/ui/window.blp:74 +#: src/ui/window.blp:142 msgid "About Adwaita Manager" msgstr "" -#: src/app_type_dialog.py:43 src/main.py:264 +#: src/app_type_dialog.py:44 src/main.py:474 msgid "Cancel" msgstr "" -#: src/main.py:123 +#: src/main.py:140 src/main.py:146 msgid "Failed to load preset" msgstr "" -#: src/main.py:139 +#: src/main.py:163 msgid "Open in File Manager" msgstr "" -#: src/main.py:142 +#: src/main.py:169 msgid "User Defined Presets" msgstr "" -#: src/main.py:203 +#: src/main.py:358 msgid "Unsaved changes" msgstr "" -#: src/main.py:243 +#: src/main.py:423 msgid "Apply this color scheme?" msgstr "" -#: src/main.py:244 +#: src/main.py:425 msgid "" "Warning: any custom CSS files for those app types will be irreversibly " "overwritten!" msgstr "" -#: src/main.py:251 +#: src/main.py:448 msgid "Reset applied color scheme?" msgstr "" -#: src/main.py:252 +#: src/main.py:449 msgid "Make sure you have the current settings saved as a preset." msgstr "" -#: src/main.py:253 +#: src/main.py:451 msgid "Reset" msgstr "" -#: src/main.py:260 +#: src/main.py:461 msgid "Save preset as..." msgstr "" -#: src/main.py:261 src/main.py:274 src/main.py:277 +#: src/main.py:463 src/main.py:487 src/main.py:501 #, python-brace-format msgid "" "Saving preset to {0}. If that preset already exists, it will be " "overwritten!" msgstr "" -#: src/main.py:265 +#: src/main.py:475 msgid "Save" msgstr "" -#: src/main.py:334 -msgid "Adwaita Manager Team" +#: src/main.py:541 +msgid "Scheme successfully saved!" msgstr "" -#. Translators: This is a place to put your credits (formats: "Name https://example.com" or "Name ", no quotes) and is not meant to be translated literally. -#: src/main.py:338 -msgid "translator-credits" +#: src/main.py:605 +msgid "Scheme set successfully!" msgstr "" -#: src/option.py:55 +#: src/main.py:637 +msgid "Reset successfully!" +msgstr "" + +#: src/main.py:644 +msgid "Adwaita Manager Team" +msgstr "" + +#: src/option.py:47 msgid "This option is only partially supported by the adw-gtk3 theme." msgstr "" -#: src/option.py:58 +#: src/option.py:52 msgid "This option is not supported by the adw-gtk3 theme." msgstr "" -#: src/option.py:97 +#: src/option.py:94 msgid "Not a color, see text value" msgstr "" -#: src/settings_schema.py:5 +#: src/settings_schema.py:23 msgid "Accent Colors" msgstr "" -#: src/settings_schema.py:6 +#: src/settings_schema.py:25 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, and entries, to indicate that a widget is important, interactive, or " "currently active." msgstr "" -#: src/settings_schema.py:10 src/settings_schema.py:33 -#: src/settings_schema.py:56 src/settings_schema.py:79 -#: src/settings_schema.py:102 +#: src/settings_schema.py:30 src/settings_schema.py:57 +#: src/settings_schema.py:84 src/settings_schema.py:111 +#: src/settings_schema.py:138 msgid "Standalone Color" msgstr "" -#: src/settings_schema.py:11 src/settings_schema.py:34 -#: src/settings_schema.py:57 src/settings_schema.py:80 -#: src/settings_schema.py:103 +#: src/settings_schema.py:32 src/settings_schema.py:59 +#: src/settings_schema.py:86 src/settings_schema.py:113 +#: src/settings_schema.py:140 msgid "" "The standalone colors are similar to the background ones, but provide better " "contrast when used as foreground color on top of a neutral background - for " "example, colorful text in a window." msgstr "" -#: src/settings_schema.py:16 src/settings_schema.py:39 -#: src/settings_schema.py:62 src/settings_schema.py:85 -#: src/settings_schema.py:108 src/settings_schema.py:125 -#: src/settings_schema.py:142 src/settings_schema.py:159 -#: src/settings_schema.py:194 src/settings_schema.py:217 -#: src/settings_schema.py:234 +#: src/settings_schema.py:38 src/settings_schema.py:65 +#: src/settings_schema.py:92 src/settings_schema.py:119 +#: src/settings_schema.py:146 src/settings_schema.py:163 +#: src/settings_schema.py:182 src/settings_schema.py:201 +#: src/settings_schema.py:242 src/settings_schema.py:267 +#: src/settings_schema.py:284 msgid "Background Color" msgstr "" -#: src/settings_schema.py:21 src/settings_schema.py:44 -#: src/settings_schema.py:67 src/settings_schema.py:90 -#: src/settings_schema.py:113 src/settings_schema.py:130 -#: src/settings_schema.py:147 src/settings_schema.py:164 -#: src/settings_schema.py:199 src/settings_schema.py:222 -#: src/settings_schema.py:239 +#: src/settings_schema.py:43 src/settings_schema.py:70 +#: src/settings_schema.py:97 src/settings_schema.py:124 +#: src/settings_schema.py:151 src/settings_schema.py:168 +#: src/settings_schema.py:187 src/settings_schema.py:206 +#: src/settings_schema.py:247 src/settings_schema.py:272 +#: src/settings_schema.py:289 msgid "Foreground Color" msgstr "" -#: src/settings_schema.py:28 +#: src/settings_schema.py:50 msgid "Destructive Colors" msgstr "" -#: src/settings_schema.py:29 +#: src/settings_schema.py:52 msgid "" "These colors are used for buttons to indicate a dangerous action, such as " "deleting a file." msgstr "" -#: src/settings_schema.py:51 +#: src/settings_schema.py:77 msgid "Success Colors" msgstr "" -#: src/settings_schema.py:52 +#: src/settings_schema.py:79 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, entries, and level bars, to indicate a success or a high level." msgstr "" -#: src/settings_schema.py:74 +#: src/settings_schema.py:104 msgid "Warning Colors" msgstr "" -#: src/settings_schema.py:75 +#: src/settings_schema.py:106 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, entries, and level bars, to indicate a warning or a low level." msgstr "" -#: src/settings_schema.py:97 +#: src/settings_schema.py:131 msgid "Error Colors" msgstr "" -#: src/settings_schema.py:98 +#: src/settings_schema.py:133 msgid "" "These colors are used across many different widgets, such as buttons, " "labels, and entries, to indicate a failure." msgstr "" -#: src/settings_schema.py:120 +#: src/settings_schema.py:158 msgid "Window Colors" msgstr "" -#: src/settings_schema.py:121 +#: src/settings_schema.py:159 msgid "These colors are used primarily for windows." msgstr "" -#: src/settings_schema.py:137 +#: src/settings_schema.py:175 msgid "View Colors" msgstr "" -#: src/settings_schema.py:138 +#: src/settings_schema.py:177 msgid "" "These colors are used in a variety of widgets, such as text views and " "entries." msgstr "" -#: src/settings_schema.py:154 +#: src/settings_schema.py:194 msgid "Header Bar Colors" msgstr "" -#: src/settings_schema.py:155 +#: src/settings_schema.py:196 msgid "" "These colors are used for header bars, as well as widgets that are meant to " "be visually attached to it, such as search bars or tab bars." msgstr "" -#: src/settings_schema.py:169 +#: src/settings_schema.py:211 msgid "Border Color" msgstr "" -#: src/settings_schema.py:170 +#: src/settings_schema.py:213 msgid "" "The border color has the same default value as a foreground color, but " "doesn't change along with it. This can be useful if a light window has a " @@ -297,11 +310,11 @@ msgid "" "example, separators between the two header bars in a split header bar layout." msgstr "" -#: src/settings_schema.py:175 +#: src/settings_schema.py:219 msgid "Backdrop Color" msgstr "" -#: src/settings_schema.py:176 +#: src/settings_schema.py:221 msgid "" "The backdrop color is used instead of the background color when the window " "is not focused. By default it's an alias of the window's background color " @@ -309,113 +322,139 @@ msgid "" "it to a value matching your header bar background color." msgstr "" -#: src/settings_schema.py:181 src/settings_schema.py:204 -#: src/settings_schema.py:251 +#: src/settings_schema.py:227 src/settings_schema.py:252 +#: src/settings_schema.py:301 msgid "Shade Color" msgstr "" -#: src/settings_schema.py:182 +#: src/settings_schema.py:229 msgid "" "The shade color is used to provide a dark border for header bars and similar " "widgets that separates them from the main window." msgstr "" -#: src/settings_schema.py:189 +#: src/settings_schema.py:237 msgid "Card Colors" msgstr "" -#: src/settings_schema.py:190 +#: src/settings_schema.py:238 msgid "These colors are used for cards and boxed lists." msgstr "" -#: src/settings_schema.py:205 +#: src/settings_schema.py:254 msgid "" "The shade color is used for shadows that are used by cards to separate " "themselves from the window background, as well as for row dividers in the " "cards." msgstr "" -#: src/settings_schema.py:212 +#: src/settings_schema.py:262 msgid "Dialog Colors" msgstr "" -#: src/settings_schema.py:213 +#: src/settings_schema.py:263 msgid "These colors are used for message dialogs." msgstr "" -#: src/settings_schema.py:229 +#: src/settings_schema.py:279 msgid "Popover Colors" msgstr "" -#: src/settings_schema.py:230 +#: src/settings_schema.py:280 msgid "These colors are used for popovers." msgstr "" -#: src/settings_schema.py:246 +#: src/settings_schema.py:296 msgid "Miscalleneous Colors" msgstr "" -#: src/settings_schema.py:247 +#: src/settings_schema.py:297 msgid "Colors that don't fit in any particular group." msgstr "" -#: src/settings_schema.py:252 +#: src/settings_schema.py:303 msgid "" "The shade color is used by inline tab bars, as well as the transitions in " "leaflets and flaps, and info bar borders." msgstr "" -#: src/settings_schema.py:257 +#: src/settings_schema.py:309 msgid "Scrollbar Outline Color" msgstr "" -#: src/settings_schema.py:258 +#: src/settings_schema.py:311 msgid "" "The scrollbar outline color is used by scrollbars to ensure that overlay " "scrollbars are visible regardless of the content color." msgstr "" -#: src/settings_schema.py:267 +#: src/settings_schema.py:319 msgid "Blue" msgstr "" -#: src/settings_schema.py:272 +#: src/settings_schema.py:320 msgid "Green" msgstr "" -#: src/settings_schema.py:277 +#: src/settings_schema.py:321 msgid "Yellow" msgstr "" -#: src/settings_schema.py:282 +#: src/settings_schema.py:322 msgid "Orange" msgstr "" -#: src/settings_schema.py:287 +#: src/settings_schema.py:323 msgid "Red" msgstr "" -#: src/settings_schema.py:292 +#: src/settings_schema.py:324 msgid "Purple" msgstr "" -#: src/settings_schema.py:297 +#: src/settings_schema.py:325 msgid "Brown" msgstr "" -#: src/settings_schema.py:302 +#: src/settings_schema.py:326 msgid "Light" msgstr "" -#: src/settings_schema.py:307 +#: src/settings_schema.py:327 msgid "Dark" msgstr "" -#: src/window.py:70 +#: src/window.py:104 +msgid "Monet Engine" +msgstr "" + +#: src/window.py:107 +msgid "" +"Monet is an engine that generates Material Design 3 palette from backgrounds " +"color. The generation can be slow" +msgstr "" + +#: src/window.py:112 +msgid "Background Image" +msgstr "" + +#: src/window.py:118 +msgid "Choose a file" +msgstr "" + +#: src/window.py:137 +msgid "Tone" +msgstr "" + +#: src/window.py:149 +msgid "Theme" +msgstr "" + +#: src/window.py:189 msgid "Palette Colors" msgstr "" -#: src/window.py:71 +#: src/window.py:192 msgid "" "Named palette colors used by some applications. Default colors follow the GNOME Human " From deb7a6f40df1acb07f1d291f3c471dc81fa71cd5 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:27:19 +0200 Subject: [PATCH 141/149] add devel flatpak --- .github/workflows/flatpak-nightly.yml | 4 +- ...AdwCustomizerTeam.AdwCustomizer.Devel.json | 82 +++++++++++++++++++ 2 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json diff --git a/.github/workflows/flatpak-nightly.yml b/.github/workflows/flatpak-nightly.yml index fa297f23a..613457218 100644 --- a/.github/workflows/flatpak-nightly.yml +++ b/.github/workflows/flatpak-nightly.yml @@ -14,6 +14,6 @@ jobs: uses: actions/checkout@v3.0.2 - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 with: - bundle: com.github.AdwCustomizerTeam.AdwCustomizer.flatpak - manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.json + bundle: com.github.AdwCustomizerTeam.AdwCustomizer.Devel.flatpak + manifest-path: com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json cache-key: flatpak-builder-${{ github.sha }}-nightly \ No newline at end of file diff --git a/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json b/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json new file mode 100644 index 000000000..31be453cf --- /dev/null +++ b/com.github.AdwCustomizerTeam.AdwCustomizer.Devel.json @@ -0,0 +1,82 @@ +{ + "app-id" : "com.github.AdwCustomizerTeam.AdwCustomizer", + "runtime" : "org.gnome.Platform", + "runtime-version" : "master", + "sdk" : "org.gnome.Sdk", + "command" : "adwcustomizer", + "finish-args" : [ + "--share=network", + "--share=ipc", + "--socket=fallback-x11", + "--device=dri", + "--socket=wayland", + "--filesystem=xdg-config/gtk-3.0", + "--filesystem=xdg-config/gtk-4.0" + ], + "cleanup" : [ + "/include", + "/lib/pkgconfig", + "/man", + "/share/doc", + "/share/gtk-doc", + "/share/man", + "/share/pkgconfig", + "*.la", + "*.a" + ], + "modules" : [ + "pypi-dependencies.json", + { + "name" : "blueprint-compiler", + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "url" : "https://gitlab.gnome.org/jwestman/blueprint-compiler", + "branch" : "main" + } + ] + }, + { + "name": "libportal", + "buildsystem": "meson", + "config-opts": ["-Ddocs=false", "-Dvapi=false", "-Dbackends=gtk4"], + "sources": [ + { + "type": "git", + "url": "https://github.com/flatpak/libportal", + "branch": "main" + } + ] + }, + { + "name": "material-color-utilities-python", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"material_color_utilities_python~=0.1.0\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "path": "./monet/material_color_utilities_python-0.1.0-py3-none-any.whl", + "sha256": "735d40c0afae660e319798c697da8fe332cfc7103fbed8a081a187f437ed4523" + } + ] + }, + { + "name" : "adwcustomizer", + "builddir" : true, + "buildsystem" : "meson", + "sources" : [ + { + "type" : "git", + "path" : ".", + "branch": "next" + } + ] + } + ], + "build-options" : { + "env" : { } + } +} From e13af9f723333ad3b2311b4cf9393f2d2a9d37d8 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:28:57 +0200 Subject: [PATCH 142/149] update license --- po/AdwCustomizer.pot | 2 +- po/update_potfile.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/po/AdwCustomizer.pot b/po/AdwCustomizer.pot index 1d707805a..13f7a243a 100644 --- a/po/AdwCustomizer.pot +++ b/po/AdwCustomizer.pot @@ -1,6 +1,6 @@ # Adwaita Manager POT file # Copyright (C) 2022 Adwaita Manager Team -# This file is distributed under the MIT/X11 license. +# This file is distributed under the GNU GPLv3 license. # Adwaita Manager Team, 2022. # #, fuzzy diff --git a/po/update_potfile.sh b/po/update_potfile.sh index b20cc2c9e..8c9c7f35f 100755 --- a/po/update_potfile.sh +++ b/po/update_potfile.sh @@ -3,7 +3,7 @@ po_dir=$(dirname "$(realpath "$0")") xgettext -f "$po_dir"/POTFILES -o "$po_dir"/AdwCustomizer.pot --add-comments=Translators --keyword=_ --keyword=C_1c,2 --from-code=UTF-8 sed -i "s/SOME DESCRIPTIVE TITLE./Adwaita Manager POT file/" "$po_dir"/AdwCustomizer.pot sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/$(date +%Y) Adwaita Manager Team/" "$po_dir"/AdwCustomizer.pot -sed -i "s@same license as the PACKAGE package.@MIT/X11 license.@" "$po_dir"/AdwCustomizer.pot +sed -i "s@same license as the PACKAGE package.@GNU GPLv3 license.@" "$po_dir"/AdwCustomizer.pot sed -i "s/FIRST AUTHOR , YEAR./Adwaita Manager Team, $(date +%Y)./" "$po_dir"/AdwCustomizer.pot regex="$po_dir/([a-zA-Z_]*).po" From a9fe0b768dc3df47b20f63c3697a1b0e79e8efa4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:30:51 +0200 Subject: [PATCH 143/149] reverse button order --- src/ui/window.blp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ui/window.blp b/src/ui/window.blp index da2d16a8c..ba11eeb97 100644 --- a/src/ui/window.blp +++ b/src/ui/window.blp @@ -29,6 +29,12 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { stack: view_stack; } + [end] + Gtk.MenuButton { + icon-name: "open-menu-symbolic"; + menu-model: main-menu; + } + [end] MenuButton presets-dropdown { menu-model: presets-menu; @@ -54,11 +60,6 @@ template AdwcustomizerMainWindow : Adw.ApplicationWindow { } - [end] - Gtk.MenuButton { - icon-name: "open-menu-symbolic"; - menu-model: main-menu; - } } From b23768a060e4f8cdae68493158d5342a0c17eaa4 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:38:35 +0200 Subject: [PATCH 144/149] change card fg color --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 4849549f9..50f452655 100644 --- a/src/main.py +++ b/src/main.py @@ -278,7 +278,7 @@ def update_theme_from_monet(self, theme, tone, monet_theme): "headerbar_backdrop_color": "@window_bg_color", "headerbar_shade_color": self.rgba_from_argb(dark_theme.shadow), "card_bg_color": self.rgba_from_argb(dark_theme.primary, "0.05"), - "card_fg_color": self.rgba_from_argb(dark_theme.surfaceVariant), + "card_fg_color": self.rgba_from_argb(dark_theme.onSurface), "card_shade_color": self.rgba_from_argb(dark_theme.shadow), "dialog_bg_color": self.rgba_from_argb(dark_theme.secondaryContainer), "dialog_fg_color": self.rgba_from_argb(dark_theme.onSecondaryContainer), From 36ec03fe62cfd1a38580200a8c55bdd2404a7939 Mon Sep 17 00:00:00 2001 From: 0xMRTT <0xMRTT@tuta.io> Date: Fri, 12 Aug 2022 11:49:29 +0200 Subject: [PATCH 145/149] update releases notes --- ...ustomizerTeam.AdwCustomizer.appdata.xml.in | 16 +++++++++ src/main.py | 34 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in index b431f38a0..f75d2b327 100644 --- a/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in +++ b/data/com.github.AdwCustomizerTeam.AdwCustomizer.appdata.xml.in @@ -104,6 +104,22 @@ First release of Adwaita Manager. + + Add AdwViewSwitcher in the header bar. + Move CSS to the "Advanced" tab + Move the rest to the "Colours" tab + Add Monet tab which generates a theme from a background + Add disk saved and disk unsaved icon in the header bar + Update about dialog + Change license to GNU GPLv3 + Begin plugin support + Move preset selector to a drop-down called palette (icon palette) + Add ability to apply the theme onlyfor dark theme or oy for light theme + Automaticly use Adwaita-dark preset if the user prefered scheme is dark. + Added Flatpak CI build + Added issue template for bug and feature request + `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch + diff --git a/src/main.py b/src/main.py index 50f452655..bed21e1f7 100644 --- a/src/main.py +++ b/src/main.py @@ -666,6 +666,40 @@ def show_about_window(self, *_args): copyright="© 2022 Adwaita Manager Team", license_type=Gtk.License.GPL_3_0, version=f"{info.version}", + release_notes=""" + + + Add AdwViewSwitcher in the header bar. + Move CSS to the "Advanced" tab + Move the rest to the "Colours" tab + Add Monet tab which generates a theme from a background + Add disk saved and disk unsaved icon in the header bar + Update about dialog + Change license to GNU GPLv3 + Begin plugin support + Move preset selector to a drop-down called palette (icon palette) + Add ability to apply the theme onlyfor dark theme or oy for light theme + Automaticly use Adwaita-dark preset if the user prefered scheme is dark. + Added Flatpak CI build + Added issue template for bug and feature request + `Main` branch is now protected by GitHub branch protection. The development is done on `next` branch + +
Change the look of Adwaita, with ease
First release of Adwaita Manager.
+
+ Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. +
With Adwaita Manager you can:
This app is written in Python and uses GTK 4 and libadwaita.
+ Adwaita Manager (AdwCustomizer) is a tool for customizing Libadwaita applications and the adw-gtk3 theme. -