[gtk/wip/otte/listview: 5/5] demo: Improve the file browser demo a bit
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/listview: 5/5] demo: Improve the file browser demo a bit
- Date: Sat, 19 Oct 2019 20:30:07 +0000 (UTC)
commit a0542516fa73f6374f979c1d17fe3b102fda5867
Author: Benjamin Otte <otte redhat com>
Date: Sat Oct 19 22:28:22 2019 +0200
demo: Improve the file browser demo a bit
demos/gtk-demo/demo.gresource.xml | 1 +
demos/gtk-demo/listview_filebrowser.c | 9 ++++-----
demos/gtk-demo/listview_filebrowser.ui | 3 ++-
3 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/demos/gtk-demo/demo.gresource.xml b/demos/gtk-demo/demo.gresource.xml
index 3829ddd61d..705be97709 100644
--- a/demos/gtk-demo/demo.gresource.xml
+++ b/demos/gtk-demo/demo.gresource.xml
@@ -121,6 +121,7 @@
<gresource prefix="/listview_filebrowser">
<file>listview_filebrowser.ui</file>
<file>listview_filebrowser_list.ui</file>
+ <file>listview_filebrowser_icons.ui</file>
</gresource>
<gresource prefix="/listview_weather">
<file compressed="true">listview_weather.txt</file>
diff --git a/demos/gtk-demo/listview_filebrowser.c b/demos/gtk-demo/listview_filebrowser.c
index fd0419e5f1..aa0e45bce6 100644
--- a/demos/gtk-demo/listview_filebrowser.c
+++ b/demos/gtk-demo/listview_filebrowser.c
@@ -1,8 +1,7 @@
-/* Icon View/Icon View Basics
+/* Lists/File browser
*
- * The GtkIconView widget is used to display and manipulate icons.
- * It uses a GtkTreeModel for data storage, so the list store
- * example might be helpful.
+ * This demo shows off the different layouts that are quickly achievable
+ * with GtkGridView by implementing a file browser with different views.
*/
#include <glib/gi18n.h>
@@ -59,7 +58,7 @@ do_listview_filebrowser (GtkWidget *do_widget)
g_object_unref (file);
/* grab focus in the view */
- view = gtk_list_view_new_with_factory (gtk_builder_list_item_factory_new_from_resource
("/listview_filebrowser/listview_filebrowser_list.ui"));
+ view = GTK_WIDGET (gtk_builder_get_object (builder, "view"));
gtk_widget_grab_focus (view);
g_object_unref (builder);
diff --git a/demos/gtk-demo/listview_filebrowser.ui b/demos/gtk-demo/listview_filebrowser.ui
index 27b4f8a0f9..67ac2f121b 100644
--- a/demos/gtk-demo/listview_filebrowser.ui
+++ b/demos/gtk-demo/listview_filebrowser.ui
@@ -43,9 +43,10 @@
<child>
<object class="GtkGridView" id="view">
<property name="model">dirlist</property>
+ <property name="max-columns">15</property>
<property name="factory">
<object class="GtkBuilderListItemFactory">
- <property name="resource">/listview_filebrowser/listview_filebrowser_list.ui</property>
+ <property name="resource">/listview_filebrowser/listview_filebrowser_icons.ui</property>
</object>
</property>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]