Merge pull request #55 from imarkoff/unstable

Added group panel buttons tweak
This commit is contained in:
Vladyslav Hroshev
2025-04-16 16:23:26 +03:00
committed by GitHub
11 changed files with 137 additions and 23 deletions

View File

@@ -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

View File

@@ -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",

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -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()

View File

@@ -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.

View File

@@ -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 */

View File

@@ -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"

View File

@@ -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; }

View File

@@ -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;
}

View File

@@ -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,

View File

@@ -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")