Commit 486b6987 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Give tiles a meaningful empty state

This will be used to prepopulate grids with empty tiles.
parent f188946b
......@@ -100,11 +100,16 @@ gs_app_tile_set_app (GsAppTile *tile, GsApp *app)
const gchar *summary;
g_return_if_fail (GS_IS_APP_TILE (tile));
g_return_if_fail (GS_IS_APP (app));
g_return_if_fail (GS_IS_APP (app) || app == NULL);
priv = gs_app_tile_get_instance_private (tile);
gtk_image_clear (GTK_IMAGE (priv->image));
gtk_image_set_pixel_size (GTK_IMAGE (priv->image), 64);
g_clear_object (&priv->app);
if (!app)
return;
priv->app = g_object_ref (app);
g_signal_connect (priv->app, "notify::state",
......@@ -134,7 +139,11 @@ gs_app_tile_destroy (GtkWidget *widget)
static void
button_clicked (GsAppTile *tile)
{
g_signal_emit (tile, signals[SIGNAL_CLICKED], 0);
GsAppTilePrivate *priv;
priv = gs_app_tile_get_instance_private (tile);
if (priv->app)
g_signal_emit (tile, signals[SIGNAL_CLICKED], 0);
}
static void
......
......@@ -95,11 +95,14 @@ gs_feature_tile_set_app (GsFeatureTile *tile, GsApp *app)
gchar *data;
g_return_if_fail (GS_IS_FEATURE_TILE (tile));
g_return_if_fail (GS_IS_APP (app));
g_return_if_fail (GS_IS_APP (app) || app == NULL);
priv = gs_feature_tile_get_instance_private (tile);
g_clear_object (&priv->app);
if (!app)
return;
priv->app = g_object_ref (app);
g_signal_connect (priv->app, "notify::state",
......@@ -148,7 +151,11 @@ gs_feature_tile_destroy (GtkWidget *widget)
static void
button_clicked (GsFeatureTile *tile)
{
g_signal_emit (tile, signals[SIGNAL_CLICKED], 0);
GsFeatureTilePrivate *priv;
priv = gs_feature_tile_get_instance_private (tile);
if (priv->app)
g_signal_emit (tile, signals[SIGNAL_CLICKED], 0);
}
static void
......
......@@ -98,11 +98,13 @@ gs_popular_tile_set_app (GsPopularTile *tile, GsApp *app)
GsPopularTilePrivate *priv;
g_return_if_fail (GS_IS_POPULAR_TILE (tile));
g_return_if_fail (GS_IS_APP (app));
g_return_if_fail (GS_IS_APP (app) || app == NULL);
priv = gs_popular_tile_get_instance_private (tile);
g_clear_object (&priv->app);
if (!app)
return;
priv->app = g_object_ref (app);
g_signal_connect (priv->app, "notify::state",
......@@ -130,7 +132,10 @@ gs_popular_tile_destroy (GtkWidget *widget)
static void
button_clicked (GsPopularTile *tile)
{
g_signal_emit (tile, signals[SIGNAL_CLICKED], 0);
GsPopularTilePrivate *priv;
priv = gs_popular_tile_get_instance_private (tile);
if (priv->app)
g_signal_emit (tile, signals[SIGNAL_CLICKED], 0);
}
static void
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment