[gtk/wip/exalm/textview-selection] label: Update selection node and redraw on state changes
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/exalm/textview-selection] label: Update selection node and redraw on state changes
- Date: Mon, 3 May 2021 21:29:30 +0000 (UTC)
commit 316c783fcef7316103fa4f05d9820480d388db52
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Tue May 4 01:25:36 2021 +0500
label: Update selection node and redraw on state changes
Mirror GtkText and GtkTextView.
gtk/gtklabel.c | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 10d65667e9..43a923d93e 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -742,11 +742,22 @@ gtk_label_state_flags_changed (GtkWidget *widget,
if (self->select_info)
{
+ GtkStateFlags state;
+
if (!gtk_widget_is_sensitive (widget))
gtk_label_select_region (self, 0, 0);
gtk_label_update_cursor (self);
update_link_state (self);
+
+ state = gtk_widget_get_state_flags (widget) & ~GTK_STATE_FLAG_DROP_ACTIVE;
+
+ if (self->select_info->selection_node)
+ {
+ gtk_css_node_set_state (self->select_info->selection_node, state);
+
+ gtk_widget_queue_draw (widget);
+ }
}
if (GTK_WIDGET_CLASS (gtk_label_parent_class)->state_flags_changed)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]