From d02b901f0f620ab425f4ffa8683e728e2dcb67df Mon Sep 17 00:00:00 2001 From: flodavid Date: Sun, 17 May 2026 05:08:05 +0200 Subject: [PATCH] feat: Reduce zone not reacting to clicks for output selection - Previously was 12px tall between two outputs (6px each, default value) - Now is 2px tall. Zone not removed entirely to avoid misclicks when on the border of two items --- data/indicator.css | 12 ++++++++++++ src/Widgets/DeviceItem.vala | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/data/indicator.css b/data/indicator.css index 70e4aa5a..757a7dd5 100644 --- a/data/indicator.css +++ b/data/indicator.css @@ -55,3 +55,15 @@ device-scale .image-button:disabled, player-row .image-button:disabled { background: @insensitive_bg_color; } + +/* Default menuitem padding is 6px. + Reduce it on the item and increase it on the radio button to ease toggling. + Leave 1 pixel padding to not select when the mouse is "on the border" of items to avoid miss-clicks. */ +menuitem.radio-list { + padding-top: 1px; + padding-bottom: 1px; +} +menuitem.radio-list radiobutton { + padding-top: 5px; + padding-bottom: 5px; +} diff --git a/src/Widgets/DeviceItem.vala b/src/Widgets/DeviceItem.vala index 9851f32d..26fbd8e9 100644 --- a/src/Widgets/DeviceItem.vala +++ b/src/Widgets/DeviceItem.vala @@ -23,6 +23,11 @@ public class Sound.Widgets.DeviceItem : Gtk.ListBoxRow { } construct { + // Add "radio-list" CSS class + Gtk.StyleContext context; + context = get_style_context (); + context.add_class ("radio-list"); + var label = new Gtk.Label (device.display_name) { halign = START, hexpand = true,