Skip to content

Commit cb258b6

Browse files
committed
Add window() accessor to EditorHandle
1 parent 8fa02f7 commit cb258b6

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

plugin-canvas-slint/src/editor.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ pub struct EditorHandle {
7272
}
7373

7474
impl EditorHandle {
75+
pub fn window(&self) -> Option<&plugin_canvas::Window> {
76+
self.window_adapter()
77+
.map(|window_adapter| window_adapter.plugin_canvas_window())
78+
}
79+
7580
pub fn on_frame(&self) {
7681
self.on_event(&Event::Draw);
7782
}

plugin-canvas-slint/src/window_adapter.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ impl PluginCanvasWindowAdapter {
291291
}
292292
}
293293

294+
pub(crate) fn plugin_canvas_window(&self) -> &plugin_canvas::Window {
295+
&self.plugin_canvas_window
296+
}
297+
294298
fn convert_button(button: &plugin_canvas::MouseButton) -> i_slint_core::platform::PointerEventButton {
295299
match button {
296300
plugin_canvas::MouseButton::Left => i_slint_core::platform::PointerEventButton::Left,

0 commit comments

Comments
 (0)