Fixed opaque tweak, decreased sleep in apply_gnome_theme

This commit is contained in:
Vladyslav Hroshev
2025-04-01 21:20:28 +03:00
parent 627e5b16ce
commit 75cbf08879
2 changed files with 7 additions and 4 deletions

View File

@@ -29,7 +29,7 @@ def apply_gnome_theme(theme=None) -> bool:
formatted_theme = Console.format(theme, color=Color.get(color, Color.GRAY), format_type=Format.BOLD)
line.update(f"Applying {formatted_theme} theme...")
time.sleep(0.1) # applying the theme may freeze, so we need to wait a bit
time.sleep(0.025) # applying the theme may freeze, so we need to wait a bit
apply_user_theme(theme)
line.success(f"Theme {formatted_theme} applied.")
except Exception:

View File

@@ -1,9 +1,12 @@
from scripts.install.colors_definer import ColorsDefiner
def define_arguments(parser):
color_args = parser.add_argument_group('Color tweaks')
color_args.add_argument('-O', '--opaque', action='store_true', help='make the background in menus/popovers opaque')
def apply_tweak(args, theme, colors):
def apply_tweak(args, theme, colors: ColorsDefiner):
if args.opaque:
colors["elements"]["BACKGROUND-COLOR"]["light"]["a"] = 1
colors["elements"]["BACKGROUND-COLOR"]["dark"]["a"] = 1
colors.replacers["BACKGROUND-COLOR"]["light"]["a"] = 1
colors.replacers["BACKGROUND-COLOR"]["dark"]["a"] = 1