From 848054217d57f81e4163d65fef65cbcdd0072218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 9 Jan 2026 09:07:14 -0800 Subject: [PATCH 1/3] Pointing: use settings action --- src/Views/Pointing.vala | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/src/Views/Pointing.vala b/src/Views/Pointing.vala index 399c81dc..fa2e09a8 100644 --- a/src/Views/Pointing.vala +++ b/src/Views/Pointing.vala @@ -34,6 +34,8 @@ public class MouseTouchpad.PointingView : Switchboard.SettingsPage { pointer_speed_scale.add_mark (990, BOTTOM, _("Faster")); var cursor_size_24 = new Gtk.CheckButton () { + action_name = "pointing.cursor-size", + action_target = new Variant.int32 (24), tooltip_text = _("Small") }; cursor_size_24.add_css_class ("image-button"); @@ -44,7 +46,8 @@ public class MouseTouchpad.PointingView : Switchboard.SettingsPage { cursor_size_24_image.set_parent (cursor_size_24); var cursor_size_32 = new Gtk.CheckButton () { - group = cursor_size_24, + action_name = "pointing.cursor-size", + action_target = new Variant.int32 (32), tooltip_text = _("Medium") }; cursor_size_32.add_css_class ("image-button"); @@ -55,7 +58,8 @@ public class MouseTouchpad.PointingView : Switchboard.SettingsPage { cursor_size_32_image.set_parent (cursor_size_32); var cursor_size_48 = new Gtk.CheckButton () { - group = cursor_size_24, + action_name = "pointing.cursor-size", + action_target = new Variant.int32 (48), tooltip_text = _("Large") }; cursor_size_48.add_css_class ("image-button"); @@ -119,27 +123,9 @@ public class MouseTouchpad.PointingView : Switchboard.SettingsPage { var interface_settings = new GLib.Settings ("org.gnome.desktop.interface"); interface_settings.bind ("locate-pointer", reveal_pointer_switch, "active", DEFAULT); - switch (interface_settings.get_int ("cursor-size")) { - case 32: - cursor_size_32.active = true; - break; - case 48: - cursor_size_48.active = true; - break; - default: - cursor_size_24.active = true; - } - - cursor_size_24.toggled.connect (() => { - interface_settings.set_int ("cursor-size", 24); - }); - - cursor_size_32.toggled.connect (() => { - interface_settings.set_int ("cursor-size", 32); - }); - - cursor_size_48.toggled.connect (() => { - interface_settings.set_int ("cursor-size", 48); - }); + var action_group = new SimpleActionGroup (); + action_group.add_action (interface_settings.create_action ("cursor-size")); + + insert_action_group ("pointing", action_group); } } From c85836feff7a606b97fc60fd8e7a74d4613fc551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 9 Jan 2026 09:08:57 -0800 Subject: [PATCH 2/3] Pointing: Set images with child property --- src/Views/Pointing.vala | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/Views/Pointing.vala b/src/Views/Pointing.vala index fa2e09a8..9cc633ed 100644 --- a/src/Views/Pointing.vala +++ b/src/Views/Pointing.vala @@ -36,39 +36,33 @@ public class MouseTouchpad.PointingView : Switchboard.SettingsPage { var cursor_size_24 = new Gtk.CheckButton () { action_name = "pointing.cursor-size", action_target = new Variant.int32 (24), + child = new Gtk.Image.from_icon_name ("mouse-touchpad-pointing-symbolic") { + pixel_size = 24 + }, tooltip_text = _("Small") }; cursor_size_24.add_css_class ("image-button"); - var cursor_size_24_image = new Gtk.Image.from_icon_name ("mouse-touchpad-pointing-symbolic") { - pixel_size = 24 - }; - cursor_size_24_image.set_parent (cursor_size_24); - var cursor_size_32 = new Gtk.CheckButton () { action_name = "pointing.cursor-size", action_target = new Variant.int32 (32), + child = new Gtk.Image.from_icon_name ("mouse-touchpad-pointing-symbolic") { + pixel_size = 32 + }, tooltip_text = _("Medium") }; cursor_size_32.add_css_class ("image-button"); - var cursor_size_32_image = new Gtk.Image.from_icon_name ("mouse-touchpad-pointing-symbolic") { - pixel_size = 32 - }; - cursor_size_32_image.set_parent (cursor_size_32); - var cursor_size_48 = new Gtk.CheckButton () { action_name = "pointing.cursor-size", action_target = new Variant.int32 (48), + child = new Gtk.Image.from_icon_name ("mouse-touchpad-pointing-symbolic") { + pixel_size = 48 + }, tooltip_text = _("Large") }; cursor_size_48.add_css_class ("image-button"); - var cursor_size_48_image = new Gtk.Image.from_icon_name ("mouse-touchpad-pointing-symbolic") { - pixel_size = 48 - }; - cursor_size_48_image.set_parent (cursor_size_48); - var cursor_size_box = new Gtk.Box (HORIZONTAL, 24); cursor_size_box.append (cursor_size_24); cursor_size_box.append (cursor_size_32); From a8639a99102b0f13373c13d7fbc2f853d6976ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 9 Jan 2026 09:14:20 -0800 Subject: [PATCH 3/3] Pointing: fix screen reader for pointer size options --- src/Views/Pointing.vala | 8 ++++++-- src/meson.build | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Views/Pointing.vala b/src/Views/Pointing.vala index 9cc633ed..28aa3c5f 100644 --- a/src/Views/Pointing.vala +++ b/src/Views/Pointing.vala @@ -63,11 +63,15 @@ public class MouseTouchpad.PointingView : Switchboard.SettingsPage { }; cursor_size_48.add_css_class ("image-button"); - var cursor_size_box = new Gtk.Box (HORIZONTAL, 24); + var cursor_size_box = new Granite.Box (HORIZONTAL, DOUBLE); cursor_size_box.append (cursor_size_24); cursor_size_box.append (cursor_size_32); cursor_size_box.append (cursor_size_48); + var cursor_size_header = new Granite.HeaderLabel (_("Pointer Size")) { + mnemonic_widget = cursor_size_box + }; + var reveal_pointer_switch = new Gtk.Switch () { halign = END, valign = CENTER @@ -82,7 +86,7 @@ public class MouseTouchpad.PointingView : Switchboard.SettingsPage { row_spacing = 6 }; - content_area.attach (new Granite.HeaderLabel (_("Pointer Size")), 0, 0); + content_area.attach (cursor_size_header, 0, 0); content_area.attach (cursor_size_box, 0, 1); content_area.attach (reveal_pointer_label, 0, 2); diff --git a/src/meson.build b/src/meson.build index 726a5637..e9994886 100644 --- a/src/meson.build +++ b/src/meson.build @@ -20,7 +20,7 @@ shared_module( dependency('glib-2.0'), dependency('gio-2.0'), dependency('gobject-2.0'), - dependency('granite-7', version: '>=7.4.0'), + dependency('granite-7', version: '>=7.7.0'), dependency('gtk4'), dependency('libxml-2.0'), switchboard_dep