[gtk/wip/otte/whatever: 13/15] gtk-demo: Cosmetic fixes for the words demo



commit c4dfee88602a7b62c342d3f563a083a87e0782ab
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jun 30 07:51:59 2020 -0400

    gtk-demo: Cosmetic fixes for the words demo
    
    Set a window size, and don't put newlines in titles, left align and
    ellipsize the label.

 demos/gtk-demo/listview_words.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/demos/gtk-demo/listview_words.c b/demos/gtk-demo/listview_words.c
index 1d6676e85c..2384edcbf1 100644
--- a/demos/gtk-demo/listview_words.c
+++ b/demos/gtk-demo/listview_words.c
@@ -16,6 +16,8 @@ const char *factory_text =
 "  <template class='GtkListItem'>\n"
 "    <property name='child'>\n"
 "      <object class='GtkLabel'>\n"
+"        <property name='ellipsize'>end</property>\n"
+"        <property name='xalign'>0</property>\n"
 "        <binding name='label'>\n"
 "          <lookup name='string' type='GtkStringObject'>\n"
 "            <lookup name='item'>GtkListItem</lookup>\n"
@@ -40,7 +42,7 @@ update_title_cb (GtkFilterListModel *model)
                                (total - pending) * 100 / total);
     }
   else
-    title = g_strdup_printf ("%u Words\n", g_list_model_get_n_items (G_LIST_MODEL (model)));
+    title = g_strdup_printf ("%u Words", g_list_model_get_n_items (G_LIST_MODEL (model)));
   gtk_window_set_title (GTK_WINDOW (window), title);
   g_free (title);
 }
@@ -182,7 +184,8 @@ do_listview_words (GtkWidget *do_widget)
       gtk_filter_list_model_set_incremental (filter_model, TRUE);
 
       window = gtk_window_new ();
-      gtk_window_set_title (GTK_WINDOW (window), "Words");
+      gtk_window_set_default_size (GTK_WINDOW (window), 400, 600);
+
       header = gtk_header_bar_new ();
       gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
       open_button = gtk_file_chooser_button_new ("_Open", GTK_FILE_CHOOSER_ACTION_OPEN);


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