commit bf02d44809ee26665c2014885daaaf48b4c0229f
parent f5c761fec05d9a73c679d60b8291d236df0c771b
Author: Sylvia Ivory <git@sivory.net>
Date: Fri, 20 Jun 2025 02:50:01 -0700
Adjust font sizing
Diffstat:
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/src/icon.rs b/src/icon.rs
@@ -1,6 +1,5 @@
use iced::{
- Color, Element, Length, Theme,
- widget::{button, svg},
+ widget::{button, svg, Svg}, Color, Element, Length, Theme
};
use rust_embed::Embed;
@@ -9,14 +8,13 @@ use rust_embed::Embed;
#[prefix = "icons/"]
struct Icon;
-pub fn icon<'a, Message>(path: &str) -> Element<'a, Message> {
+pub fn icon<'a>(path: &str) -> Svg<'a, iced::Theme> {
let bytes = Icon::get(path).unwrap().data;
svg(svg::Handle::from_memory(bytes))
.height(Length::Fixed(16.0))
.width(Length::Fixed(16.0))
.style(white)
- .into()
}
pub fn icon_button<'a, Message: 'a + Clone>(
diff --git a/src/main.rs b/src/main.rs
@@ -412,16 +412,21 @@ impl Fjordgard {
let time_text = self.time.format_with_items(self.format_parsed.iter());
let time_widget = text(time_text.to_string())
- .size(100)
+ .size(200)
.font(bold)
.color(Color::WHITE)
.width(Length::Fill)
.center();
let weather_widget = container(row![
- icon(&self.forecast_icon),
- horizontal_space().width(Length::Fixed(7.25)),
- text(&self.forecast_text).color(Color::WHITE)
+ icon(&self.forecast_icon)
+ .height(Length::Fixed(32.0))
+ .width(Length::Fixed(32.0)),
+ horizontal_space()
+ .width(Length::Fixed(7.25)),
+ text(&self.forecast_text)
+ .color(Color::WHITE)
+ .size(25)
])
.center_x(Length::Fill);