mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
textview: Fix drag highlight problems
This commit is contained in:
parent
a84926f03a
commit
09b837183e
@ -1750,7 +1750,8 @@ gtk_text_view_init (GtkTextView *text_view)
|
||||
priv->selection_node = gtk_css_node_new ();
|
||||
gtk_css_node_set_name (priv->selection_node, I_("selection"));
|
||||
gtk_css_node_set_parent (priv->selection_node, priv->text_window->css_node);
|
||||
gtk_css_node_set_state (priv->selection_node, gtk_css_node_get_state (priv->text_window->css_node));
|
||||
gtk_css_node_set_state (priv->selection_node,
|
||||
gtk_css_node_get_state (priv->text_window->css_node) & ~GTK_STATE_FLAG_DROP_ACTIVE);
|
||||
gtk_css_node_set_visible (priv->selection_node, FALSE);
|
||||
g_object_unref (priv->selection_node);
|
||||
}
|
||||
@ -4922,6 +4923,9 @@ gtk_text_view_state_flags_changed (GtkWidget *widget,
|
||||
|
||||
state = gtk_widget_get_state_flags (widget);
|
||||
gtk_css_node_set_state (priv->text_window->css_node, state);
|
||||
|
||||
state &= ~GTK_STATE_FLAG_DROP_ACTIVE;
|
||||
|
||||
gtk_css_node_set_state (priv->selection_node, state);
|
||||
if (priv->left_window)
|
||||
gtk_css_node_set_state (priv->left_window->css_node, state);
|
||||
@ -8318,6 +8322,8 @@ gtk_text_view_drag_leave (GtkWidget *widget,
|
||||
g_source_remove (priv->scroll_timeout);
|
||||
|
||||
priv->scroll_timeout = 0;
|
||||
|
||||
gtk_drag_unhighlight (widget);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -8420,6 +8426,8 @@ gtk_text_view_drag_motion (GtkWidget *widget,
|
||||
g_source_set_name_by_id (text_view->priv->scroll_timeout, "[gtk+] drag_scan_timeout");
|
||||
}
|
||||
|
||||
gtk_drag_highlight (widget);
|
||||
|
||||
/* TRUE return means don't propagate the drag motion to parent
|
||||
* widgets that may also be drop sites.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user