From f3732051af3cd74ac2c2418a7d0e36f2ce244b04 Mon Sep 17 00:00:00 2001 From: jane400 Date: Wed, 28 Aug 2024 15:07:32 +0200 Subject: [PATCH] fix: ui tweaks for advices --- libpaket/src/tracking.rs | 16 +++++++++------- paket/src/advices.rs | 3 +-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/libpaket/src/tracking.rs b/libpaket/src/tracking.rs index 36495c2..b910556 100644 --- a/libpaket/src/tracking.rs +++ b/libpaket/src/tracking.rs @@ -82,9 +82,9 @@ struct SendungsInfo { sendungsliste: Option, } -#[derive(Deserialize)] +#[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] -struct SendungsVerlaufEvent { +pub struct SendungsVerlaufEvent { pub datum: String, ort: Option, pub ruecksendung: bool, @@ -102,18 +102,18 @@ impl SendungsVerlaufEvent { } } -#[derive(Deserialize)] +#[derive(Deserialize, Debug)] #[serde(rename_all = "camelCase")] -struct SendungsVerlauf { +pub struct SendungsVerlauf { kurz_status: Option, icon_id: Option, datum_aktueller_status: Option, aktueller_status: Option, - events: Option>, + pub events: Option>, farbe: u32, - fortschritt: u32, - maximal_fortschritt: u32, + pub fortschritt: u32, + pub maximal_fortschritt: u32, } #[derive(Deserialize)] @@ -321,6 +321,7 @@ pub struct Shipment { pub special: ShipmentSpecialDetails, + pub history: SendungsVerlauf, pub error: Option, } @@ -367,6 +368,7 @@ impl From for Shipment { None } }, + history: value.sendungsdetails.sendungsverlauf, special: ShipmentSpecialDetails { abholcode_available, benachrichtigt_in_filiale, diff --git a/paket/src/advices.rs b/paket/src/advices.rs index 0e7a5ab..3d43077 100644 --- a/paket/src/advices.rs +++ b/paket/src/advices.rs @@ -49,6 +49,7 @@ impl FactoryComponent for AppAdvice { add_overlay = >k::Box { add_css_class: relm4::css::OSD, + add_css_class: relm4::css::TOOLBAR, add_css_class: relm4::css::NUMERIC, set_valign: gtk::Align::End, @@ -57,8 +58,6 @@ impl FactoryComponent for AppAdvice { set_margin_all: 8, gtk::Label { - set_margin_all: 4, - set_label: self.metadata.date.as_str(), }, },