[gnome-software/wip/templates: 6/6] Use a GtkBuilder template for GsShellOverview
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/templates: 6/6] Use a GtkBuilder template for GsShellOverview
- Date: Fri, 28 Mar 2014 11:01:59 +0000 (UTC)
commit 415a9dbebb3892a7011c4ed3e5493dcd51fc8528
Author: Kalev Lember <kalevlember gmail com>
Date: Thu Mar 27 23:59:27 2014 +0100
Use a GtkBuilder template for GsShellOverview
Move the UI definition to separate file and use a GtkBuilder template
for subclassing the widget.
po/POTFILES.in | 1 +
src/Makefile.am | 1 +
src/gnome-software.gresource.xml | 1 +
src/gnome-software.ui | 206 +------------------------------------
src/gs-shell-overview.c | 78 ++++++++------
src/gs-shell-overview.h | 4 +-
src/gs-shell-overview.ui | 215 ++++++++++++++++++++++++++++++++++++++
src/gs-shell.c | 3 +-
8 files changed, 267 insertions(+), 242 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 51e5300..ec316a2 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -24,6 +24,7 @@ src/gs-shell-details.c
src/gs-shell-installed.c
[type: gettext/glade]src/gs-shell-installed.ui
src/gs-shell-overview.c
+[type: gettext/glade]src/gs-shell-overview.ui
src/gs-shell-search.c
[type: gettext/glade]src/gs-shell-search.ui
src/gs-shell-updates.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 5864590..7900e43 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -36,6 +36,7 @@ UI_FILES = \
gs-shell-category.ui \
gs-shell-details.ui \
gs-shell-installed.ui \
+ gs-shell-overview.ui \
gs-shell-search.ui \
gs-shell-updates.ui \
gs-sources-dialog.ui \
diff --git a/src/gnome-software.gresource.xml b/src/gnome-software.gresource.xml
index 1316b96..aaa8879 100644
--- a/src/gnome-software.gresource.xml
+++ b/src/gnome-software.gresource.xml
@@ -14,6 +14,7 @@
<file preprocess="xml-stripblanks">gs-shell-category.ui</file>
<file preprocess="xml-stripblanks">gs-shell-details.ui</file>
<file preprocess="xml-stripblanks">gs-shell-installed.ui</file>
+ <file preprocess="xml-stripblanks">gs-shell-overview.ui</file>
<file preprocess="xml-stripblanks">gs-shell-search.ui</file>
<file preprocess="xml-stripblanks">gs-shell-updates.ui</file>
<file preprocess="xml-stripblanks">gs-sources-dialog.ui</file>
diff --git a/src/gnome-software.ui b/src/gnome-software.ui
index 4d6eb03..cad296a 100644
--- a/src/gnome-software.ui
+++ b/src/gnome-software.ui
@@ -434,212 +434,8 @@
<object class="GtkStack" id="stack_main">
<property name="visible">True</property>
<child>
- <object class="GtkStack" id="stack_overview">
+ <object class="GsShellOverview" id="shell_overview">
<property name="visible">True</property>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow_overview">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">never</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">none</property>
- <child internal-child="accessible">
- <object class="AtkObject" id="overview-accessible">
- <property name="accessible-name" translatable="yes">Overview page</property>
- </object>
- </child>
- <style>
- <class name="main-scrolled-software"/>
- </style>
- <child>
- <object class="GtkViewport" id="viewport_overview">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkBox" id="box_overview">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkLabel" id="featured_heading">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="margin-top">24</property>
- <property name="margin-bottom">12</property>
- <property name="margin-left">24</property>
- <property name="margin-right">24</property>
- <property name="label" translatable="yes">Featured</property>
- <accessibility>
- <relation target="bin_featured" type="label-for"/>
- </accessibility>
- <style>
- <class name="index-title-alignment-software"/>
- </style>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="bin_featured">
- <property name="visible">True</property>
- <property name="halign">fill</property>
- <property name="margin_start">12</property>
- <property name="margin_end">12</property>
- <accessibility>
- <relation target="featured_heading" type="labelled-by"/>
- </accessibility>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="popular_heading">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes" comments="Translators: This is a
heading for software which has been featured ('picked') by the distribution.">Picks</property>
- <property name="margin-top">24</property>
- <property name="margin-bottom">12</property>
- <property name="margin-left">24</property>
- <property name="margin-right">24</property>
- <accessibility>
- <relation target="box_popular" type="label-for"/>
- </accessibility>
- <style>
- <class name="index-title-alignment-software"/>
- </style>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="box_popular">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_start">12</property>
- <property name="margin_end">12</property>
- <property name="spacing">12</property>
- <property name="homogeneous">True</property>
- <property name="valign">start</property>
- <accessibility>
- <relation target="popular_heading" type="labelled-by"/>
- </accessibility>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="category_heading">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Categories</property>
- <property name="margin-top">24</property>
- <property name="margin-bottom">12</property>
- <property name="margin-left">24</property>
- <property name="margin-right">24</property>
- <accessibility>
- <relation target="grid_categories" type="label-for"/>
- </accessibility>
- <style>
- <class name="index-title-alignment-software"/>
- </style>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="grid_categories">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_start">12</property>
- <property name="margin_end">12</property>
- <property name="margin-bottom">24</property>
- <property name="row_spacing">12</property>
- <property name="column_spacing">12</property>
- <property name="row_homogeneous">True</property>
- <property name="column_homogeneous">True</property>
- <accessibility>
- <relation target="category_heading" type="labelled-by"/>
- </accessibility>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">5</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="name">overview</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="noresults_grid_overview">
- <property name="visible">True</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="halign">center</property>
- <property name="valign">center</property>
- <property name="row-spacing">12</property>
- <property name="column-spacing">12</property>
- <style>
- <class name="dim-label"/>
- </style>
- <child>
- <object class="GtkImage" id="noappdata_icon">
- <property name="visible">True</property>
- <property name="icon_name">gnome-software-symbolic</property>
- <property name="pixel-size">64</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- <packing>
- <property name="left-attach">0</property>
- <property name="top-attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="noappdata_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">No Application Data Found</property>
- <property name="halign">start</property>
- <property name="valign">center</property>
- <attributes>
- <attribute name="scale" value="1.4"/>
- </attributes>
- </object>
- <packing>
- <property name="left-attach">1</property>
- <property name="top-attach">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="name">no-results</property>
- </packing>
- </child>
</object>
<packing>
<property name="name">overview</property>
diff --git a/src/gs-shell-overview.c b/src/gs-shell-overview.c
index fb6f592..ed8ab1e 100644
--- a/src/gs-shell-overview.c
+++ b/src/gs-shell-overview.c
@@ -41,9 +41,19 @@ struct GsShellOverviewPrivate
GsShell *shell;
gint refresh_count;
gboolean empty;
+
+ GtkWidget *bin_featured;
+ GtkWidget *box_overview;
+ GtkWidget *box_popular;
+ GtkWidget *category_heading;
+ GtkWidget *featured_heading;
+ GtkWidget *grid_categories;
+ GtkWidget *popular_heading;
+ GtkWidget *scrolledwindow_overview;
+ GtkWidget *stack_overview;
};
-G_DEFINE_TYPE_WITH_PRIVATE (GsShellOverview, gs_shell_overview, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (GsShellOverview, gs_shell_overview, GTK_TYPE_BIN)
enum {
SIGNAL_REFRESHED,
@@ -88,26 +98,24 @@ gs_shell_overview_get_popular_cb (GObject *source_object,
GsApp *app;
gint i;
GtkWidget *tile;
- GtkWidget *grid;
/* get popular apps */
list = gs_plugin_loader_get_popular_finish (plugin_loader, res, &error);
- gtk_widget_set_visible (GTK_WIDGET (gtk_builder_get_object (priv->builder, "popular_heading")), list
!= NULL);
+ gtk_widget_set_visible (priv->popular_heading, list != NULL);
if (list == NULL) {
g_warning ("failed to get popular apps: %s", error->message);
g_error_free (error);
goto out;
}
- grid = GTK_WIDGET (gtk_builder_get_object (priv->builder, "box_popular"));
- gs_container_remove_all (GTK_CONTAINER (grid));
+ gs_container_remove_all (GTK_CONTAINER (priv->box_popular));
for (l = list, i = 0; l != NULL && i < 6; l = l->next, i++) {
app = GS_APP (l->data);
tile = gs_popular_tile_new (app);
g_signal_connect (tile, "clicked",
G_CALLBACK (popular_tile_clicked), shell);
- gtk_box_pack_start (GTK_BOX (grid), tile, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (priv->box_popular), tile, TRUE, TRUE, 0);
}
priv->empty = FALSE;
@@ -138,16 +146,14 @@ gs_shell_overview_get_featured_cb (GObject *source_object,
GsShellOverviewPrivate *priv = shell->priv;
GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (source_object);
GtkWidget *tile;
- GtkWidget *box;
GList *list;
GError *error = NULL;
GsApp *app;
- box = GTK_WIDGET (gtk_builder_get_object (priv->builder, "bin_featured"));
- gs_container_remove_all (GTK_CONTAINER (box));
+ gs_container_remove_all (GTK_CONTAINER (priv->bin_featured));
list = gs_plugin_loader_get_featured_finish (plugin_loader, res, &error);
- gtk_widget_set_visible (GTK_WIDGET (gtk_builder_get_object (priv->builder, "featured_heading")), list
!= NULL);
+ gtk_widget_set_visible (priv->featured_heading, list != NULL);
if (list == NULL) {
g_warning ("failed to get featured apps: %s", error->message);
g_error_free (error);
@@ -160,7 +166,7 @@ gs_shell_overview_get_featured_cb (GObject *source_object,
g_signal_connect (tile, "clicked",
G_CALLBACK (feature_tile_clicked), shell);
- gtk_container_add (GTK_CONTAINER (box), tile);
+ gtk_container_add (GTK_CONTAINER (priv->bin_featured), tile);
priv->empty = FALSE;
@@ -197,7 +203,6 @@ gs_shell_overview_get_categories_cb (GObject *source_object,
GList *l;
GList *list;
GsCategory *cat;
- GtkWidget *grid;
GtkWidget *tile;
gboolean has_category = FALSE;
@@ -207,8 +212,7 @@ gs_shell_overview_get_categories_cb (GObject *source_object,
g_error_free (error);
goto out;
}
- grid = GTK_WIDGET (gtk_builder_get_object (priv->builder, "grid_categories"));
- gs_container_remove_all (GTK_CONTAINER (grid));
+ gs_container_remove_all (GTK_CONTAINER (priv->grid_categories));
for (l = list, i = 0; l; l = l->next) {
cat = GS_CATEGORY (l->data);
@@ -217,7 +221,7 @@ gs_shell_overview_get_categories_cb (GObject *source_object,
tile = gs_category_tile_new (cat);
g_signal_connect (tile, "clicked",
G_CALLBACK (category_tile_clicked), shell);
- gtk_grid_attach (GTK_GRID (grid), tile, i % 3, i / 3, 1, 1);
+ gtk_grid_attach (GTK_GRID (priv->grid_categories), tile, i % 3, i / 3, 1, 1);
i++;
has_category = TRUE;
}
@@ -226,7 +230,7 @@ out:
if (has_category) {
priv->empty = FALSE;
}
- gtk_widget_set_visible (GTK_WIDGET (gtk_builder_get_object (priv->builder, "category_heading")),
has_category);
+ gtk_widget_set_visible (priv->category_heading, has_category);
priv->cache_valid = TRUE;
priv->refresh_count--;
@@ -253,14 +257,13 @@ gs_shell_overview_refresh (GsShellOverview *shell, gboolean scroll_up)
gtk_entry_set_text (GTK_ENTRY (widget), "");
}
- widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "scrolledwindow_overview"));
if (scroll_up) {
- adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (widget));
+ adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW
(priv->scrolledwindow_overview));
gtk_adjustment_set_value (adj, gtk_adjustment_get_lower (adj));
}
if (gs_shell_get_mode (priv->shell) == GS_SHELL_MODE_OVERVIEW) {
- gs_grab_focus_when_mapped (widget);
+ gs_grab_focus_when_mapped (priv->scrolledwindow_overview);
}
if (priv->cache_valid || priv->refresh_count > 0)
@@ -296,9 +299,8 @@ gs_shell_overview_setup (GsShellOverview *shell_overview,
GCancellable *cancellable)
{
GsShellOverviewPrivate *priv = shell_overview->priv;
- GtkWidget *sw, *widget;
GtkAdjustment *adj;
- GtkWidget *grid, *tile;
+ GtkWidget *tile;
gint i;
g_return_if_fail (GS_IS_SHELL_OVERVIEW (shell_overview));
@@ -310,25 +312,23 @@ gs_shell_overview_setup (GsShellOverview *shell_overview,
/* avoid a ref cycle */
priv->shell = shell;
- sw = GTK_WIDGET (gtk_builder_get_object (builder, "scrolledwindow_overview"));
- adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (sw));
- widget = GTK_WIDGET (gtk_builder_get_object (builder, "box_overview"));
- gtk_container_set_focus_vadjustment (GTK_CONTAINER (widget), adj);
+ adj = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (priv->scrolledwindow_overview));
+ gtk_container_set_focus_vadjustment (GTK_CONTAINER (priv->box_overview), adj);
- grid = GTK_WIDGET (gtk_builder_get_object (priv->builder, "bin_featured"));
tile = gs_feature_tile_new (NULL);
- gtk_container_add (GTK_CONTAINER (grid), tile);
+ gtk_container_add (GTK_CONTAINER (priv->bin_featured), tile);
- grid = GTK_WIDGET (gtk_builder_get_object (priv->builder, "box_popular"));
for (i = 0; i < 6; i++) {
tile = gs_popular_tile_new (NULL);
- gtk_box_pack_start (GTK_BOX (grid), tile, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (priv->box_popular), tile, TRUE, TRUE, 0);
}
}
static void
gs_shell_overview_init (GsShellOverview *shell)
{
+ gtk_widget_init_template (GTK_WIDGET (shell));
+
shell->priv = gs_shell_overview_get_instance_private (shell);
}
@@ -349,13 +349,11 @@ static void
gs_shell_overview_refreshed (GsShellOverview *shell)
{
GsShellOverviewPrivate *priv = shell->priv;
- GtkWidget *stack;
- stack = GTK_WIDGET (gtk_builder_get_object (priv->builder, "stack_overview"));
if (priv->empty) {
- gtk_stack_set_visible_child_name (GTK_STACK (stack), "no-results");
+ gtk_stack_set_visible_child_name (GTK_STACK (priv->stack_overview), "no-results");
} else {
- gtk_stack_set_visible_child_name (GTK_STACK (stack), "overview");
+ gtk_stack_set_visible_child_name (GTK_STACK (priv->stack_overview), "overview");
}
}
@@ -366,6 +364,8 @@ static void
gs_shell_overview_class_init (GsShellOverviewClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+
object_class->finalize = gs_shell_overview_finalize;
klass->refreshed = gs_shell_overview_refreshed;
@@ -375,6 +375,18 @@ gs_shell_overview_class_init (GsShellOverviewClass *klass)
G_STRUCT_OFFSET (GsShellOverviewClass, refreshed),
NULL, NULL, g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+
+ gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/software/gs-shell-overview.ui");
+
+ gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, bin_featured);
+ gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, box_overview);
+ gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, box_popular);
+ gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, category_heading);
+ gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, featured_heading);
+ gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, grid_categories);
+ gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, popular_heading);
+ gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, scrolledwindow_overview);
+ gtk_widget_class_bind_template_child_private (widget_class, GsShellOverview, stack_overview);
}
/**
diff --git a/src/gs-shell-overview.h b/src/gs-shell-overview.h
index 04e9fe2..8774357 100644
--- a/src/gs-shell-overview.h
+++ b/src/gs-shell-overview.h
@@ -42,13 +42,13 @@ typedef struct GsShellOverviewPrivate GsShellOverviewPrivate;
typedef struct
{
- GObject parent;
+ GtkBin parent;
GsShellOverviewPrivate *priv;
} GsShellOverview;
typedef struct
{
- GObjectClass parent_class;
+ GtkBinClass parent_class;
void (*refreshed) (GsShellOverview *shell);
} GsShellOverviewClass;
diff --git a/src/gs-shell-overview.ui b/src/gs-shell-overview.ui
new file mode 100644
index 0000000..fa60104
--- /dev/null
+++ b/src/gs-shell-overview.ui
@@ -0,0 +1,215 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <requires lib="gtk+" version="3.10"/>
+ <template class="GsShellOverview" parent="GtkBin">
+ <child internal-child="accessible">
+ <object class="AtkObject" id="overview-accessible">
+ <property name="accessible-name" translatable="yes">Overview page</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkStack" id="stack_overview">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow_overview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">none</property>
+ <style>
+ <class name="main-scrolled-software"/>
+ </style>
+ <child>
+ <object class="GtkViewport" id="viewport_overview">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="box_overview">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="featured_heading">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="margin-top">24</property>
+ <property name="margin-bottom">12</property>
+ <property name="margin-left">24</property>
+ <property name="margin-right">24</property>
+ <property name="label" translatable="yes">Featured</property>
+ <accessibility>
+ <relation target="bin_featured" type="label-for"/>
+ </accessibility>
+ <style>
+ <class name="index-title-alignment-software"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="bin_featured">
+ <property name="visible">True</property>
+ <property name="halign">fill</property>
+ <property name="margin_start">12</property>
+ <property name="margin_end">12</property>
+ <accessibility>
+ <relation target="featured_heading" type="labelled-by"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="popular_heading">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes" comments="Translators: This is a heading
for software which has been featured ('picked') by the distribution.">Picks</property>
+ <property name="margin-top">24</property>
+ <property name="margin-bottom">12</property>
+ <property name="margin-left">24</property>
+ <property name="margin-right">24</property>
+ <accessibility>
+ <relation target="box_popular" type="label-for"/>
+ </accessibility>
+ <style>
+ <class name="index-title-alignment-software"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box_popular">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_start">12</property>
+ <property name="margin_end">12</property>
+ <property name="spacing">12</property>
+ <property name="homogeneous">True</property>
+ <property name="valign">start</property>
+ <accessibility>
+ <relation target="popular_heading" type="labelled-by"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="category_heading">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Categories</property>
+ <property name="margin-top">24</property>
+ <property name="margin-bottom">12</property>
+ <property name="margin-left">24</property>
+ <property name="margin-right">24</property>
+ <accessibility>
+ <relation target="grid_categories" type="label-for"/>
+ </accessibility>
+ <style>
+ <class name="index-title-alignment-software"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid_categories">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_start">12</property>
+ <property name="margin_end">12</property>
+ <property name="margin-bottom">24</property>
+ <property name="row_spacing">12</property>
+ <property name="column_spacing">12</property>
+ <property name="row_homogeneous">True</property>
+ <property name="column_homogeneous">True</property>
+ <accessibility>
+ <relation target="category_heading" type="labelled-by"/>
+ </accessibility>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="name">overview</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="noresults_grid_overview">
+ <property name="visible">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="halign">center</property>
+ <property name="valign">center</property>
+ <property name="row-spacing">12</property>
+ <property name="column-spacing">12</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ <child>
+ <object class="GtkImage" id="noappdata_icon">
+ <property name="visible">True</property>
+ <property name="icon_name">gnome-software-symbolic</property>
+ <property name="pixel-size">64</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
+ </object>
+ <packing>
+ <property name="left-attach">0</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="noappdata_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">No Application Data Found</property>
+ <property name="halign">start</property>
+ <property name="valign">center</property>
+ <attributes>
+ <attribute name="scale" value="1.4"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left-attach">1</property>
+ <property name="top-attach">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="name">no-results</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </template>
+</interface>
diff --git a/src/gs-shell.c b/src/gs-shell.c
index e8030cb..54f72ca 100644
--- a/src/gs-shell.c
+++ b/src/gs-shell.c
@@ -520,6 +520,7 @@ gs_shell_setup (GsShell *shell, GsPluginLoader *plugin_loader, GCancellable *can
g_signal_connect (widget, "clicked",
G_CALLBACK (gs_shell_overview_button_cb), shell);
+ priv->shell_overview = GS_SHELL_OVERVIEW (gtk_builder_get_object (priv->builder, "shell_overview"));
gs_shell_overview_setup (priv->shell_overview,
shell,
priv->plugin_loader,
@@ -735,7 +736,6 @@ static void
gs_shell_init (GsShell *shell)
{
shell->priv = gs_shell_get_instance_private (shell);
- shell->priv->shell_overview = gs_shell_overview_new ();
shell->priv->ignore_primary_buttons = FALSE;
}
@@ -752,7 +752,6 @@ gs_shell_finalize (GObject *object)
g_object_unref (priv->builder);
g_object_unref (priv->cancellable);
g_object_unref (priv->plugin_loader);
- g_object_unref (priv->shell_overview);
G_OBJECT_CLASS (gs_shell_parent_class)->finalize (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]