diff --git a/README.md b/README.md index 3bc42c8..580b029 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ Icon theme: https://github.com/vinceliuice/Colloid-icon-theme > [!TIP] > If you want to install only one color, use the `--red`, `--yellow`, `--green`, `--blue`, `--purple`, `--gray` option. +Want to install a custom color, group buttons in the panel, use launchpad icon or some other tweaks? See the [installation tweaks](#-installation-tweaks) section for more information. If you want to remove the theme, see the [uninstallation](#%EF%B8%8F-uninstallation--reinstallation) section. @@ -172,19 +173,21 @@ If you want to remove the theme, see the [uninstallation](#%EF%B8%8F-uninstallat #### Panel tweaks **Panel default size** - ![Panel default size](./readme-images/tweaks/panel-default-size.png "Panel default size") **Panel without button background** - ![Panel without buttons background](./readme-images/tweaks/panel-no-pill.png "Panel without buttons background") +**Grouped buttons in the panel** +![Grouped buttons in the panel](./readme-images/tweaks/panel-grouped-buttons.png "Grouped buttons in the panel") + | Option | Secondary option | Description | |----------------------------|------------------|--------------------------------| | -Pds, --panel-default-size | | set default panel size | | -Pnp, --panel-no-pill | | remove panel button background | | -Ptc, --panel-text-color | #abcdef | custom panel HEX(A) text color | | --wider-panel | | make the panel a bit wider | +| --panel-grouped-buttons | | group buttons in the panel | #### Overview tweaks diff --git a/colors.json b/colors.json index 06bba6d..c6f3832 100644 --- a/colors.json +++ b/colors.json @@ -486,6 +486,21 @@ "a" : 0.07 } }, + "PANEL-BUTTON-BORDER": { + "_comment" : "Used as border in panel buttons", + + "light" : { + "s" : 0, + "l" : 0, + "a" : 0.07 + }, + + "dark" : { + "s" : 0, + "l" : 100, + "a" : 0.04 + } + }, "SEPARATOR-COLOR" : { "_comment" : "Color for separators", diff --git a/readme-images/tweaks/panel-grouped-buttons.png b/readme-images/tweaks/panel-grouped-buttons.png new file mode 100644 index 0000000..f7d7d98 Binary files /dev/null and b/readme-images/tweaks/panel-grouped-buttons.png differ 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 new file mode 100644 index 0000000..d342a54 --- /dev/null +++ b/tweaks/panel/grouped-buttons.css @@ -0,0 +1,73 @@ +.panel-button { + border-radius: 0; + margin-left: 0; + margin-right: 0; + border-left-width: 0 !important; +} + +#panelCenter .panel-button { + border-radius: 9px; + margin-left: 3px; + margin-right: 3px; +} + +#panelLeft > StBin:first-child > .panel-button, +#panelRight > StBin:first-child > .panel-button { + border-radius: 9px 0 0 9px; + border-left-width: 1px !important; + margin-left: 3px; +} + +#panelLeft > StBin:last-child > .panel-button, +#panelRight > StBin:last-child > .panel-button { + border-radius: 0 9px 9px 0; + margin-right: 3px; +} + +#panelLeft > StBin:first-child:last-child > .panel-button, +#panelRight > StBin:first-child:last-child > .panel-button { + border-radius: 9px; + border-left-width: 1px !important; + margin-left: 3px; + margin-right: 3px; +} + +#panelCenter .clock-display { + border: none !important; +} + +/* in dash to panel leftPanel, centerPanel, rightPanel doesn't work as intended */ +.dashtopanelMainPanel StBin:last-child > .panel-button { + border-radius: 0 !important; + margin-right: 0 !important; +} + +.dashtopanelMainPanel StBin:first-child:last-child > .panel-button { + border-radius: 9px !important; + margin-left: 3px !important; + margin-right: 3px !important; +} + +.dashtopanelMainPanel Gjs_ui_panel_QuickSettings.panel-button { + margin-right: 4px; + border-radius: 0 9px 9px 0; +} + +/* use entire button area for clock */ +.dashtopanelMainPanel .clock-display { + background-color: ACCENT-DISABLED-COLOR !important; + margin-left: 0; + margin-right: 0; + border: 1px solid PANEL-BUTTON-BORDER !important; + border-left-width: 0 !important; +} + +.dashtopanelMainPanel .clock-display .clock { + background-color: transparent; + border: none !important; + box-shadow: none; +} + +.dashtopanelMainPanel .clock-display:hover { + background-color: ACCENT-DISABLED_HOVER !important; +} \ No newline at end of file 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 e58e89f..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" @@ -10,20 +11,18 @@ def define_arguments(parser): panel_args.add_argument('-Pnp', '--panel-no-pill', action='store_true', help='remove panel button background') panel_args.add_argument('-Ptc', '--panel-text-color', type=str, nargs='?', help='custom panel HEX(A) text color') panel_args.add_argument('--wider-panel', action='store_true', help='make the panel wider') + 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,\ @@ -31,3 +30,6 @@ def apply_tweak(args, theme, colors): .clock-display StIcon {\ color: rgba(" + ', '.join(map(str, ColorConverterImpl.hex_to_rgba(args.panel_text_color))) + ");\ }" + + if args.panel_grouped_buttons: + theme.add_from_file(f"{panel_folder}/grouped-buttons.css") \ No newline at end of file