From b5f3ac9718fd07165a6298672e5e71be53af3605 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 12 Sep 2020 10:58:07 -0400 Subject: [PATCH] Add a testcase for controls in headerbars This is meant to help with figuring out entry selection drag issues. --- tests/testheaderbar.c | 23 ++++++++++++++++ tests/testheadercontrols.ui | 52 +++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 tests/testheadercontrols.ui diff --git a/tests/testheaderbar.c b/tests/testheaderbar.c index b2a63c459b..16d16629bc 100644 --- a/tests/testheaderbar.c +++ b/tests/testheaderbar.c @@ -357,6 +357,28 @@ create_stacked_headerbar (GtkApplication *app) gtk_window_present (GTK_WINDOW (win)); } +/* controls */ +static void +create_controls (GtkApplication *app) +{ + GtkBuilder *builder; + GtkWidget *win; + const char *ui = "tests/testheadercontrols.ui"; + + if (!g_file_test (ui, G_FILE_TEST_EXISTS)) + { + g_warning ("Can't find %s", ui); + return; + } + + builder = gtk_builder_new_from_file (ui); + + win = (GtkWidget *)gtk_builder_get_object (builder, "window"); + gtk_window_set_application (GTK_WINDOW (win), app); + + gtk_window_present (GTK_WINDOW (win)); +} + /* technorama */ static const char css[] = @@ -517,6 +539,7 @@ struct { { "Fake headerbar", create_fake_headerbar }, { "Split headerbar", create_split_headerbar }, { "Stacked headerbar", create_stacked_headerbar }, + { "Headerbar with controls", create_controls }, { "Technorama", create_technorama }, }; int n_buttons = sizeof (buttons) / sizeof (buttons[0]); diff --git a/tests/testheadercontrols.ui b/tests/testheadercontrols.ui new file mode 100644 index 0000000000..4870f8e35c --- /dev/null +++ b/tests/testheadercontrols.ui @@ -0,0 +1,52 @@ + + + + 600 + 400 + preferences-desktop-font + + + 1 + + + + + Yes! + center + + + + + Check + center + + + + + + + center + abcdef + + + + + + + 0 + 100 + + + 0 + 100 + 33 + + + + + + + + + +