diff --git a/.gitignore b/.gitignore index 8796cd7..a037d69 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,4 @@ # End of https://www.toptal.com/developers/gitignore/api/visualstudiocode -.DS_Store \ No newline at end of file +.DS_Store diff --git a/img/wolt.png b/img/wolt.png new file mode 100644 index 0000000..f7d1f4e Binary files /dev/null and b/img/wolt.png differ diff --git a/src/food/worker.rs b/src/food/worker.rs index 74b5e53..8bc09e3 100644 --- a/src/food/worker.rs +++ b/src/food/worker.rs @@ -61,6 +61,7 @@ fn get_tracking_status(tracking_data: Result) -> F FoodTracking { resturant_name: tracking_data.from_location.name.en.into(), + status: tracking_data.status.into(), minutes_remaining, active, } diff --git a/ui/foodtrackerwidget.slint b/ui/foodtrackerwidget.slint index a48e48e..8f15c2e 100644 --- a/ui/foodtrackerwidget.slint +++ b/ui/foodtrackerwidget.slint @@ -1,14 +1,60 @@ +import { HorizontalBox, VerticalBox } from "std-widgets.slint"; export struct FoodTracking { resturant_name: string, minutes_remaining: string, + status: string, active: bool, } export component FoodTrackerWidget{ in property tracking; - Text { - font-size: 3rem; - text: "Mat fra " + tracking.resturant_name + " kommer om " + tracking.minutes_remaining + " minutter!"; - color: #FEFBE6; - } + Rectangle { + height: 8rem; + background: #FFFFFF; + border-radius: 32px; + HorizontalLayout { + alignment: space-around; + VerticalBox { + Text { + text: "Fra"; + color: #1F0D8D; + font-size: 2.5rem; + } + Text { + text: tracking.resturant_name; + color: #000000; + font-size: 2rem; + } + } + VerticalBox { + Text { + text: "Status"; + color: #1F0D8D; + font-size: 2.5rem; + } + Text { + text: tracking.status; + color: #000000; + font-size: 2rem; + } + } + VerticalBox { + Text { + text: "ETA"; + color: #1F0D8D; + font-size: 2.5rem; + } + Text { + text: tracking.minutes-remaining + " minutter"; + color: #000000; + font-size: 2rem; + } + } + Image { + source: @image-url("../img/wolt.png"); + width: 100px; + } + + } + } } \ No newline at end of file diff --git a/ui/mainwindow.slint b/ui/mainwindow.slint index f14b49d..c21c184 100644 --- a/ui/mainwindow.slint +++ b/ui/mainwindow.slint @@ -28,7 +28,7 @@ export component MainWindow inherits Window { }; in property foodTracking: { - active: true, + active: false, resturant_name: "McDonalds", minutes_remaining: "5", @@ -42,6 +42,9 @@ export component MainWindow inherits Window { default-font-family: "Bagoss"; VerticalLayout{ + width: 100%; + padding-left: 2rem; + padding-right: 2rem; alignment: space-between; ForecastWidget { today: todayForecast; tomorrow: tomorrowForecast;} @@ -55,35 +58,30 @@ export component MainWindow inherits Window { xkcd: xkcd; } - HorizontalBox { + HorizontalLayout { + width: 100%; alignment: space-between; - VerticalLayout { - alignment: end; - spacing: -3px; - padding-bottom: 6px; - Text { - font-size: 2.4rem; - font-weight: 700; - horizontal-alignment: center; - color: #FEFBE6; - text: date; + VerticalLayout { + spacing: -3px; + padding-bottom: 6px; + Text { + font-size: 2.4rem; + font-weight: 700; + color: #FEFBE6; + text: date; + } + Text { + font-size: 1.1rem; + color: #FEFBE6; + text: month; + } } Text { - font-size: 1.1rem; - horizontal-alignment: center; color: #FEFBE6; - text: month; + font-size: 4rem; + text: time; + font-family: "Fira Mono"; } - } - - Text { - color: #FEFBE6; - horizontal-alignment: right; - font-size: 4rem; - text: time; - font-family: "Fira Mono"; - } - } - + } } } \ No newline at end of file