From 11a470d17684dcd48042405e7f8cd00f4d208e89 Mon Sep 17 00:00:00 2001 From: Vladyslav Hroshev Date: Tue, 25 Mar 2025 18:44:19 +0200 Subject: [PATCH] --wider-panel tweak. Fixed button when clicked out of its bounds in -Pnp. Closes #48. --- README.md | 7 ++++--- tweaks/panel/def-size.css | 14 +++++++++----- tweaks/panel/no-pill.css | 10 ++++++---- tweaks/panel/tweak.py | 15 ++++++++++----- tweaks/panel/wider-panel.css | 9 +++++++++ 5 files changed, 38 insertions(+), 17 deletions(-) create mode 100644 tweaks/panel/wider-panel.css diff --git a/README.md b/README.md index c268748..591e953 100644 --- a/README.md +++ b/README.md @@ -165,9 +165,10 @@ Icon theme: https://github.com/vinceliuice/Colloid-icon-theme | 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 | +| -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 | #### Overview tweaks diff --git a/tweaks/panel/def-size.css b/tweaks/panel/def-size.css index af5309b..256785d 100644 --- a/tweaks/panel/def-size.css +++ b/tweaks/panel/def-size.css @@ -6,8 +6,12 @@ } .panel-button, -.panel-button .clock, /* Date & clock */ -.clock-display StIcon { /* DND / new messages icon */ - border-radius: 99px; - border: 3px solid transparent; -} \ No newline at end of file +.panel-button .clock { + border-radius: 12px; + border: 3px solid transparent !important; +} + +.panel-button { -natural-hpadding: 10px !important; } +.panel-status-indicators-box:first-child { padding-left: 0; } +.panel-status-indicators-box:last-child { padding-right: 0; } +.panel-status-indicators-box:first-child:last-child { padding: 0; } \ No newline at end of file diff --git a/tweaks/panel/no-pill.css b/tweaks/panel/no-pill.css index 86738f3..81d5ceb 100644 --- a/tweaks/panel/no-pill.css +++ b/tweaks/panel/no-pill.css @@ -1,16 +1,18 @@ /* Remove additional background in panel buttons */ .panel-button, -.panel-button .clock, /* Date & clock */ -.clock-display StIcon { /* DND / new messages icon */ +.panel-button .clock { background-color: transparent; box-shadow: none; + margin: 0; + border: 4px solid transparent !important; + border-radius: 12px; } .panel-button:hover, .panel-button:hover .clock, .panel-button:active, .panel-button:active .clock { - background-color: ACCENT-DISABLED_HOVER; - box-shadow: inset 0 0 0 1px BORDER-SHADOW; + background-color: transparent; + box-shadow: inset 0 0 0 999px ACCENT-DISABLED_HOVER; } \ No newline at end of file diff --git a/tweaks/panel/tweak.py b/tweaks/panel/tweak.py index c96aef2..0defa53 100755 --- a/tweaks/panel/tweak.py +++ b/tweaks/panel/tweak.py @@ -5,18 +5,23 @@ panel_folder = f"{config.tweaks_folder}/panel" def define_arguments(parser): panel_args = parser.add_argument_group('Panel tweaks') - panel_args.add_argument('-Pds', '--panel_default_size', action='store_true', help='set default panel size') - 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('-Pds', '--panel-default-size', action='store_true', help='set default panel size') + 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') 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() + if args.panel_default_size: with open(f"{panel_folder}/def-size.css", "r") as f: theme += f.read() - if args.panel_no_pill: - with open(f"{panel_folder}/no-pill.css", "r") as f: + if args.wider_panel: + with open(f"{panel_folder}/wider-panel.css", "r") as f: theme += f.read() if args.panel_text_color: diff --git a/tweaks/panel/wider-panel.css b/tweaks/panel/wider-panel.css new file mode 100644 index 0000000..21c93f1 --- /dev/null +++ b/tweaks/panel/wider-panel.css @@ -0,0 +1,9 @@ +#panel { + height: 36px; + font-size: 14px; +} + +.panel-button, +.panel-button .clock { + border-radius: 10px; +}