Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MainWindow: respect reduce transparency key #333

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions data/Application.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
Expand Down
1 change: 1 addition & 0 deletions data/dock.metainfo.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<issue url="https://github.com/elementary/dock/issues/275">app bounce clips app icon</issue>
<issue url="https://github.com/elementary/dock/issues/317">Multitasking view bouncing continues for far too long</issue>
<issue url="https://github.com/elementary/dock/issues/321">The dots of active apps on the dock sometimes appear touching the icons without proper spacing</issue>
<issue url="https://github.com/elementary/dock/issues/331">Respect Reduce Transparency setting</issue>
</issues>
</release>

Expand Down
20 changes: 20 additions & 0 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading