summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/multi_window/Cargo.toml2
-rw-r--r--examples/multi_window/src/main.rs10
2 files changed, 8 insertions, 4 deletions
diff --git a/examples/multi_window/Cargo.toml b/examples/multi_window/Cargo.toml
index 6de895d7..62198595 100644
--- a/examples/multi_window/Cargo.toml
+++ b/examples/multi_window/Cargo.toml
@@ -10,4 +10,4 @@ publish = false
iced = { path = "../..", features = ["debug", "multi_window"] }
env_logger = "0.10.0"
iced_native = { path = "../../native" }
-iced_lazy = { path = "../../lazy" } \ No newline at end of file
+iced_lazy = { path = "../../lazy" }
diff --git a/examples/multi_window/src/main.rs b/examples/multi_window/src/main.rs
index 9fe6b481..b9f0514c 100644
--- a/examples/multi_window/src/main.rs
+++ b/examples/multi_window/src/main.rs
@@ -26,6 +26,7 @@ struct Example {
_focused: window::Id,
}
+#[derive(Debug)]
struct Window {
title: String,
panes: pane_grid::State<Pane>,
@@ -80,8 +81,11 @@ impl Application for Example {
)
}
- fn title(&self) -> String {
- String::from("Multi windowed pane grid - Iced")
+ fn title(&self, window: window::Id) -> String {
+ self.windows
+ .get(&window)
+ .map(|w| w.title.clone())
+ .unwrap_or(String::from("New Window"))
}
fn update(&mut self, message: Message) -> Command<Message> {
@@ -262,7 +266,6 @@ impl Application for Example {
&window.title,
WindowMessage::TitleChanged,
),
- button(text("Apply")).style(theme::Button::Primary),
button(text("Close"))
.on_press(WindowMessage::CloseWindow)
.style(theme::Button::Destructive),
@@ -389,6 +392,7 @@ impl std::fmt::Display for SelectableWindow {
}
}
+#[derive(Debug)]
struct Pane {
id: usize,
pub axis: pane_grid::Axis,