[gtk/wip/exalm/long-title] tests: Add a long title test




commit 60611a3ea3fb50dc3677ac5334aa534931734646
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue Oct 6 19:37:54 2020 +0500

    tests: Add a long title test
    
    See https://gitlab.gnome.org/GNOME/gtk/-/issues/3235

 tests/meson.build     |  1 +
 tests/testlongtitle.c | 37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)
---
diff --git a/tests/meson.build b/tests/meson.build
index 99f95009f0..41755242aa 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -58,6 +58,7 @@ gtk_tests = [
   ['testlistview-animating'],
   ['testlevelbar'],
   ['testlockbutton'],
+  ['testlongtitle'],
   ['testmenubutton'],
   ['testmountoperation'],
   ['testnotebookdnd'],
diff --git a/tests/testlongtitle.c b/tests/testlongtitle.c
new file mode 100644
index 0000000000..c14f30f521
--- /dev/null
+++ b/tests/testlongtitle.c
@@ -0,0 +1,37 @@
+#include <gtk/gtk.h>
+
+static void
+on_activate (GApplication *app,
+             gpointer      data)
+{
+  GtkWidget *window;
+
+  window = gtk_application_window_new (GTK_APPLICATION (app));
+  gtk_window_set_default_size (GTK_WINDOW (window), 900, 300);
+  gtk_window_set_title (GTK_WINDOW (window), "This title is very long and will most definitely not fit into 
a small window's titlebar, causing it to be ellipsized");
+
+  gtk_window_present (GTK_WINDOW (window));
+
+  window = gtk_application_window_new (GTK_APPLICATION (app));
+  gtk_window_set_default_size (GTK_WINDOW (window), 600, 300);
+  gtk_window_set_title (GTK_WINDOW (window), "This title is very long and will most definitely not fit into 
a small window's titlebar, causing it to be ellipsized");
+
+  gtk_window_present (GTK_WINDOW (window));
+
+  window = gtk_application_window_new (GTK_APPLICATION (app));
+  gtk_window_set_default_size (GTK_WINDOW (window), 300, 300);
+  gtk_window_set_title (GTK_WINDOW (window), "This title is very long and will most definitely not fit into 
a small window's titlebar, causing it to be ellipsized");
+
+  gtk_window_present (GTK_WINDOW (window));
+}
+
+int
+main (int argc, char *argv[])
+{
+  GtkApplication *app = gtk_application_new ("org.gtk.fmuellner.Revealer", 0);
+
+  g_signal_connect (app, "activate", G_CALLBACK (on_activate), NULL);
+
+  return g_application_run (G_APPLICATION (app), argc, argv);
+}
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]