diff options
Diffstat (limited to 'examples/pane_grid/src/main.rs')
-rw-r--r-- | examples/pane_grid/src/main.rs | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/examples/pane_grid/src/main.rs b/examples/pane_grid/src/main.rs index 9e78ad0b..6b5bd332 100644 --- a/examples/pane_grid/src/main.rs +++ b/examples/pane_grid/src/main.rs @@ -290,10 +290,8 @@ fn view_content<'a>( .align_items(Alignment::Center); container(scrollable(content)) - .width(Length::Fill) - .height(Length::Fill) + .center_y(Length::Fill) .padding(5) - .center_y() .into() } @@ -336,39 +334,30 @@ mod style { use iced::widget::container; use iced::{Border, Theme}; - pub fn title_bar_active( - theme: &Theme, - _status: container::Status, - ) -> container::Appearance { + pub fn title_bar_active(theme: &Theme) -> container::Style { let palette = theme.extended_palette(); - container::Appearance { + container::Style { text_color: Some(palette.background.strong.text), background: Some(palette.background.strong.color.into()), ..Default::default() } } - pub fn title_bar_focused( - theme: &Theme, - _status: container::Status, - ) -> container::Appearance { + pub fn title_bar_focused(theme: &Theme) -> container::Style { let palette = theme.extended_palette(); - container::Appearance { + container::Style { text_color: Some(palette.primary.strong.text), background: Some(palette.primary.strong.color.into()), ..Default::default() } } - pub fn pane_active( - theme: &Theme, - _status: container::Status, - ) -> container::Appearance { + pub fn pane_active(theme: &Theme) -> container::Style { let palette = theme.extended_palette(); - container::Appearance { + container::Style { background: Some(palette.background.weak.color.into()), border: Border { width: 2.0, @@ -379,13 +368,10 @@ mod style { } } - pub fn pane_focused( - theme: &Theme, - _status: container::Status, - ) -> container::Appearance { + pub fn pane_focused(theme: &Theme) -> container::Style { let palette = theme.extended_palette(); - container::Appearance { + container::Style { background: Some(palette.background.weak.color.into()), border: Border { width: 2.0, |