fix: open-dialog example

This commit is contained in:
Ashley Wulber 2024-10-18 10:49:51 -04:00 committed by Ashley Wulber
parent 1c1840a7c2
commit 684d33115c
2 changed files with 3 additions and 5 deletions

View file

@ -16,6 +16,6 @@ tracing-subscriber = "0.3.17"
url = "2.4.0"
[dependencies.libcosmic]
features = ["debug", "winit", "multi-window", "wayland", "tokio"]
path = "../../"
default-features = false
features = ["debug", "wayland", "tokio"]

View file

@ -67,6 +67,7 @@ impl cosmic::Application for App {
/// Creates the application, and optionally emits command on initialize.
fn init(core: Core, _input: Self::Flags) -> (Self, Task<Self::Message>) {
let id = core.main_window_id().unwrap();
let mut app = App {
core,
file_contents: String::new(),
@ -75,10 +76,7 @@ impl cosmic::Application for App {
};
app.set_header_title("Open a file".into());
let cmd = app.set_window_title(
"COSMIC OpenDialog Demo".into(),
self.core.main_window_id().unwrap(),
);
let cmd = app.set_window_title("COSMIC OpenDialog Demo".into(), id);
(app, cmd)
}