summaryrefslogtreecommitdiffstats
path: root/winit/src/window.rs
diff options
context:
space:
mode:
authorLibravatar Night_Hunter <samuelhuntnz@gmail.com>2023-04-12 18:47:53 +1200
committerLibravatar GitHub <noreply@github.com>2023-04-12 06:47:53 +0000
commit5a056ce0510343621305474af74ade1db028c01a (patch)
tree424aa80f7151e594ebc5e38fb6445fa33e121ea1 /winit/src/window.rs
parente7549877ef396471df1509bce2b1d85243206022 (diff)
downloadiced-5a056ce0510343621305474af74ade1db028c01a.tar.gz
iced-5a056ce0510343621305474af74ade1db028c01a.tar.bz2
iced-5a056ce0510343621305474af74ade1db028c01a.zip
add action set icon while running (#1590)
* set windows icon live action * change get icon to insto raw * remove mobile docs * format * fix format * add file methods to Icon * Rename action to `ChangeIcon` and tidy up `Icon` modules * Fix documentation of `icon::Error` * Remove unnecessary `\` in `icon` documentation * Remove `etc.` from `Icon` documentation --------- Co-authored-by: Héctor Ramón Jiménez <hector0193@gmail.com>
Diffstat (limited to '')
-rw-r--r--winit/src/window.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/winit/src/window.rs b/winit/src/window.rs
index 961562bd..ba0180c8 100644
--- a/winit/src/window.rs
+++ b/winit/src/window.rs
@@ -2,7 +2,9 @@
use crate::command::{self, Command};
use iced_native::window;
-pub use window::{frames, Event, Mode, RedrawRequest, UserAttention};
+pub use window::{
+ frames, icon, Event, Icon, Mode, RedrawRequest, UserAttention,
+};
/// Closes the current window and exits the application.
pub fn close<Message>() -> Command<Message> {
@@ -104,3 +106,8 @@ pub fn fetch_id<Message>(
f,
))))
}
+
+/// Changes the [`Icon`] of the window.
+pub fn change_icon<Message>(icon: Icon) -> Command<Message> {
+ Command::single(command::Action::Window(window::Action::ChangeIcon(icon)))
+}