feat: add window api
This commit is contained in:
1 parent
6eaad850ee
commit
f28fb7165a
2 files changed
+30
-5
No files matched your search
@@ -321,12 +321,25 @@ pub fn launch_with_props<P: 'static + Send>(
|
||||
window.set_focus();
|
||||
}
|
||||
}
|
||||
UserWindowEvent::Title(content) => {
|
||||
|
||||
UserWindowEvent::SetTitle(content) => {
|
||||
for webview in desktop.webviews.values() {
|
||||
let window = webview.window();
|
||||
window.set_title(&content);
|
||||
}
|
||||
}
|
||||
UserWindowEvent::Resizable(state) => {
|
||||
for webview in desktop.webviews.values() {
|
||||
let window = webview.window();
|
||||
window.set_resizable(state);
|
||||
}
|
||||
}
|
||||
UserWindowEvent::HideMenu => {
|
||||
for webview in desktop.webviews.values() {
|
||||
let window = webview.window();
|
||||
window.hide_menu();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Event::MainEventsCleared => {}
|
||||
@@ -344,10 +357,12 @@ pub enum UserWindowEvent {
|
||||
DragWindow,
|
||||
CloseWindow,
|
||||
FocusWindow,
|
||||
|
||||
Title(String),
|
||||
Minimize(bool),
|
||||
Maximize(bool),
|
||||
Resizable(bool),
|
||||
|
||||
SetTitle(String),
|
||||
HideMenu,
|
||||
}
|
||||
|
||||
pub struct DesktopController {
|
||||
|
||||
Reference in new issue
Block a user