mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
feat: expose some window props from runtime-wry (#13822)
* test: make some of window id + stores public * test: make window wrapper label pub * feat: make label accessible for windowwrapper * chore: adds wry runtime changefile * chore: avoid forced clone on label Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> --------- Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
This commit is contained in:
5
.changes/export-window-props-from-wry-runtime.md
Normal file
5
.changes/export-window-props-from-wry-runtime.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'tauri-runtime-wry': 'patch:changes'
|
||||
---
|
||||
|
||||
Makes some methods on `WindowIdStore`, `WindowsStore` and `WindowWrapper` public
|
||||
@@ -173,7 +173,7 @@ impl WindowIdStore {
|
||||
self.0.lock().unwrap().insert(w, id);
|
||||
}
|
||||
|
||||
fn get(&self, w: &TaoWindowId) -> Option<WindowId> {
|
||||
pub fn get(&self, w: &TaoWindowId) -> Option<WindowId> {
|
||||
self.0.lock().unwrap().get(w).copied()
|
||||
}
|
||||
}
|
||||
@@ -412,7 +412,7 @@ pub enum ActiveTracingSpan {
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct WindowsStore(RefCell<BTreeMap<WindowId, WindowWrapper>>);
|
||||
pub struct WindowsStore(pub RefCell<BTreeMap<WindowId, WindowWrapper>>);
|
||||
|
||||
// SAFETY: we ensure this type is only used on the main thread.
|
||||
#[allow(clippy::non_send_fields_in_send_ty)]
|
||||
@@ -2388,6 +2388,12 @@ pub struct WindowWrapper {
|
||||
focused_webview: Arc<Mutex<Option<String>>>,
|
||||
}
|
||||
|
||||
impl WindowWrapper {
|
||||
pub fn label(&self) -> &str {
|
||||
&self.label
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for WindowWrapper {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("WindowWrapper")
|
||||
|
||||
Reference in New Issue
Block a user