From 5760873a86961833dbe502e7d6c9d39deec22804 Mon Sep 17 00:00:00 2001 From: Fabrizio Iannetti Date: Sun, 21 Apr 2024 08:43:02 +0200 Subject: [PATCH] Smaller event bar height and font Signed-off-by: Fabrizio Iannetti --- src/main.rs | 14 +++++--------- src/ui/calendar.rs | 8 ++++---- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3d2f7ea..ed67f76 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,15 +17,15 @@ use log::info; use simplelog::{SimpleLogger, Config}; use iced::{ alignment, - Alignment, + Alignment, Command, - Element, - Length, + Element, + Length, widget::{ - Column, + Column, Row, Container, - Button, + Button, Text, pick_list, }, @@ -188,10 +188,6 @@ impl CalendarApp { app } - fn title(&self) -> String { - String::from("Calendar") - } - fn update(&mut self, message: Message) -> Command { match message { Message::PrevWeek => { diff --git a/src/ui/calendar.rs b/src/ui/calendar.rs index e1fc5a4..85e9e20 100644 --- a/src/ui/calendar.rs +++ b/src/ui/calendar.rs @@ -80,10 +80,10 @@ impl CalendarParams { day_other_month_fg: Color::from_rgb8(220, 220, 220), day_weekend_bg: Color::from_rgb8(245, 245, 245), day_text_margin: 5.0, - ev_height: 20.0, + ev_height: 18.0, ev_margin: 2.0, ev_bg: Color::from_rgb8(200, 245, 200), - ev_fontsize: 16.0, + ev_fontsize: 14.0, } } @@ -218,8 +218,8 @@ fn render_events_in_row( width: ev_bar.bounds.width, }; let ev_text_position = Point { - x: ev_bar.bounds.x, - y: ev_bar.bounds.y + 1.0, + x: ev_bar.bounds.x + 1.0, + y: ev_bar.bounds.y, }; renderer.fill_text( Text {