diff --git a/scripts/utils/theme/theme.py b/scripts/utils/theme/theme.py index 8cac48a..e0489f8 100644 --- a/scripts/utils/theme/theme.py +++ b/scripts/utils/theme/theme.py @@ -68,6 +68,14 @@ class Theme(ThemeBase): self._preparation.add_to_start(content) return self + def add_from_file(self, content) -> "Theme": + """ + Adds content from a file to the main styles file. + :param content: The path of the file to add. + """ + self._preparation.add_from_file(content) + return self + def prepare(self): """Extract theme from source folder and prepare it for installation.""" self._preparation.prepare() diff --git a/scripts/utils/theme/theme_preparation.py b/scripts/utils/theme/theme_preparation.py index c36a12a..1bb2b9f 100644 --- a/scripts/utils/theme/theme_preparation.py +++ b/scripts/utils/theme/theme_preparation.py @@ -40,6 +40,15 @@ class ThemePreparation: self.style_manager.prepend_content(content) return self + def add_from_file(self, content) -> "ThemePreparation": + """ + Adds content from a file to the main styles file. + :param content: The path of the file to add. + """ + with open(content, "r") as f: + self.style_manager.append_content(f.read()) + return self + def prepare(self): """ Extract theme from source folder and prepare it for installation. diff --git a/theme/gnome-shell/.css/panel.css b/theme/gnome-shell/.css/panel.css index 43b478b..d220176 100644 --- a/theme/gnome-shell/.css/panel.css +++ b/theme/gnome-shell/.css/panel.css @@ -31,9 +31,9 @@ .panel-button .clock { /* DND / new messages icon */ color: TEXT-PRIMARY-COLOR; border-radius: 9px; - border-width: 0 !important; + border: 1px solid PANEL-BUTTON-BORDER !important; background-color: ACCENT-DISABLED-COLOR; - box-shadow: inset 0 0 0 1px BORDER-SHADOW; + box-shadow: none; } .panel-button:hover, @@ -87,7 +87,8 @@ /* panel clock fix. remove additional background */ .clock-display { background-color: transparent !important; - box-shadow: none !important; + box-shadow: none; + border: none !important; } /* additional background for DND / new messages icon */ diff --git a/tweaks/overview/tweak.py b/tweaks/overview/tweak.py index ad4ba0d..22d85d7 100755 --- a/tweaks/overview/tweak.py +++ b/tweaks/overview/tweak.py @@ -1,4 +1,6 @@ from scripts import config +from scripts.utils.theme.theme import Theme + overview_folder = f"{config.tweaks_folder}/overview" @@ -7,9 +9,7 @@ def define_arguments(parser): overview_args.add_argument('--launchpad', action='store_true', help='change Show Apps icon to macOS Launchpad icon') -def apply_tweak(args, theme, colors): +def apply_tweak(args, theme: Theme, colors): if args.launchpad: - with open(f"{overview_folder}/launchpad/launchpad.css", "r") as f: - theme += f.read() - + theme.add_from_file(f"{overview_folder}/launchpad/launchpad.css") theme *= f"{overview_folder}/launchpad/launchpad.png" diff --git a/tweaks/panel/def-size.css b/tweaks/panel/def-size.css index 256785d..0526c0b 100644 --- a/tweaks/panel/def-size.css +++ b/tweaks/panel/def-size.css @@ -2,13 +2,16 @@ #panel { height: 2.2em; - font-size: 15px; + font-size: 1em; +} + +.panel-button { + margin: 3px 2px; } .panel-button, .panel-button .clock { - border-radius: 12px; - border: 3px solid transparent !important; + border-radius: 8px; } .panel-button { -natural-hpadding: 10px !important; } diff --git a/tweaks/panel/grouped-buttons.css b/tweaks/panel/grouped-buttons.css index ce6c152..d342a54 100644 --- a/tweaks/panel/grouped-buttons.css +++ b/tweaks/panel/grouped-buttons.css @@ -2,8 +2,6 @@ border-radius: 0; margin-left: 0; margin-right: 0; - box-shadow: none; - border: 1px solid PANEL-BUTTON-BORDER !important; border-left-width: 0 !important; } @@ -11,14 +9,12 @@ border-radius: 9px; margin-left: 3px; margin-right: 3px; - box-shadow: none; - border: 1px solid PANEL-BUTTON-BORDER !important; } #panelLeft > StBin:first-child > .panel-button, #panelRight > StBin:first-child > .panel-button { border-radius: 9px 0 0 9px; - border: 1px solid PANEL-BUTTON-BORDER !important; + border-left-width: 1px !important; margin-left: 3px; } @@ -31,7 +27,7 @@ #panelLeft > StBin:first-child:last-child > .panel-button, #panelRight > StBin:first-child:last-child > .panel-button { border-radius: 9px; - border: 1px solid PANEL-BUTTON-BORDER !important; + border-left-width: 1px !important; margin-left: 3px; margin-right: 3px; } diff --git a/tweaks/panel/no-pill.css b/tweaks/panel/no-pill.css index 81d5ceb..c8b6b0b 100644 --- a/tweaks/panel/no-pill.css +++ b/tweaks/panel/no-pill.css @@ -5,8 +5,8 @@ background-color: transparent; box-shadow: none; margin: 0; - border: 4px solid transparent !important; - border-radius: 12px; + border: 3px solid transparent !important; + border-radius: 10px; } .panel-button:hover, diff --git a/tweaks/panel/tweak.py b/tweaks/panel/tweak.py index 048399b..a32af4f 100755 --- a/tweaks/panel/tweak.py +++ b/tweaks/panel/tweak.py @@ -1,5 +1,6 @@ from scripts import config from scripts.utils.color_converter.color_converter_impl import ColorConverterImpl +from scripts.utils.theme.theme import Theme panel_folder = f"{config.tweaks_folder}/panel" @@ -13,18 +14,15 @@ def define_arguments(parser): panel_args.add_argument('--panel-grouped-buttons', action='store_true', help='group panel buttons together') -def apply_tweak(args, theme, colors): - if args.panel_no_pill: - with open(f"{panel_folder}/no-pill.css", "r") as f: - theme += f.read() - +def apply_tweak(args, theme: Theme, colors): if args.panel_default_size: - with open(f"{panel_folder}/def-size.css", "r") as f: - theme += f.read() + theme.add_from_file(f"{panel_folder}/def-size.css") + + if args.panel_no_pill: + theme.add_from_file(f"{panel_folder}/no-pill.css") if args.wider_panel: - with open(f"{panel_folder}/wider-panel.css", "r") as f: - theme += f.read() + theme.add_from_file(f"{panel_folder}/wider-panel.css") if args.panel_text_color: theme += ".panel-button,\ @@ -34,5 +32,4 @@ def apply_tweak(args, theme, colors): }" if args.panel_grouped_buttons: - with open(f"{panel_folder}/grouped-buttons.css", "r") as f: - theme += f.read() \ No newline at end of file + theme.add_from_file(f"{panel_folder}/grouped-buttons.css") \ No newline at end of file