forked from AuroraMiddleware/gtk
WIP: make GtkNotebook window-draggable
https://bugzilla.gnome.org/show_bug.cgi?id=672427 https://bugzilla.gnome.org/show_bug.cgi?id=674587
This commit is contained in:
parent
22eb687264
commit
b3a66c59ad
@ -2949,6 +2949,32 @@ gtk_notebook_button_press (GtkWidget *widget,
|
||||
priv->drag_offset_y = priv->drag_begin_y - page->allocation.y;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkWidget *window;
|
||||
window = gtk_widget_get_toplevel (widget);
|
||||
|
||||
if (window)
|
||||
{
|
||||
gboolean window_drag = FALSE;
|
||||
gtk_widget_style_get (widget,
|
||||
"window-dragging", &window_drag,
|
||||
NULL);
|
||||
|
||||
if (window_drag)
|
||||
{
|
||||
priv->during_detach = FALSE;
|
||||
priv->during_reorder = FALSE;
|
||||
priv->pressed_button = event->button;
|
||||
|
||||
gtk_window_begin_move_drag (GTK_WINDOW (window),
|
||||
event->button,
|
||||
event->x_root,
|
||||
event->y_root,
|
||||
event->time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -24,6 +24,10 @@
|
||||
-Gtest-bar: 47;
|
||||
}
|
||||
|
||||
GtkNotebook {
|
||||
-GtkWidget-window-dragging: true;
|
||||
}
|
||||
|
||||
GtkLabel:selected {
|
||||
background-color: gray;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user