Browse Source

fix: change method name

mrxiaozhuox 3 years ago
parent
commit
30bb92f09a
1 changed files with 3 additions and 3 deletions
  1. 3 3
      packages/desktop/src/desktop_context.rs

+ 3 - 3
packages/desktop/src/desktop_context.rs

@@ -34,7 +34,7 @@ impl DesktopContext {
     /// ```rust
     /// ```rust
     /// onmousedown: move |_| { desktop.drag_window(); }
     /// onmousedown: move |_| { desktop.drag_window(); }
     /// ```
     /// ```
-    pub fn drag_window(&self) {
+    pub fn drag(&self) {
         let _ = self.proxy.send_event(UserWindowEvent::DragWindow);
         let _ = self.proxy.send_event(UserWindowEvent::DragWindow);
     }
     }
 
 
@@ -54,12 +54,12 @@ impl DesktopContext {
     }
     }
 
 
     /// close window
     /// close window
-    pub fn close_window(&self) {
+    pub fn close(&self) {
         let _ = self.proxy.send_event(UserWindowEvent::CloseWindow);
         let _ = self.proxy.send_event(UserWindowEvent::CloseWindow);
     }
     }
 
 
     /// set window to focus
     /// set window to focus
-    pub fn set_focus(&self) {
+    pub fn focus(&self) {
         let _ = self.proxy.send_event(UserWindowEvent::FocusWindow);
         let _ = self.proxy.send_event(UserWindowEvent::FocusWindow);
     }
     }