diff --git a/minesweeper-iced/src/lib.rs b/minesweeper-iced/src/lib.rs index 0747ba9..2c79602 100644 --- a/minesweeper-iced/src/lib.rs +++ b/minesweeper-iced/src/lib.rs @@ -1,6 +1,6 @@ use iced::{ widget::{button, column, container, row, text, Column, Row}, - Color, Element, Length, Task, + Element, Length, Task, }; use minesweeper::{ history::{load_wins, save_win, WinHistory}, @@ -134,7 +134,7 @@ impl AppState { if let Some(outcome) = self.outcome.as_ref() { modal( content, - container(text(outcome)) + container(text(outcome).size(24)) .center_x(Length::Fill) .padding(20) .width(200) @@ -155,8 +155,6 @@ impl AppState { } } -fn modal_content_style(_theme: &iced::Theme) -> container::Style { - container::Style::default() - .background(Color::from_rgba8(0, 153, 204, 0.7)) - .border(iced::border::rounded(15)) +fn modal_content_style(theme: &iced::Theme) -> container::Style { + container::dark(theme).border(iced::border::rounded(15)) } diff --git a/minesweeper-iced/src/modal.rs b/minesweeper-iced/src/modal.rs index 8aaec06..f949e83 100644 --- a/minesweeper-iced/src/modal.rs +++ b/minesweeper-iced/src/modal.rs @@ -20,6 +20,7 @@ where .align_top(Length::Fill) .width(Length::Fill) .center_x(Length::Fill) + .center_y(Length::Fill) .padding(padding::top(10)) .style(|_theme| { container::Style { diff --git a/minesweeper-iced/src/views/scoreboard.rs b/minesweeper-iced/src/views/scoreboard.rs index 750cc41..3946a27 100644 --- a/minesweeper-iced/src/views/scoreboard.rs +++ b/minesweeper-iced/src/views/scoreboard.rs @@ -1,7 +1,7 @@ use super::format_elapsed; use iced::{ widget::{container, row, text, Column}, - Color, Element, + Element, }; use minesweeper::history::Win; @@ -24,16 +24,13 @@ impl<'a> ScoreBoard<'a> { .zip(1..) .fold(Column::new(), |col, (win, rank)| { let row = row![ - container(text(format!("{rank:<5}"))).width(20), - container(text(format_elapsed(win.duration))).width(200), - text(format!("{}", win.date.format("%b %d %Y %I:%M%P"))) + container(text(format!("{rank:<5}")).size(20)).width(25), + container(text(format_elapsed(win.duration)).size(20)).width(250), + text(format!("{}", win.date.format("%b %d %Y %I:%M%P"))).size(20) ] .spacing(10); col.push(row).spacing(10) }); - container(col) - .padding(20) - .style(|_| container::Style::default().background(Color::from_rgb8(0, 153, 204))) - .into() + container(col).padding(20).into() } }