diff --git a/fitnesstrax/app/resources/style.css b/fitnesstrax/app/resources/style.css
index 1f3aea4..7ea5d9e 100644
--- a/fitnesstrax/app/resources/style.css
+++ b/fitnesstrax/app/resources/style.css
@@ -2,32 +2,57 @@
margin: 64px;
}
-.welcome-title {
+.welcome__title {
font-size: larger;
padding: 8px;
}
-.welcome-content {
+.welcome__content {
padding: 8px;
}
-.welcome-footer {
+.welcome__footer {
}
-.dialog-row {
+.modal {
+ background-color: @dialog_bg_color;
+ border-radius: 8px;
+ margin: 64px;
+}
+
+.modal__header {
+}
+
+.modal__title {
+ font-size: larger;
+ padding: 8px;
+}
+
+.modal__content {
+ background-color: @view_bg_color;
+ margin: 16px;
+}
+
+.modal__row {
margin: 8px 0px 8px 0px;
padding: 8px;
}
-.daysummary {
+.historical {
+ margin: 32px;
+ border-radius: 8px;
+}
+
+.day-summary {
padding: 8px;
}
-.daysummary-date {
+.day-summary__date {
font-size: larger;
margin-bottom: 8px;
}
-.daysummary-weight {
+.day-summary__weight {
margin: 4px;
}
+
diff --git a/fitnesstrax/app/src/app_window.rs b/fitnesstrax/app/src/app_window.rs
index dba2366..f0a73fb 100644
--- a/fitnesstrax/app/src/app_window.rs
+++ b/fitnesstrax/app/src/app_window.rs
@@ -16,12 +16,12 @@ You should have received a copy of the GNU General Public License along with Fit
use crate::{
app::{AppInvocation, AppResponse},
+ components::day_detail,
views::{HistoricalView, PlaceholderView, View, ViewName, WelcomeView},
};
use adw::prelude::*;
use async_channel::Sender;
-use chrono::{NaiveDate, TimeZone};
-use chrono_tz::America::Anchorage;
+use chrono::{FixedOffset, NaiveDate, TimeZone};
use dimensioned::si::{KG, M, S};
use ft_core::{Steps, TimeDistance, TraxRecord, Weight};
use gio::resources_lookup_data;
@@ -102,6 +102,10 @@ impl AppWindow {
window.set_content(Some(&navigation));
window.present();
+ let gesture = gtk::GestureClick::new();
+ gesture.connect_released(|_, _, _, _| println!("detected gesture"));
+ layout.add_controller(gesture);
+
let s = Self {
app_tx,
layout,
@@ -159,7 +163,56 @@ impl AppWindow {
})
.upcast(),
),
- ViewName::Historical => View::Historical(HistoricalView::new(vec![]).upcast()),
+ ViewName::Historical => View::Historical(
+ HistoricalView::new(
+ vec![
+ TraxRecord::Steps(Steps {
+ date: NaiveDate::from_ymd_opt(2023, 10, 13).unwrap(),
+ count: 1500,
+ }),
+ TraxRecord::Weight(Weight {
+ date: NaiveDate::from_ymd_opt(2023, 10, 13).unwrap(),
+ weight: 85. * KG,
+ }),
+ TraxRecord::Weight(Weight {
+ date: NaiveDate::from_ymd_opt(2023, 10, 14).unwrap(),
+ weight: 86. * KG,
+ }),
+ TraxRecord::BikeRide(TimeDistance {
+ datetime: FixedOffset::west_opt(10 * 60 * 60)
+ .unwrap()
+ .with_ymd_and_hms(2019, 6, 15, 12, 0, 0)
+ .unwrap(),
+ distance: Some(1000. * M),
+ duration: Some(150. * S),
+ comments: Some("Test Comments".to_owned()),
+ }),
+ TraxRecord::BikeRide(TimeDistance {
+ datetime: FixedOffset::west_opt(10 * 60 * 60)
+ .unwrap()
+ .with_ymd_and_hms(2019, 6, 15, 23, 0, 0)
+ .unwrap(),
+ distance: Some(1000. * M),
+ duration: Some(150. * S),
+ comments: Some("Test Comments".to_owned()),
+ }),
+ ],
+ {
+ let s = self.clone();
+ Rc::new(move |date, records| {
+ let layout = gtk::Box::new(gtk::Orientation::Vertical, 0);
+ layout.append(&adw::HeaderBar::new());
+ layout.append(&day_detail(date, records));
+ let page = &adw::NavigationPage::builder()
+ .title(date.format("%Y-%m-%d").to_string())
+ .child(&layout)
+ .build();
+ s.navigation.push(page);
+ })
+ },
+ )
+ .upcast(),
+ ),
}
}
}
diff --git a/fitnesstrax/app/src/components/day.rs b/fitnesstrax/app/src/components/day.rs
index 1026a20..6116124 100644
--- a/fitnesstrax/app/src/components/day.rs
+++ b/fitnesstrax/app/src/components/day.rs
@@ -21,7 +21,6 @@ use glib::Object;
use gtk::{prelude::*, subclass::prelude::*};
use std::cell::RefCell;
-#[derive(Default)]
pub struct DaySummaryPrivate {
date: gtk::Label,
weight: RefCell