aboutsummaryrefslogtreecommitdiff
path: root/src/main.odin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.odin')
-rw-r--r--src/main.odin31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/main.odin b/src/main.odin
index 1f2d46f..e0232c7 100644
--- a/src/main.odin
+++ b/src/main.odin
@@ -158,6 +158,13 @@ main :: proc() {
fmt.println("Resized to:", width, 'x', height)
}
+ pre_sos_price : f64 = 0
+
+ for each_day in workdays {
+ pre_sos_price += f64(each_day.price)
+ }
+
+ post_sos_price : f64 = pre_sos_price * 1.26
// TODO: Find a good way to calculate the size and location
// of all the timeblocks in every day.
@@ -235,13 +242,13 @@ when true {
bottom_bar.layout_cut_children = .Right
oui.item_insert(bottom_bar, totals)
- pre_sos_price := label("120 000 kr", small_font, 0, .Right)
- pre_sos_price.layout_size.y = 11
- oui.item_insert(totals, pre_sos_price)
+ pre_sos_price_label := label(fmt.tprintf("%.2f Kr", pre_sos_price), small_font, 0, .Right)
+ pre_sos_price_label.layout_size.y = 11
+ oui.item_insert(totals, pre_sos_price_label)
- post_sos_price := label("160 000 kr", big_font, 300, .Right)
- post_sos_price.layout_size.y = 27
- oui.item_insert(totals, post_sos_price)
+ post_sos_price_label := label(fmt.tprintf("%.2f Kr", post_sos_price), big_font, 300, .Right)
+ post_sos_price_label.layout_size.y = 27
+ oui.item_insert(totals, post_sos_price_label)
}
{
@@ -267,11 +274,19 @@ when true {
oui.item_insert(line, label(clockprint(day.call), font, sizings.call, .Center))
line.layout_cut_children = .Right
- oui.item_insert(line, label(fmt.tprintf("%.2f kr", day.price), font, sizings.price, .Center))
+ oui.item_insert(line, label(fmt.tprintf("%.2f Kr", day.price), font, sizings.price, .Center))
oui.item_insert(line, label(clockprint(day.wrap), font, sizings.wrap, .Center))
line.layout_cut_children = .Fill
- timeline(line, &day)
+ {
+ a_timeline := timeline(line, &day)
+
+ /*x_offset := i32(int(f32(width)*fracts.start) - int(f32(width)*FRACT_MIN))
+ i32(rect.t),
+ i32(f32(width) * (fracts.end - fracts.start)+0.99),
+ i32(rect.b - rect.t),
+ color)*/
+ }
}
new_workday := button("+", 100)
middle_section.layout_cut_children = .Top