diff --git a/src/app.rs b/src/app.rs index 9eaebd1..40bcf42 100644 --- a/src/app.rs +++ b/src/app.rs @@ -89,7 +89,7 @@ impl CalendarApp { #[cfg(feature = "tracing")] tracepoints::calendar::view_entry(); let content = Column::new() - .align_items(Alignment::Center) + .align_x(Alignment::Center) .push(self.controls.view(self.view_date)) .push(CalendarView::new(self.controls.mode.unwrap_or(ViewMode::Year), &CalendarParams::new(), self.view_date, &self.events)) ; diff --git a/src/main.rs b/src/main.rs index be9c5f1..a855bc8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,7 @@ mod app; mod ui; mod model; -use app::{CalendarApp, Message}; +use app::CalendarApp; use iced::Task; use std::path; use clap::Parser; diff --git a/src/ui/controls.rs b/src/ui/controls.rs index fd96083..3fe3aea 100644 --- a/src/ui/controls.rs +++ b/src/ui/controls.rs @@ -7,7 +7,17 @@ use chrono::{ NaiveDate, Locale, }; -use iced::{Alignment, Background, Border, Element, Length, Theme, alignment, theme::palette, widget::{Button, Row, Text, button::{Status, Style, secondary}, row, text}}; +use iced::{ + Alignment, + Background, + Element, + Length, + Theme, + alignment, + theme::palette, + border, + widget::{Button, Row, Text, button::{Status, Style, secondary}, row, text} +}; //#[derive(Default)] pub struct Controls { @@ -32,7 +42,7 @@ impl Controls { _ => "".to_string() }; Row::new() - .align_items(Alignment::Center) + .align_y(Alignment::Center) .padding(5) .spacing(10) .push(row![ @@ -48,13 +58,13 @@ impl Controls { .push( Text::new(description) .width(Length::Fill) - .horizontal_alignment(alignment::Horizontal::Left) + .align_x(alignment::Horizontal::Left) .size(24), ) .push( Text::new(view_date.year().to_string()) .width(Length::Fill) - .horizontal_alignment(alignment::Horizontal::Right) + .align_x(alignment::Horizontal::Right) .size(40), ) .into() @@ -77,7 +87,7 @@ impl Controls { None => todo!(), } } - + fn get_mode_style(&self, view_mode: ViewMode) -> impl Fn(&Theme, Status) -> Style { if let Some(current_view_mode) = self.mode { if current_view_mode == view_mode { @@ -96,7 +106,7 @@ fn styled(pair: palette::Pair) -> Style { Style { background: Some(Background::Color(pair.color)), text_color: pair.text, - border: Border::rounded(2), + border: border::rounded(2), ..Style::default() } }