diff options
author | 2024-02-13 04:49:27 +0100 | |
---|---|---|
committer | 2024-02-13 04:52:13 +0100 | |
commit | f1c5186e79cdcc8730df7e557ef8480a10a8330d (patch) | |
tree | a3a410b8ce02c8072e6d60e2f530ddc9c23e28b5 /runtime | |
parent | f93a6d740ac4cb09720bcb502b04e9a3d993bdba (diff) | |
download | iced-f1c5186e79cdcc8730df7e557ef8480a10a8330d.tar.gz iced-f1c5186e79cdcc8730df7e557ef8480a10a8330d.tar.bz2 iced-f1c5186e79cdcc8730df7e557ef8480a10a8330d.zip |
Rename `show_window_menu` to `show_system_menu`
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/src/window.rs | 8 | ||||
-rw-r--r-- | runtime/src/window/action.rs | 10 |
2 files changed, 10 insertions, 8 deletions
diff --git a/runtime/src/window.rs b/runtime/src/window.rs index 44b707b2..04bcfcd8 100644 --- a/runtime/src/window.rs +++ b/runtime/src/window.rs @@ -160,9 +160,11 @@ pub fn change_level<Message>(id: Id, level: Level) -> Command<Message> { Command::single(command::Action::Window(Action::ChangeLevel(id, level))) } -/// Show window menu at cursor position. -pub fn show_window_menu<Message>(id: Id) -> Command<Message> { - Command::single(command::Action::Window(Action::ShowWindowMenu(id))) +/// Show the [system menu] at cursor position. +/// +/// [system menu]: https://en.wikipedia.org/wiki/Common_menus_in_Microsoft_Windows#System_menu +pub fn show_system_menu<Message>(id: Id) -> Command<Message> { + Command::single(command::Action::Window(Action::ShowSystemMenu(id))) } /// Fetches an identifier unique to the window, provided by the underlying windowing system. This is diff --git a/runtime/src/window/action.rs b/runtime/src/window/action.rs index d5c8c370..9bfc2b62 100644 --- a/runtime/src/window/action.rs +++ b/runtime/src/window/action.rs @@ -81,11 +81,11 @@ pub enum Action<T> { GainFocus(Id), /// Change the window [`Level`]. ChangeLevel(Id, Level), - /// Show window menu at cursor position. + /// Show the system menu at cursor position. /// /// ## Platform-specific /// Android / iOS / macOS / Orbital / Web / X11: Unsupported. - ShowWindowMenu(Id), + ShowSystemMenu(Id), /// Fetch the raw identifier unique to the window. FetchId(Id, Box<dyn FnOnce(u64) -> T + 'static>), /// Change the window [`Icon`]. @@ -146,7 +146,7 @@ impl<T> Action<T> { } Self::GainFocus(id) => Action::GainFocus(id), Self::ChangeLevel(id, level) => Action::ChangeLevel(id, level), - Self::ShowWindowMenu(id) => Action::ShowWindowMenu(id), + Self::ShowSystemMenu(id) => Action::ShowSystemMenu(id), Self::FetchId(id, o) => { Action::FetchId(id, Box::new(move |s| f(o(s)))) } @@ -206,8 +206,8 @@ impl<T> fmt::Debug for Action<T> { Self::ChangeLevel(id, level) => { write!(f, "Action::ChangeLevel({id:?}, {level:?})") } - Self::ShowWindowMenu(id) => { - write!(f, "Action::ShowWindowMenu({id:?})") + Self::ShowSystemMenu(id) => { + write!(f, "Action::ShowSystemMenu({id:?})") } Self::FetchId(id, _) => write!(f, "Action::FetchId({id:?})"), Self::ChangeIcon(id, _icon) => { |