From 152d2c8b76795d3304c8cce853e2ac976ee58f5a Mon Sep 17 00:00:00 2001 From: Olaf Wintermann Date: Thu, 14 May 2026 20:28:53 +0200 Subject: [PATCH] remove unnecessary second UiObject impl block --- ui-rs/src/ui/window.rs | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/ui-rs/src/ui/window.rs b/ui-rs/src/ui/window.rs index 6f70e0c..cffd4d3 100644 --- a/ui-rs/src/ui/window.rs +++ b/ui-rs/src/ui/window.rs @@ -42,6 +42,24 @@ impl toolkit::UiObject { 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, &mut T) { obj } -impl toolkit::UiObject { - 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 AppContext { pub fn window(&self, title: &str, data: T, create_ui: F) -> toolkit::UiObject -- 2.47.3