mirror of
https://github.com/GradienceTeam/Gradience.git
synced 2024-10-04 08:47:54 +00:00
add monet theme selector
This commit is contained in:
parent
d5bce25c1e
commit
e2c9b17178
2 changed files with 55 additions and 2 deletions
54
src/main.py
54
src/main.py
|
@ -207,9 +207,11 @@ class AdwcustomizerApplication(Adw.Application):
|
|||
|
||||
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 @@ class AdwcustomizerApplication(Adw.Application):
|
|||
|
||||
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():
|
||||
|
|
|
@ -91,7 +91,8 @@ class AdwcustomizerMainWindow(Adw.ApplicationWindow):
|
|||
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):
|
||||
|
||||
|
|
Loading…
Reference in a new issue