]> uap-core.de Git - note.git/commitdiff
remove unnecessary second UiObject impl block main
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Thu, 14 May 2026 18:28:53 +0000 (20:28 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Thu, 14 May 2026 18:28:53 +0000 (20:28 +0200)
ui-rs/src/ui/window.rs

index 6f70e0c6f91622585e91b88808a7759b17479804..cffd4d33a8d7c33f47a35f01d28121ab5023b653 100644 (file)
@@ -42,6 +42,24 @@ impl<T> toolkit::UiObject<T> {
             ui_show(self.ptr);
         }
     }
+
+    pub fn set_size(&mut self, width: u32, height: u32) {
+        unsafe {
+            ui_window_size(self.ptr, width as c_int, height as c_int);
+        }
+    }
+
+    pub fn set_menubar_visible(&mut self, visible: bool) {
+        unsafe {
+            ui_window_menubar_set_visible(self.ptr, visible as c_int);
+        }
+    }
+
+    pub fn enable_fullscreen(&mut self, fullscreen: bool) {
+        unsafe {
+            ui_window_fullscreen(self.ptr, fullscreen as c_int);
+        }
+    }
 }
 
 /* ---------------------------------- main windows ---------------------------------- */
@@ -101,25 +119,6 @@ where F: FnOnce(&mut toolkit::UiObject<T>, &mut T) {
     obj
 }
 
-impl<T> toolkit::UiObject<T> {
-    pub fn set_size(&mut self, width: u32, height: u32) {
-        unsafe {
-            ui_window_size(self.ptr, width as c_int, height as c_int);
-        }
-    }
-
-    pub fn set_menubar_visible(&mut self, visible: bool) {
-        unsafe {
-            ui_window_menubar_set_visible(self.ptr, visible as c_int);
-        }
-    }
-
-    pub fn enable_fullscreen(&mut self, fullscreen: bool) {
-        unsafe {
-            ui_window_fullscreen(self.ptr, fullscreen as c_int);
-        }
-    }
-}
 
 impl<T: UiModel + UiActions> AppContext<T> {
     pub fn window<F>(&self, title: &str, data: T, create_ui: F) -> toolkit::UiObject<T>