From deb7097ba799de820177a483f6a825177212a6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Mon, 9 Dec 2024 11:29:01 -0800 Subject: [PATCH 1/2] MainWindow: respect reduce transparency key --- data/Application.css | 21 +++++++++++++-------- src/MainWindow.vala | 20 ++++++++++++++++++++ 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/data/Application.css b/data/Application.css index 759b7f4c..963e8b73 100644 --- a/data/Application.css +++ b/data/Application.css @@ -4,19 +4,24 @@ */ dock { - background: alpha(@bg_color, 0.6); + background: @bg_color; border-radius: 9px; box-shadow: - inset 0 -1px 0 0 alpha(@highlight_color, 0.1), - inset 0 1px 0 0 alpha(@highlight_color, 0.15), - inset 1px 0 0 0 alpha(@highlight_color, 0.035), - inset -1px 0 0 0 alpha(@highlight_color, 0.035), - 0 0 0 1px alpha(@borders, 0.4), - 0 1px 3px alpha(black, 0.10), - 0 3px 9px alpha(black, 0.15); + inset 0 -1px 0 0 alpha(@highlight_color, 0.2), + inset 0 1px 0 0 alpha(@highlight_color, 0.3), + inset 1px 0 0 0 alpha(@highlight_color, 0.07), + inset -1px 0 0 0 alpha(@highlight_color, 0.07), + 0 0 0 1px @borders, + 0 1px 3px alpha(black, 0.2), + 0 3px 9px alpha(black, 0.3); + opacity: 0.6; padding: 9px; } +dock.reduce-transparency { + opacity: 1; +} + dock-window { margin-top: 64px; /* Keep enough room so that icons don't clip when bouncing */ } diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 1d78afd2..0d8e0cde 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -5,9 +5,29 @@ public class Dock.MainWindow : Gtk.ApplicationWindow { private class Container : Gtk.Box { + private Settings transparency_settings; + class construct { set_css_name ("dock"); } + + construct { + var transparency_schema = SettingsSchemaSource.get_default ().lookup ("io.elementary.desktop.wingpanel", true); + if (transparency_schema != null && transparency_schema.has_key ("use-transparency")) { + transparency_settings = new Settings ("io.elementary.desktop.wingpanel"); + transparency_settings.changed["use-transparency"].connect (update_transparency); + update_transparency (); + } + } + + private void update_transparency () { + if (transparency_settings.get_boolean ("use-transparency")) { + remove_css_class ("reduce-transparency"); + } else { + add_css_class ("reduce-transparency"); + + } + } } private class BottomMargin : Gtk.Widget { From 6ee1b429d71d5080327f010434532419855145f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Mon, 9 Dec 2024 11:30:56 -0800 Subject: [PATCH 2/2] Update dock.metainfo.xml.in --- data/dock.metainfo.xml.in | 1 + 1 file changed, 1 insertion(+) diff --git a/data/dock.metainfo.xml.in b/data/dock.metainfo.xml.in index 1499e2e8..bcb0dbad 100644 --- a/data/dock.metainfo.xml.in +++ b/data/dock.metainfo.xml.in @@ -32,6 +32,7 @@ app bounce clips app icon Multitasking view bouncing continues for far too long The dots of active apps on the dock sometimes appear touching the icons without proper spacing + Respect Reduce Transparency setting