treeview: Add support for styling the dragged header
https://bugzilla.gnome.org/show_bug.cgi?id=684980
This commit is contained in:
parent
f67273c579
commit
4e42bd055d
@ -3275,6 +3275,7 @@ gtk_tree_view_button_release_drag_column (GtkWidget *widget,
|
|||||||
GList *l;
|
GList *l;
|
||||||
gboolean rtl;
|
gboolean rtl;
|
||||||
GdkDevice *device, *other;
|
GdkDevice *device, *other;
|
||||||
|
GtkStyleContext *context;
|
||||||
|
|
||||||
tree_view = GTK_TREE_VIEW (widget);
|
tree_view = GTK_TREE_VIEW (widget);
|
||||||
|
|
||||||
@ -3286,6 +3287,10 @@ gtk_tree_view_button_release_drag_column (GtkWidget *widget,
|
|||||||
|
|
||||||
/* Move the button back */
|
/* Move the button back */
|
||||||
button = gtk_tree_view_column_get_button (tree_view->priv->drag_column);
|
button = gtk_tree_view_column_get_button (tree_view->priv->drag_column);
|
||||||
|
|
||||||
|
context = gtk_widget_get_style_context (button);
|
||||||
|
gtk_style_context_remove_class (context, STYLE_CLASS_DND);
|
||||||
|
|
||||||
g_object_ref (button);
|
g_object_ref (button);
|
||||||
gtk_container_remove (GTK_CONTAINER (tree_view), button);
|
gtk_container_remove (GTK_CONTAINER (tree_view), button);
|
||||||
gtk_widget_set_parent_window (button, tree_view->priv->header_window);
|
gtk_widget_set_parent_window (button, tree_view->priv->header_window);
|
||||||
@ -9788,6 +9793,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view,
|
|||||||
GdkDevice *pointer, *keyboard;
|
GdkDevice *pointer, *keyboard;
|
||||||
GdkWindowAttr attributes;
|
GdkWindowAttr attributes;
|
||||||
guint attributes_mask;
|
guint attributes_mask;
|
||||||
|
GtkStyleContext *context;
|
||||||
|
|
||||||
g_return_if_fail (tree_view->priv->column_drag_info == NULL);
|
g_return_if_fail (tree_view->priv->column_drag_info == NULL);
|
||||||
g_return_if_fail (tree_view->priv->cur_reorder == NULL);
|
g_return_if_fail (tree_view->priv->cur_reorder == NULL);
|
||||||
@ -9800,6 +9806,9 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view,
|
|||||||
|
|
||||||
button = gtk_tree_view_column_get_button (column);
|
button = gtk_tree_view_column_get_button (column);
|
||||||
|
|
||||||
|
context = gtk_widget_get_style_context (button);
|
||||||
|
gtk_style_context_add_class (context, STYLE_CLASS_DND);
|
||||||
|
|
||||||
gtk_widget_get_allocation (button, &button_allocation);
|
gtk_widget_get_allocation (button, &button_allocation);
|
||||||
|
|
||||||
attributes.window_type = GDK_WINDOW_CHILD;
|
attributes.window_type = GDK_WINDOW_CHILD;
|
||||||
|
Loading…
Reference in New Issue
Block a user