[gnome-todo] task-row: add a strike-through on complete tasks
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo] task-row: add a strike-through on complete tasks
- Date: Mon, 10 Oct 2016 14:58:57 +0000 (UTC)
commit e3f7a7c27d3c5a1b9496bc44b2162fb5e1781275
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Oct 8 17:33:58 2016 -0300
task-row: add a strike-through on complete tasks
data/theme/Adwaita.css | 4 ++++
src/gtd-task-row.c | 21 +++++++++++++++++++++
2 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/data/theme/Adwaita.css b/data/theme/Adwaita.css
index dfcf186..3b45d67 100644
--- a/data/theme/Adwaita.css
+++ b/data/theme/Adwaita.css
@@ -99,6 +99,10 @@ taskrow.priority-hight:hover {
background-color: alpha(#cc0000, 0.4);
}
+taskrow.complete label {
+ text-decoration-line: line-through;
+}
+
/* extension list */
list.extension-list row {
border-bottom: solid 1px @borders
diff --git a/src/gtd-task-row.c b/src/gtd-task-row.c
index 490eb6a..0870ab9 100644
--- a/src/gtd-task-row.c
+++ b/src/gtd-task-row.c
@@ -112,6 +112,21 @@ gtd_task_row__priority_changed_cb (GtdTaskRow *row,
gtk_widget_queue_draw (GTK_WIDGET (row));
}
+static void
+complete_changed_cb (GtdTaskRow *self,
+ GParamSpec *pspec,
+ GtdTask *task)
+{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (self));
+
+ if (gtd_task_get_complete (task))
+ gtk_style_context_add_class (context, "complete");
+ else
+ gtk_style_context_remove_class (context, "complete");
+}
+
static gboolean
gtd_task_row__date_changed_binding (GBinding *binding,
const GValue *from_value,
@@ -614,6 +629,12 @@ gtd_task_row_set_task (GtdTaskRow *row,
"notify::priority",
G_CALLBACK (gtd_task_row__priority_changed_cb),
row);
+
+ complete_changed_cb (row, NULL, task);
+ g_signal_connect_swapped (task,
+ "notify::complete",
+ G_CALLBACK (complete_changed_cb),
+ row);
}
g_object_notify (G_OBJECT (row), "task");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]