From 76aca12fece8f76294b70a0f9b2b30b67f90f863 Mon Sep 17 00:00:00 2001 From: Camden Dixie O'Brien Date: Sun, 2 Mar 2025 13:40:55 +0000 Subject: [PATCH] Add priority to activity cards --- client/src/activity_card.vala | 24 ++++++++++++++++-------- client/styles.css | 4 ++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/client/src/activity_card.vala b/client/src/activity_card.vala index 2123f4f..df3e234 100644 --- a/client/src/activity_card.vala +++ b/client/src/activity_card.vala @@ -6,20 +6,28 @@ namespace StudySystemClient { public ActivityCard(Activity activity) { add_css_class("card"); - var content = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 12); - - var text = new Gtk.Box(Gtk.Orientation.VERTICAL, 6); - text.hexpand = true; - var subject = new Gtk.Label(activity.subject); subject.halign = Gtk.Align.START; subject.add_css_class("activity-subject"); - text.append(subject); var type = new Gtk.Label(activity.type.to_string()); - type.halign = Gtk.Align.START; - text.append(type); + type.add_css_class("activity-type"); + var separator = new Gtk.Label("ยท"); + separator.add_css_class("activity-priority"); + var priority = new Gtk.Label("%0.2f".printf(activity.priority)); + priority.add_css_class("activity-priority"); + var details = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 6); + details.append(type); + details.append(separator); + details.append(priority); + + var text = new Gtk.Box(Gtk.Orientation.VERTICAL, 6); + text.hexpand = true; + text.append(subject); + text.append(details); + + var content = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 12); content.append(text); var button diff --git a/client/styles.css b/client/styles.css index 1753e75..d799846 100644 --- a/client/styles.css +++ b/client/styles.css @@ -14,6 +14,10 @@ font-weight: bold; } +.activity-priority { + color: alpha(@theme_fg_color, 0.6); +} + /* * The visual center (i.e. the center of the clock) of the * "appointment-new-symbolic" icon is slightly displaced from the