Implement theme styling for Container
This commit is contained in:
parent
2933ac7355
commit
97555e67af
24 changed files with 306 additions and 258 deletions
|
|
@ -1,7 +1,9 @@
|
|||
use iced::alignment::{self, Alignment};
|
||||
use iced::button;
|
||||
use iced::theme;
|
||||
use iced::tooltip::{self, Tooltip};
|
||||
use iced::{
|
||||
alignment, button, Alignment, Button, Column, Container, Element, Length,
|
||||
Row, Sandbox, Settings, Text,
|
||||
Button, Column, Container, Element, Length, Row, Sandbox, Settings, Text,
|
||||
};
|
||||
|
||||
pub fn main() {
|
||||
|
|
@ -115,24 +117,6 @@ fn tooltip<'a>(
|
|||
)
|
||||
.gap(5)
|
||||
.padding(10)
|
||||
.style(style::Tooltip)
|
||||
.style(theme::Container::Box)
|
||||
.into()
|
||||
}
|
||||
|
||||
mod style {
|
||||
use iced::container;
|
||||
use iced::Color;
|
||||
|
||||
pub struct Tooltip;
|
||||
|
||||
impl container::StyleSheet for Tooltip {
|
||||
fn style(&self) -> container::Style {
|
||||
container::Style {
|
||||
text_color: Some(Color::from_rgb8(0xEE, 0xEE, 0xEE)),
|
||||
background: Some(Color::from_rgb(0.11, 0.42, 0.87).into()),
|
||||
border_radius: 12.0,
|
||||
..container::Style::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue