Skip to content

fix(855): Windows build #861

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions examples/calendar/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@ where
Self: cosmic::Application,
{
fn update_title(&mut self) -> Task<Message> {
self.set_header_title(String::from("Calendar Demo"));
self.set_window_title(String::from("Calendar Demo"))
let title = "Calendar Demo";
self.set_header_title(title.to_owned());

self.core
.main_window_id()
.map(|window_id| self.set_window_title(title.into(), window_id))
.unwrap_or_else(Task::none)
}
}
14 changes: 7 additions & 7 deletions examples/cosmic/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use cosmic::{
ThemeBuilder,
},
font::load_fonts,
iced::{self, Application, Length, Subscription, Task},
iced::{self, Length, Subscription, Task},
iced::{
subscription,
widget::{self, column, container, horizontal_space, row, text},
widget::{self, column, horizontal_space, row, text},
window::{self, close, drag, minimize, toggle_maximize},
},
iced_futures::event::listen_raw,
Expand All @@ -20,7 +20,7 @@ use cosmic::{
button, container, header_bar, icon, nav_bar, nav_bar_toggle, scrollable, segmented_button,
settings, warning,
},
Element,
Application, Element,
};
use cosmic_time::{Instant, Timeline};
use std::{
Expand Down Expand Up @@ -433,10 +433,10 @@ impl Application for Window {
Message::ToggleNavBarCondensed => {
self.nav_bar_toggled_condensed = !self.nav_bar_toggled_condensed
}
Message::Drag => return drag(self.core.main_window_id().unwrap()),
Message::Close => return close(self.core.main_window_id().unwrap()),
Message::Minimize => return minimize(self.core.main_window_id().unwrap(), true),
Message::Maximize => return toggle_maximize(self.core.main_window_id().unwrap()),
Message::Drag => return drag(self.core().main_window_id().unwrap()),
Message::Close => return close(self.core().main_window_id().unwrap()),
Message::Minimize => return minimize(self.core().main_window_id().unwrap(), true),
Message::Maximize => return toggle_maximize(self.core().main_window_id().unwrap()),

Message::InputChanged => {}

Expand Down
8 changes: 6 additions & 2 deletions examples/image-button/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ where
Self: cosmic::Application,
{
fn update_title(&mut self) -> Task<Message> {
self.set_header_title(String::from("Image Button Demo"));
self.set_window_title(String::from("Image Button Demo"))
let title = "Image Button Demo";
self.set_header_title(title.into());
self.core
.main_window_id()
.map(|window_id| self.set_window_title(title.into(), window_id))
.unwrap_or_else(Task::none)
}
}
5 changes: 4 additions & 1 deletion examples/text-input/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ where
fn update_title(&mut self) -> Task<Message> {
let window_title = format!("COSMIC TextInputs Demo");
self.set_header_title(window_title.clone());
self.set_window_title(window_title)
self.core
.main_window_id()
.map(|window_id| self.set_window_title(window_title, window_id))
.unwrap_or_else(Task::none)
}
}
1 change: 1 addition & 0 deletions src/desktop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub trait IconSourceExt {
fn as_cosmic_icon(&self) -> crate::widget::icon::Icon;
}

#[cfg(not(windows))]
impl IconSourceExt for fde::IconSource {
fn as_cosmic_icon(&self) -> crate::widget::icon::Icon {
match self {
Expand Down