mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
rendernode-tool: Add a GtkWindowHandle
Make the whole window area draggable, like usually the titlebar. This is especially useful with --undecorated. In that case we need to make the window non-resizable though, becuase otherwise it can be accidentally maximized and whatnot.
This commit is contained in:
parent
012c4b9425
commit
ecc2e02453
@ -60,6 +60,7 @@ show_file (const char *filename,
|
||||
graphene_rect_t node_bounds;
|
||||
GdkPaintable *paintable;
|
||||
GtkWidget *sw;
|
||||
GtkWidget *handle;
|
||||
GtkWidget *window;
|
||||
gboolean done = FALSE;
|
||||
GtkSnapshot *snapshot;
|
||||
@ -82,10 +83,14 @@ show_file (const char *filename,
|
||||
gtk_scrolled_window_set_propagate_natural_height (GTK_SCROLLED_WINDOW (sw), TRUE);
|
||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), picture);
|
||||
|
||||
handle = gtk_window_handle_new ();
|
||||
gtk_window_handle_set_child (GTK_WINDOW_HANDLE (handle), sw);
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_decorated (GTK_WINDOW (window), decorated);
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), decorated);
|
||||
set_window_title (GTK_WINDOW (window), filename);
|
||||
gtk_window_set_child (GTK_WINDOW (window), sw);
|
||||
gtk_window_set_child (GTK_WINDOW (window), handle);
|
||||
|
||||
gtk_window_present (GTK_WINDOW (window));
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (quit_cb), &done);
|
||||
|
Loading…
Reference in New Issue
Block a user