mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-12 05:20:17 +00:00
rendernode-tool: Add --undecorated to show command
This is to get exactly just the rendernode drawn when testing, and not any extra drawing code.
This commit is contained in:
parent
020ef51cb0
commit
76007c4d09
@ -35,6 +35,11 @@ Showing
|
||||
|
||||
The ``show`` command displays the rendernode.
|
||||
|
||||
``--undecorated``
|
||||
|
||||
Removes window decorations. This is meant for rendering of exactly the rendernode
|
||||
without any titlebar.
|
||||
|
||||
Rendering
|
||||
^^^^^^^^^
|
||||
|
||||
|
@ -53,7 +53,8 @@ quit_cb (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static void
|
||||
show_file (const char *filename)
|
||||
show_file (const char *filename,
|
||||
gboolean decorated)
|
||||
{
|
||||
GskRenderNode *node;
|
||||
GdkPaintable *paintable;
|
||||
@ -79,6 +80,7 @@ show_file (const char *filename)
|
||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), picture);
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_decorated (GTK_WINDOW (window), decorated);
|
||||
set_window_title (GTK_WINDOW (window), filename);
|
||||
gtk_window_set_child (GTK_WINDOW (window), sw);
|
||||
|
||||
@ -98,7 +100,9 @@ do_show (int *argc,
|
||||
{
|
||||
GOptionContext *context;
|
||||
char **filenames = NULL;
|
||||
gboolean decorated = TRUE;
|
||||
const GOptionEntry entries[] = {
|
||||
{ "undecorated", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &decorated, N_("Don't add a titlebar"), NULL },
|
||||
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &filenames, NULL, N_("FILE") },
|
||||
{ NULL, }
|
||||
};
|
||||
@ -137,7 +141,7 @@ do_show (int *argc,
|
||||
exit (1);
|
||||
}
|
||||
|
||||
show_file (filenames[0]);
|
||||
show_file (filenames[0], decorated);
|
||||
|
||||
g_strfreev (filenames);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user