[go: up one dir, main page]

redo

Function redo 

Source
pub fn redo<T: Data>() -> MenuItem<T>
Expand description

The ‘Redo’ menu item.

Examples found in repository?
examples/textbox.rs (line 113)
95fn make_menu<T: Data>(_window: Option<WindowId>, _data: &AppState, _env: &Env) -> Menu<T> {
96    let mut base = Menu::empty();
97    #[cfg(target_os = "macos")]
98    {
99        base = base.entry(druid::platform_menus::mac::application::default())
100    }
101    #[cfg(any(
102        target_os = "windows",
103        target_os = "freebsd",
104        target_os = "linux",
105        target_os = "openbsd"
106    ))]
107    {
108        base = base.entry(druid::platform_menus::win::file::default());
109    }
110    base.entry(
111        Menu::new(LocalizedString::new("common-menu-edit-menu"))
112            .entry(druid::platform_menus::common::undo())
113            .entry(druid::platform_menus::common::redo())
114            .separator()
115            .entry(druid::platform_menus::common::cut())
116            .entry(druid::platform_menus::common::copy())
117            .entry(druid::platform_menus::common::paste()),
118    )
119}
More examples
Hide additional examples
examples/markdown_preview.rs (line 254)
236fn make_menu<T: Data>(_window_id: Option<WindowId>, _app_state: &AppState, _env: &Env) -> Menu<T> {
237    let mut base = Menu::empty();
238    #[cfg(target_os = "macos")]
239    {
240        base = base.entry(druid::platform_menus::mac::application::default())
241    }
242    #[cfg(any(
243        target_os = "windows",
244        target_os = "freebsd",
245        target_os = "linux",
246        target_os = "openbsd"
247    ))]
248    {
249        base = base.entry(druid::platform_menus::win::file::default());
250    }
251    base.entry(
252        Menu::new(LocalizedString::new("common-menu-edit-menu"))
253            .entry(druid::platform_menus::common::undo())
254            .entry(druid::platform_menus::common::redo())
255            .separator()
256            .entry(druid::platform_menus::common::cut().enabled(false))
257            .entry(druid::platform_menus::common::copy())
258            .entry(druid::platform_menus::common::paste()),
259    )
260}