From 441af8389b9227eb74fd75e89dd7f14ebce6a69c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 10 Aug 2025 13:05:17 -0700 Subject: [PATCH] apprt/gtk-ng: split separator styling --- src/apprt/gtk-ng/css/style-dark.css | 5 +++++ src/apprt/gtk-ng/css/style.css | 23 ++++++++++++++++++++ src/apprt/gtk-ng/ui/1.5/split-tree-split.blp | 4 ++++ 3 files changed, 32 insertions(+) diff --git a/src/apprt/gtk-ng/css/style-dark.css b/src/apprt/gtk-ng/css/style-dark.css index a9aa2dcc0..f13b4f4f0 100644 --- a/src/apprt/gtk-ng/css/style-dark.css +++ b/src/apprt/gtk-ng/css/style-dark.css @@ -1,3 +1,8 @@ .transparent { background-color: transparent; } + +.window .split paned > separator { + background-color: rgba(36, 36, 36, 1); + background-clip: content-box; +} diff --git a/src/apprt/gtk-ng/css/style.css b/src/apprt/gtk-ng/css/style.css index 970c91b03..a1a425f66 100644 --- a/src/apprt/gtk-ng/css/style.css +++ b/src/apprt/gtk-ng/css/style.css @@ -114,3 +114,26 @@ label.resize-overlay { margin-left: 4px; margin-right: 8px; } + +/* + * Splits + */ + +.window .split paned > separator { + background-color: rgba(250, 250, 250, 1); + background-clip: content-box; + + /* This works around the oversized drag area for the right side of GtkPaned. + * + * Upstream Gtk issue: + * https://gitlab.gnome.org/GNOME/gtk/-/issues/4484#note_2362002 + * + * Ghostty issue: + * https://github.com/ghostty-org/ghostty/issues/3020 + * + * Without this, it's not possible to select the first character on the + * right-hand side of a split. + */ + margin: 0; + padding: 0; +} diff --git a/src/apprt/gtk-ng/ui/1.5/split-tree-split.blp b/src/apprt/gtk-ng/ui/1.5/split-tree-split.blp index aa194e8e8..182919f4e 100644 --- a/src/apprt/gtk-ng/ui/1.5/split-tree-split.blp +++ b/src/apprt/gtk-ng/ui/1.5/split-tree-split.blp @@ -2,6 +2,10 @@ using Gtk 4.0; using Adw 1; template $GhosttySplitTreeSplit: Adw.Bin { + styles [ + "split", + ] + // The double-nesting is required due to a GTK bug where you can't // bind the first child of a builder layout. If you do, you get a double // dispose. Easiest way to see that is simply remove this and see the