Add priority to activity cards
This commit is contained in:
parent
5a6b535beb
commit
76aca12fec
@ -6,20 +6,28 @@ namespace StudySystemClient {
|
|||||||
public ActivityCard(Activity activity) {
|
public ActivityCard(Activity activity) {
|
||||||
add_css_class("card");
|
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);
|
var subject = new Gtk.Label(activity.subject);
|
||||||
subject.halign = Gtk.Align.START;
|
subject.halign = Gtk.Align.START;
|
||||||
subject.add_css_class("activity-subject");
|
subject.add_css_class("activity-subject");
|
||||||
text.append(subject);
|
|
||||||
|
|
||||||
var type = new Gtk.Label(activity.type.to_string());
|
var type = new Gtk.Label(activity.type.to_string());
|
||||||
type.halign = Gtk.Align.START;
|
type.add_css_class("activity-type");
|
||||||
text.append(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);
|
content.append(text);
|
||||||
|
|
||||||
var button
|
var button
|
||||||
|
@ -14,6 +14,10 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.activity-priority {
|
||||||
|
color: alpha(@theme_fg_color, 0.6);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The visual center (i.e. the center of the clock) of the
|
* The visual center (i.e. the center of the clock) of the
|
||||||
* "appointment-new-symbolic" icon is slightly displaced from the
|
* "appointment-new-symbolic" icon is slightly displaced from the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user