[gtk/gtk-4-2: 32/91] togglebutton: Fix expected group behavior
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-4-2: 32/91] togglebutton: Fix expected group behavior
- Date: Tue, 4 May 2021 02:05:40 +0000 (UTC)
commit 06c0012dd41e0a6a77b5f696a1a86796f4d3281f
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Apr 11 18:29:53 2021 -0400
togglebutton: Fix expected group behavior
The expectation is that a grouped button stays
active when you click it. Grouped check buttons
behave this way, and grouped toggle buttons should
too.
gtk/gtktogglebutton.c | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index 1e53a896c6..93ba0e7c07 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -199,6 +199,9 @@ gtk_toggle_button_clicked (GtkButton *button)
GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button);
GtkToggleButtonPrivate *priv = gtk_toggle_button_get_instance_private (toggle_button);
+ if (priv->active && (priv->group_prev || priv->group_next))
+ return;
+
gtk_toggle_button_set_active (toggle_button, !priv->active);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]