From a502bb8d4c84246068ed63c413ad8c9cb9574710 Mon Sep 17 00:00:00 2001 From: lenemter Date: Thu, 31 Oct 2024 17:33:18 +0300 Subject: [PATCH 1/2] MainWindow: Separate the container background from the window --- data/Application.css | 9 ++++++--- src/MainWindow.vala | 24 +++++++++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/data/Application.css b/data/Application.css index cbd3b266f..86a8ed370 100644 --- a/data/Application.css +++ b/data/Application.css @@ -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; @@ -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 { diff --git a/src/MainWindow.vala b/src/MainWindow.vala index 460b59464..29b50885a 100644 --- a/src/MainWindow.vala +++ b/src/MainWindow.vala @@ -1,8 +1,14 @@ /* * 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"); @@ -10,17 +16,29 @@ public class Dock.MainWindow : Gtk.ApplicationWindow { 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"); + // 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); From 0b25d82206105d7688c7e6c666ebcb802f83d295 Mon Sep 17 00:00:00 2001 From: lenemter Date: Thu, 31 Oct 2024 17:56:20 +0300 Subject: [PATCH 2/2] Add semicolon --- data/Application.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/Application.css b/data/Application.css index 86a8ed370..4d34e5b18 100644 --- a/data/Application.css +++ b/data/Application.css @@ -18,7 +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); - padding: 9px + padding: 9px; } launcher {