Created
July 18, 2020 00:48
-
-
Save mtkennerly/4d5732c9ab11cb59a7be670f8d0c2330 to your computer and use it in GitHub Desktop.
Iced Container border not being shown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "repro" | |
version = "0.1.0" | |
authors = ["mtkennerly <mtkennerly@gmail.com>"] | |
edition = "2018" | |
[dependencies] | |
# iced = "0.1.1" | |
iced = { version = "0.1.1", rev = "4030326a352c365a282980aa2a37d549f4b659ae", git = "https://github.com/hecrj/iced" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use iced::{ | |
executor, Application, Command, Container, Element, Text, | |
}; | |
#[derive(Debug, Clone)] | |
enum Message {} | |
#[derive(Default)] | |
struct App; | |
impl Application for App { | |
type Executor = executor::Default; | |
type Message = Message; | |
type Flags = (); | |
fn new(_flags: ()) -> (Self, Command<Message>) { | |
( | |
App {}, | |
Command::none() | |
) | |
} | |
fn title(&self) -> String { | |
"Repro".to_string() | |
} | |
fn update(&mut self, _message: Message) -> Command<Message> { | |
Command::none() | |
} | |
fn view(&mut self) -> Element<Message> { | |
Container::new(Text::new("This is an example")).style(style::Container).into() | |
} | |
} | |
mod style { | |
use iced::{container, Color}; | |
pub struct Container; | |
impl container::StyleSheet for Container { | |
fn style(&self) -> container::Style { | |
container::Style { | |
border_color: Color::BLACK, | |
border_width: 1, | |
..container::Style::default() | |
} | |
} | |
} | |
} | |
fn main() { | |
App::run(iced::Settings::default()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment