[recipes] An attempt at better recipe tiles
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] An attempt at better recipe tiles
- Date: Fri, 6 Jan 2017 20:38:36 +0000 (UTC)
commit 1605ec2129609c9da167cb2100bafd314979045a
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jan 6 14:25:55 2017 -0500
An attempt at better recipe tiles
This follows some ideas of Jakub in his latest mockup.
src/gr-recipe-tile.c | 28 ----------------------------
src/recipes.css | 18 ++++++++++++++++++
2 files changed, 18 insertions(+), 28 deletions(-)
---
diff --git a/src/gr-recipe-tile.c b/src/gr-recipe-tile.c
index 0c72d3c..925bfb7 100644
--- a/src/gr-recipe-tile.c
+++ b/src/gr-recipe-tile.c
@@ -61,7 +61,6 @@ add_recipe_css (GrRecipe *recipe,
const char *author;
g_autoptr(GrChef) chef = NULL;
g_autoptr(GArray) images = NULL;
- const char *color;
GrRecipeStore *store;
store = gr_app_get_recipe_store (GR_APP (g_application_get_default ()));
@@ -80,29 +79,6 @@ add_recipe_css (GrRecipe *recipe,
" background-size: 100%%;\n"
" background-repeat: no-repeat;\n", ri->path);
g_string_append (css, "}\n\n");
-
- if (ri->dark_text)
- color = "black";
- else
- color = "white";
- }
- else {
- color = "black";
- }
-
- if (color) {
- g_string_append_printf (css, "label.recipe.name.%s {\n", id);
- g_string_append_printf (css, " color: %s;\n"
- " margin: 0 20px 0 20px;\n"
- " font-weight: bold;\n"
- " font-size: 24pt;\n", color);
- g_string_append (css, "}\n\n");
-
- g_string_append_printf (css, "label.recipe.author.%s {\n", id);
- g_string_append_printf (css, " color: %s;\n"
- " margin: 10px 20px 20px 20px;\n"
- " font-size: 12pt;\n", color);
- g_string_append (css, "}\n\n");
}
}
@@ -150,8 +126,6 @@ recipe_tile_set_recipe (GrRecipeTile *tile,
const char *elem;
elem = gr_recipe_get_id (tile->recipe);
gtk_style_context_remove_class (gtk_widget_get_style_context (tile->box), elem);
- gtk_style_context_remove_class (gtk_widget_get_style_context (tile->label), elem);
- gtk_style_context_remove_class (gtk_widget_get_style_context (tile->author), elem);
}
g_set_object (&tile->recipe, recipe);
@@ -165,8 +139,6 @@ recipe_tile_set_recipe (GrRecipeTile *tile,
elem = gr_recipe_get_id (tile->recipe);
gtk_style_context_add_class (gtk_widget_get_style_context (tile->box), elem);
- gtk_style_context_add_class (gtk_widget_get_style_context (tile->label), elem);
- gtk_style_context_add_class (gtk_widget_get_style_context (tile->author), elem);
name = gr_recipe_get_translated_name (recipe);
author = gr_recipe_get_author (recipe);
diff --git a/src/recipes.css b/src/recipes.css
index c5c196d..bfa6604 100644
--- a/src/recipes.css
+++ b/src/recipes.css
@@ -52,11 +52,29 @@ image.chef.circular {
background: @theme_base_color;
border-radius: 0;
}
+
.recipe.view.tile {
color: mix(@theme_base_color,@theme_fg_color,0.1);
background-image:
-gtk-recolor(url('resource:///org/gnome/Recipes/org.gnome.Recipes-symbolic.symbolic.png'));
background-size: 100%;
background-position: 80px -80px;
+ min-width: 258px;
+ min-height: 200px;
+}
+
+label.recipe.name {
+ background: white;
+ color: black;
+ font-weight: bold;
+ font-size: 20px;
+ padding: 10px 20px 0px 20px;
+}
+
+label.recipe.author {
+ background: white;
+ color: mix(@theme_base_color,@theme_fg_color,0.7);
+ font-size: 12px;
+ padding: 8px 20px 10px 20px;
}
@define-color diet_tag_bg #cc1212;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]