Skip to content

Commit fba1c76

Browse files
authored
MainWindow: respect reduce transparency key (#333)
1 parent 8b2120d commit fba1c76

File tree

3 files changed

+34
-8
lines changed

3 files changed

+34
-8
lines changed

data/Application.css

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,24 @@
44
*/
55

66
dock {
7-
background: alpha(@bg_color, 0.6);
7+
background: @bg_color;
88
border-radius: 9px;
99
box-shadow:
10-
inset 0 -1px 0 0 alpha(@highlight_color, 0.1),
11-
inset 0 1px 0 0 alpha(@highlight_color, 0.15),
12-
inset 1px 0 0 0 alpha(@highlight_color, 0.035),
13-
inset -1px 0 0 0 alpha(@highlight_color, 0.035),
14-
0 0 0 1px alpha(@borders, 0.4),
15-
0 1px 3px alpha(black, 0.10),
16-
0 3px 9px alpha(black, 0.15);
10+
inset 0 -1px 0 0 alpha(@highlight_color, 0.2),
11+
inset 0 1px 0 0 alpha(@highlight_color, 0.3),
12+
inset 1px 0 0 0 alpha(@highlight_color, 0.07),
13+
inset -1px 0 0 0 alpha(@highlight_color, 0.07),
14+
0 0 0 1px @borders,
15+
0 1px 3px alpha(black, 0.2),
16+
0 3px 9px alpha(black, 0.3);
17+
opacity: 0.6;
1718
padding: 9px;
1819
}
1920

21+
dock.reduce-transparency {
22+
opacity: 1;
23+
}
24+
2025
dock-window {
2126
margin-top: 64px; /* Keep enough room so that icons don't clip when bouncing */
2227
}

data/dock.metainfo.xml.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
<issue url="https://github.com/elementary/dock/issues/275">app bounce clips app icon</issue>
3333
<issue url="https://github.com/elementary/dock/issues/317">Multitasking view bouncing continues for far too long</issue>
3434
<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>
35+
<issue url="https://github.com/elementary/dock/issues/331">Respect Reduce Transparency setting</issue>
3536
</issues>
3637
</release>
3738

src/MainWindow.vala

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,29 @@
55

66
public class Dock.MainWindow : Gtk.ApplicationWindow {
77
private class Container : Gtk.Box {
8+
private Settings transparency_settings;
9+
810
class construct {
911
set_css_name ("dock");
1012
}
13+
14+
construct {
15+
var transparency_schema = SettingsSchemaSource.get_default ().lookup ("io.elementary.desktop.wingpanel", true);
16+
if (transparency_schema != null && transparency_schema.has_key ("use-transparency")) {
17+
transparency_settings = new Settings ("io.elementary.desktop.wingpanel");
18+
transparency_settings.changed["use-transparency"].connect (update_transparency);
19+
update_transparency ();
20+
}
21+
}
22+
23+
private void update_transparency () {
24+
if (transparency_settings.get_boolean ("use-transparency")) {
25+
remove_css_class ("reduce-transparency");
26+
} else {
27+
add_css_class ("reduce-transparency");
28+
29+
}
30+
}
1131
}
1232

1333
private class BottomMargin : Gtk.Widget {

0 commit comments

Comments
 (0)