[gnome-todo] theme: improve support on dark variants
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo] theme: improve support on dark variants
- Date: Thu, 6 Oct 2016 14:12:26 +0000 (UTC)
commit 3c6c292e0ff23d3f01a6ba1ef4afcefca417883b
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Oct 6 00:37:50 2016 -0300
theme: improve support on dark variants
data/theme/Adwaita.css | 4 ++--
data/ui/list-view.ui | 3 +++
src/gtd-task-list-view.c | 10 ++++++++--
src/views/gtd-list-selector-grid-item.c | 12 ++++++++++--
4 files changed, 23 insertions(+), 6 deletions(-)
---
diff --git a/data/theme/Adwaita.css b/data/theme/Adwaita.css
index 15bd93d..2d6a92a 100644
--- a/data/theme/Adwaita.css
+++ b/data/theme/Adwaita.css
@@ -29,8 +29,8 @@ grid-item {
background-color: transparent;
}
-grid-item,
-task-list-view task-row {
+grid-item.light,
+task-list-view.light task-row label {
color: #000003;
}
diff --git a/data/ui/list-view.ui b/data/ui/list-view.ui
index 62f53f5..9710eed 100644
--- a/data/ui/list-view.ui
+++ b/data/ui/list-view.ui
@@ -29,6 +29,9 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
+ <style>
+ <class name="view" />
+ </style>
<child>
<object class="GtkListBox" id="listbox">
<property name="visible">True</property>
diff --git a/src/gtd-task-list-view.c b/src/gtd-task-list-view.c
index 18b5375..292aef0 100644
--- a/src/gtd-task-list-view.c
+++ b/src/gtd-task-list-view.c
@@ -238,9 +238,15 @@ update_font_color (GtdTaskListView *view)
color = gtd_task_list_get_color (priv->task_list);
if (LUMINANCE (color) < 0.5)
- gtk_style_context_add_class (context, "dark");
+ {
+ gtk_style_context_add_class (context, "dark");
+ gtk_style_context_remove_class (context, "light");
+ }
else
- gtk_style_context_remove_class (context, "dark");
+ {
+ gtk_style_context_add_class (context, "light");
+ gtk_style_context_remove_class (context, "dark");
+ }
gdk_rgba_free (color);
}
diff --git a/src/views/gtd-list-selector-grid-item.c b/src/views/gtd-list-selector-grid-item.c
index c930d64..e614b96 100644
--- a/src/views/gtd-list-selector-grid-item.c
+++ b/src/views/gtd-list-selector-grid-item.c
@@ -123,7 +123,15 @@ gtd_list_selector_grid_item__render_thumbnail (GtdListSelectorGridItem *item)
* font color.
*/
if (LUMINANCE (color) < 0.5)
- gtk_style_context_add_class (context, "dark");
+ {
+ gtk_style_context_add_class (context, "dark");
+ gtk_style_context_remove_class (context, "light");
+ }
+ else
+ {
+ gtk_style_context_add_class (context, "light");
+ gtk_style_context_remove_class (context, "dark");
+ }
/*
* Sort the list, so that the first tasks are similar to what
@@ -172,7 +180,7 @@ gtd_list_selector_grid_item__render_thumbnail (GtdListSelectorGridItem *item)
* If we reach the last visible row, it should draw a
* "…" mark and stop drawing anything else
*/
- if (y + (padding.top + font_height + padding.bottom) + margin.bottom > 174)
+ if (y + font_height + 4 + margin.bottom + padding.bottom > THUMBNAIL_SIZE)
{
pango_layout_set_text (layout,
"…",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]