mirror of
https://github.com/Death916/deathclock.git
synced 2026-04-10 03:04:40 -07:00
make mlb scrollable
This commit is contained in:
parent
6c8e0413ca
commit
06964a28e1
1 changed files with 5 additions and 6 deletions
|
|
@ -4,7 +4,7 @@ use chrono::Local;
|
||||||
use iced::Border;
|
use iced::Border;
|
||||||
use iced::Element;
|
use iced::Element;
|
||||||
use iced::Fill;
|
use iced::Fill;
|
||||||
use iced::widget::{column, container, image, pane_grid, row, text};
|
use iced::widget::{column, container, image, pane_grid, row, text,scrollable};
|
||||||
use sports::Game;
|
use sports::Game;
|
||||||
pub fn main() -> iced::Result {
|
pub fn main() -> iced::Result {
|
||||||
iced::run(State::update, State::view)
|
iced::run(State::update, State::view)
|
||||||
|
|
@ -12,12 +12,12 @@ pub fn main() -> iced::Result {
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
enum PaneType {
|
enum PaneType {
|
||||||
Main,
|
|
||||||
MlbPane,
|
MlbPane,
|
||||||
NflPane,
|
NflPane,
|
||||||
NbaPane,
|
NbaPane,
|
||||||
Weather,
|
Weather,
|
||||||
Clock,
|
Clock,
|
||||||
|
News,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
@ -96,9 +96,10 @@ impl State {
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
PaneType::NflPane => text("NFL").into(),
|
PaneType::NflPane => text("NFL").into(),
|
||||||
|
PaneType::News => text("News").into(),
|
||||||
PaneType::MlbPane => {
|
PaneType::MlbPane => {
|
||||||
let games = &state.mlb_scores;
|
let games = &state.mlb_scores;
|
||||||
column(games.iter().map(|game| {
|
scrollable(column(games.iter().map(|game| {
|
||||||
container(
|
container(
|
||||||
column![
|
column![
|
||||||
row![
|
row![
|
||||||
|
|
@ -133,11 +134,9 @@ impl State {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.into()
|
.into()
|
||||||
}))
|
})))
|
||||||
.padding(0)
|
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
PaneType::Main => text("Main").into(),
|
|
||||||
PaneType::Clock => text("clock").into(),
|
PaneType::Clock => text("clock").into(),
|
||||||
PaneType::Weather => {
|
PaneType::Weather => {
|
||||||
let weather_img = image::Handle::from_bytes(state.weather.clone());
|
let weather_img = image::Handle::from_bytes(state.weather.clone());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue