Skip to content
Closed
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
9 changes: 6 additions & 3 deletions data/Application.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
/*
* SPDX-License-Identifier: GPL-3.0
* SPDX-FileCopyrightText: 2023 elementary, Inc. (https://elementary.io)
* SPDX-FileCopyrightText: 2023-2024 elementary, Inc. (https://elementary.io)
*/

dock-window {
margin: 16px 0 9px 0;
}

dock {
background: alpha(@bg_color, 0.6);
border-radius: 9px;
Expand All @@ -14,8 +18,7 @@ dock {
0 0 0 1px alpha(@borders, 0.4),
0 1px 3px alpha(black, 0.10),
0 3px 9px alpha(black, 0.15);
margin: 9px;
margin-top: 0;
padding: 9px;
}

launcher {
Expand Down
24 changes: 21 additions & 3 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
@@ -1,26 +1,44 @@
/*
* SPDX-License-Identifier: GPL-3.0
* SPDX-FileCopyrightText: 2022 elementary, Inc. (https://elementary.io)
* SPDX-FileCopyrightText: 2022-2024 elementary, Inc. (https://elementary.io)
*/

public class Dock.Container : Gtk.Box {
class construct {
set_css_name ("dock");
}
}

public class Dock.MainWindow : Gtk.ApplicationWindow {
private static Settings settings = new Settings ("io.elementary.dock");

private Pantheon.Desktop.Shell? desktop_shell;
private Pantheon.Desktop.Panel? panel;

class construct {
set_css_name ("dock");
set_css_name ("dock-window");
}

construct {
var launcher_manager = LauncherManager.get_default ();

child = launcher_manager;
overflow = VISIBLE;
resizable = false;
titlebar = new Gtk.Label ("") { visible = false };

var overlay = new Gtk.Overlay () {
child = new Dock.Container ()
};
overlay.add_overlay (launcher_manager);

var size_group = new Gtk.SizeGroup (Gtk.SizeGroupMode.BOTH);
size_group.add_widget (overlay.child);
size_group.add_widget (launcher_manager);

child = overlay;

remove_css_class("background");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove_css_class ("background");


// Fixes DnD reordering of launchers failing on a very small line between two launchers
var drop_target_launcher = new Gtk.DropTarget (typeof (Launcher), MOVE);
launcher_manager.add_controller (drop_target_launcher);
Expand Down
Loading