add label method

This commit is contained in:
Jonas Kruckenberg 2022-11-03 18:52:57 +01:00
parent bc8818e695
commit 6af422ad37

View file

@ -131,6 +131,10 @@ impl WebviewWindow {
inner::WebviewWindow::getByLabel(label).map(Self)
}
pub fn label(&self) -> String {
self.0.label()
}
pub async fn scale_factor(&self) -> f64 {
self.0.scaleFactor().await.as_f64().unwrap()
}
@ -632,6 +636,8 @@ mod inner {
pub type WindowManager;
#[wasm_bindgen(constructor)]
pub fn new(label: &str) -> WindowManager;
#[wasm_bindgen(method, getter)]
pub fn label(this: &WindowManager) -> String;
#[wasm_bindgen(method)]
pub async fn scaleFactor(this: &WindowManager) -> JsValue;
#[wasm_bindgen(method)]