mirror of
https://github.com/imarkoff/Marble-shell-theme.git
synced 2025-09-16 08:18:41 -07:00
Floating panel tweak; Fixed opaque, panel text color tweaks
- Closes #57; - Added floating panel tweak. Supports opaque tweak; - Fixed an issue when opaque tweak does not apply to translucent background; - Fixed an issue when panel text color tweak does not apply to clock button correctly and defined color does not work in overview. Extracted panel text color tweak to another function; - Renamed BUTTON-CLOSE-COLOR to ACCENT-DISABLED-OPAQUE-COLOR;
This commit is contained in:
@@ -305,7 +305,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"DASH-COLOR" : {
|
"DASH-COLOR" : {
|
||||||
"_comment" : "Special background color for dash",
|
"_comment" : "Special background color for dash and for panel buttons with floating buttons tweak",
|
||||||
|
|
||||||
"light" : {
|
"light" : {
|
||||||
"s" : 40,
|
"s" : 40,
|
||||||
@@ -630,7 +630,7 @@
|
|||||||
"dark": { "s": 5, "l": 10, "a": 0.9 }
|
"dark": { "s": 5, "l": 10, "a": 0.9 }
|
||||||
},
|
},
|
||||||
|
|
||||||
"BUTTON-CLOSE-COLOR" : {
|
"ACCENT-DISABLED-OPAQUE-COLOR": {
|
||||||
"_comment" : "Same as ACCENT-DISABLED-COLOR, but has no transparency",
|
"_comment" : "Same as ACCENT-DISABLED-COLOR, but has no transparency",
|
||||||
|
|
||||||
"light" : {
|
"light" : {
|
||||||
@@ -645,7 +645,7 @@
|
|||||||
"a" : 1
|
"a" : 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"BUTTON-CLOSE_HOVER" : {
|
"ACCENT-DISABLED-OPAQUE_HOVER": {
|
||||||
"_comment" : "Same as ACCENT-DISABLED_HOVER, but has no transparency",
|
"_comment" : "Same as ACCENT-DISABLED_HOVER, but has no transparency",
|
||||||
|
|
||||||
"light" : {
|
"light" : {
|
||||||
|
@@ -185,7 +185,7 @@
|
|||||||
|
|
||||||
.window-close, /* close button (Overview - Workspaces - Selected window) */
|
.window-close, /* close button (Overview - Workspaces - Selected window) */
|
||||||
.screenshot-ui-close-button { /* close button (Screenshot UI) */
|
.screenshot-ui-close-button { /* close button (Screenshot UI) */
|
||||||
background-color: BUTTON-CLOSE-COLOR;
|
background-color: ACCENT-DISABLED-OPAQUE-COLOR;
|
||||||
color: TEXT-PRIMARY-COLOR;
|
color: TEXT-PRIMARY-COLOR;
|
||||||
border: 1px solid BORDER-SHADOW;
|
border: 1px solid BORDER-SHADOW;
|
||||||
border-radius: 99px;
|
border-radius: 99px;
|
||||||
@@ -195,5 +195,5 @@
|
|||||||
|
|
||||||
.window-close:hover,
|
.window-close:hover,
|
||||||
.screenshot-ui-close-button:hover {
|
.screenshot-ui-close-button:hover {
|
||||||
background-color: BUTTON-CLOSE_HOVER;
|
background-color: ACCENT-DISABLED-OPAQUE_HOVER;
|
||||||
}
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
from scripts.install.colors_definer import ColorsDefiner
|
from scripts.utils.theme.theme import Theme
|
||||||
|
|
||||||
|
|
||||||
def define_arguments(parser):
|
def define_arguments(parser):
|
||||||
@@ -6,7 +6,10 @@ def define_arguments(parser):
|
|||||||
color_args.add_argument('-O', '--opaque', action='store_true', help='make the background in menus/popovers opaque')
|
color_args.add_argument('-O', '--opaque', action='store_true', help='make the background in menus/popovers opaque')
|
||||||
|
|
||||||
|
|
||||||
def apply_tweak(args, theme, colors: ColorsDefiner):
|
def apply_tweak(args, theme: Theme, colors):
|
||||||
if args.opaque:
|
if args.opaque:
|
||||||
colors.replacers["BACKGROUND-COLOR"]["light"]["a"] = 1
|
with open(theme.main_styles, "r") as file:
|
||||||
colors.replacers["BACKGROUND-COLOR"]["dark"]["a"] = 1
|
content = file.read()
|
||||||
|
with open(theme.main_styles, "w") as file:
|
||||||
|
replaced_content = content.replace("BACKGROUND-COLOR", "BACKGROUND-OPAQUE-COLOR")
|
||||||
|
file.write(replaced_content)
|
4
tweaks/panel/floating-panel-opaque.css
Normal file
4
tweaks/panel/floating-panel-opaque.css
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
.panel-button,
|
||||||
|
.panel-button .clock {
|
||||||
|
background-color: ACCENT-DISABLED-OPAQUE-COLOR;
|
||||||
|
}
|
33
tweaks/panel/floating-panel.css
Normal file
33
tweaks/panel/floating-panel.css
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
#panel {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
#panel:overview {
|
||||||
|
background-color: BACKGROUND-OPAQUE-COLOR;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel-button,
|
||||||
|
.panel-button .clock {
|
||||||
|
background-color: DASH-COLOR;
|
||||||
|
border-color: BORDER-MENU-SHADOW !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel-button:hover,
|
||||||
|
.panel-button:hover .clock,
|
||||||
|
.panel-button:active,
|
||||||
|
.panel-button:active .clock {
|
||||||
|
background-color: ACCENT-DISABLED-OPAQUE_HOVER;
|
||||||
|
}
|
||||||
|
|
||||||
|
#panel:overview .panel-button,
|
||||||
|
#panel:overview .panel-button .clock {
|
||||||
|
background-color: ACCENT-DISABLED-COLOR;
|
||||||
|
border-color: BORDER-SHADOW !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#panel:overview .panel-button:hover,
|
||||||
|
#panel:overview .panel-button:hover .clock,
|
||||||
|
#panel:overview .panel-button:active,
|
||||||
|
#panel:overview .panel-button:active .clock {
|
||||||
|
background-color: ACCENT-DISABLED_HOVER;
|
||||||
|
}
|
4
tweaks/panel/text-color.css
Normal file
4
tweaks/panel/text-color.css
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
.panel-button,
|
||||||
|
.panel-button .clock {
|
||||||
|
color: REPLACEMENT-COLOR !important;
|
||||||
|
}
|
@@ -12,24 +12,38 @@ def define_arguments(parser):
|
|||||||
panel_args.add_argument('-Ptc', '--panel-text-color', type=str, nargs='?', help='custom panel HEX(A) text color')
|
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('--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')
|
panel_args.add_argument('--panel-grouped-buttons', action='store_true', help='group panel buttons together')
|
||||||
|
panel_args.add_argument('--floating-panel', action='store_true', help='make the panel floating (transparent background)')
|
||||||
|
|
||||||
|
|
||||||
def apply_tweak(args, theme: Theme, colors):
|
def apply_tweak(args, theme: Theme, colors):
|
||||||
if args.panel_default_size:
|
if args.panel_default_size:
|
||||||
theme.add_from_file(f"{panel_folder}/def-size.css")
|
theme.add_from_file(f"{panel_folder}/def-size.css")
|
||||||
|
|
||||||
|
if args.floating_panel:
|
||||||
|
theme.add_from_file(f"{panel_folder}/floating-panel.css")
|
||||||
|
if args.opaque:
|
||||||
|
theme.add_from_file(f"{panel_folder}/floating-panel-opaque.css")
|
||||||
|
|
||||||
if args.panel_no_pill:
|
if args.panel_no_pill:
|
||||||
theme.add_from_file(f"{panel_folder}/no-pill.css")
|
theme.add_from_file(f"{panel_folder}/no-pill.css")
|
||||||
|
|
||||||
if args.wider_panel:
|
if args.wider_panel:
|
||||||
theme.add_from_file(f"{panel_folder}/wider-panel.css")
|
theme.add_from_file(f"{panel_folder}/wider-panel.css")
|
||||||
|
|
||||||
if args.panel_text_color:
|
resolve_panel_text_color(theme, args.panel_text_color)
|
||||||
theme += ".panel-button,\
|
|
||||||
.clock,\
|
|
||||||
.clock-display StIcon {\
|
|
||||||
color: rgba(" + ', '.join(map(str, ColorConverterImpl.hex_to_rgba(args.panel_text_color))) + ");\
|
|
||||||
}"
|
|
||||||
|
|
||||||
if args.panel_grouped_buttons:
|
if args.panel_grouped_buttons:
|
||||||
theme.add_from_file(f"{panel_folder}/grouped-buttons.css")
|
theme.add_from_file(f"{panel_folder}/grouped-buttons.css")
|
||||||
|
|
||||||
|
|
||||||
|
def resolve_panel_text_color(theme: Theme, argument_property):
|
||||||
|
if not argument_property: return
|
||||||
|
|
||||||
|
(r, g, b, a) = ColorConverterImpl.hex_to_rgba(argument_property)
|
||||||
|
final_color = f"rgba({r}, {g}, {b}, {a})"
|
||||||
|
|
||||||
|
with open(f"{panel_folder}/text-color.css", "r") as file:
|
||||||
|
content = file.read()
|
||||||
|
|
||||||
|
replaced_content = content.replace("REPLACEMENT-COLOR", final_color)
|
||||||
|
theme += replaced_content
|
Reference in New Issue
Block a user