[gtk/listview-for-merge: 156/163] gtk-demo: Cosmetic improvements to the listview demos
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/listview-for-merge: 156/163] gtk-demo: Cosmetic improvements to the listview demos
- Date: Sat, 30 May 2020 22:12:18 +0000 (UTC)
commit c7a7e713c37e8fe3764c0f59587576d1b553c814
Author: Matthias Clasen <mclasen redhat com>
Date: Fri May 29 13:25:36 2020 -0400
gtk-demo: Cosmetic improvements to the listview demos
Set default sizes, window titles and add more
detail to the descriptions.
demos/gtk-demo/flowbox.c | 2 ++
demos/gtk-demo/listview_clocks.c | 2 ++
demos/gtk-demo/listview_filebrowser.c | 3 ++-
demos/gtk-demo/listview_weather.c | 7 +++++--
4 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/demos/gtk-demo/flowbox.c b/demos/gtk-demo/flowbox.c
index 25bfe36258..760923af88 100644
--- a/demos/gtk-demo/flowbox.c
+++ b/demos/gtk-demo/flowbox.c
@@ -4,6 +4,8 @@
* as needed and support sorting and filtering.
*
* The children of a GtkFlowBox are regular widgets
+ *
+ * The dataset used here has 665 colors.
*/
#include <gtk/gtk.h>
diff --git a/demos/gtk-demo/listview_clocks.c b/demos/gtk-demo/listview_clocks.c
index 95d45dadd7..49108ac280 100644
--- a/demos/gtk-demo/listview_clocks.c
+++ b/demos/gtk-demo/listview_clocks.c
@@ -450,6 +450,8 @@ do_listview_clocks (GtkWidget *do_widget)
/* This is the normal window setup code every demo does */
window = gtk_window_new ();
+ gtk_window_set_title (GTK_WINDOW (window), "Clocks");
+ gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *) &window);
diff --git a/demos/gtk-demo/listview_filebrowser.c b/demos/gtk-demo/listview_filebrowser.c
index 0bc34e4b8e..8483ec35ff 100644
--- a/demos/gtk-demo/listview_filebrowser.c
+++ b/demos/gtk-demo/listview_filebrowser.c
@@ -1,7 +1,8 @@
/* Lists/File browser
*
* This demo shows off the different layouts that are quickly achievable
- * with GtkGridView by implementing a file browser with different views.
+ * with GtkListview and GtkGridView by implementing a file browser with
+ * different views.
*/
#include <glib/gi18n.h>
diff --git a/demos/gtk-demo/listview_weather.c b/demos/gtk-demo/listview_weather.c
index 48f725b140..4dbd16e37f 100644
--- a/demos/gtk-demo/listview_weather.c
+++ b/demos/gtk-demo/listview_weather.c
@@ -5,12 +5,13 @@
*
* The hourly weather info uses a horizontal listview. This is easy
* to achieve because GtkListView implements the GtkOrientable interface.
- *
* To make the items in the list stand out more, the listview uses
* separators.
*
* A GtkNoSelectionModel is used to make sure no item in the list can be
* selected. All other interactions with the items is still possible.
+ *
+ * The dataset used here has 70000 items.
*/
#include <gtk/gtk.h>
@@ -283,6 +284,8 @@ do_listview_weather (GtkWidget *do_widget)
GListModel *model, *selection;
window = gtk_window_new ();
+ gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
+ gtk_window_set_title (GTK_WINDOW (window), "Weather");
gtk_window_set_display (GTK_WINDOW (window),
gtk_widget_get_display (do_widget));
gtk_window_set_title (GTK_WINDOW (window), "Weather");
@@ -290,7 +293,7 @@ do_listview_weather (GtkWidget *do_widget)
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_window_set_child (GTK_WINDOW (window), sw);
-
+
listview = gtk_list_view_new_with_factory (
gtk_functions_list_item_factory_new (setup_widget,
bind_widget,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]