From 99463b9a62751f3ed955db0dbf49b5d27d528c92 Mon Sep 17 00:00:00 2001 From: Hari Rana Date: Thu, 23 Apr 2026 22:47:11 -0400 Subject: [PATCH] event-editor/multi-choice: Set accessible label without connecting signal Part-of: --- src/gui/event-editor/gcal-multi-choice.blp | 1 - src/gui/event-editor/gcal-multi-choice.c | 13 ++++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/gui/event-editor/gcal-multi-choice.blp b/src/gui/event-editor/gcal-multi-choice.blp index da7ff301..e528c118 100644 --- a/src/gui/event-editor/gcal-multi-choice.blp +++ b/src/gui/event-editor/gcal-multi-choice.blp @@ -3,7 +3,6 @@ using Gtk 4.0; template $GcalMultiChoice: Box { spacing: 6; accessible-role: spin_button; - notify::category => $set_accessibility_label() swapped; Button down_button { icon-name: "pan-start-symbolic"; diff --git a/src/gui/event-editor/gcal-multi-choice.c b/src/gui/event-editor/gcal-multi-choice.c index 273c783a..c6df1681 100644 --- a/src/gui/event-editor/gcal-multi-choice.c +++ b/src/gui/event-editor/gcal-multi-choice.c @@ -216,14 +216,6 @@ update_sensitivity (GcalMultiChoice *self) GTK_ACCESSIBLE_RELATION_CONTROLS); } -static void -set_accessibility_label (GcalMultiChoice *self) -{ - gtk_accessible_update_property (GTK_ACCESSIBLE (self), - GTK_ACCESSIBLE_PROPERTY_LABEL, - gcal_multi_choice_get_category (self), -1); -} - static void button_clicked_cb (GtkWidget *button, GcalMultiChoice *self) @@ -617,7 +609,6 @@ gcal_multi_choice_class_init (GcalMultiChoiceClass *class) gtk_widget_class_bind_template_child (widget_class, GcalMultiChoice, label1); gtk_widget_class_bind_template_child (widget_class, GcalMultiChoice, label2); - gtk_widget_class_bind_template_callback (widget_class, set_accessibility_label); gtk_widget_class_bind_template_callback (widget_class, button_clicked_cb); gtk_widget_class_bind_template_callback (widget_class, button_toggled_cb); gtk_widget_class_bind_template_callback (widget_class, button_state_flags_changed_cb); @@ -846,6 +837,10 @@ gcal_multi_choice_set_category (GcalMultiChoice *self, { self->category = g_strdup (category ? category : ""); + gtk_accessible_update_property (GTK_ACCESSIBLE (self), + GTK_ACCESSIBLE_PROPERTY_LABEL, category, + -1); + g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_CATEGORY]); } }