diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index 5e4a5a349..02c0bf908 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -262,7 +262,7 @@ "type": "boolean" }, "x": { - "description": "The horizontal position of the window's top left corner", + "description": "The horizontal position of the window's top left corner in logical pixels", "type": [ "number", "null" @@ -270,7 +270,7 @@ "format": "double" }, "y": { - "description": "The vertical position of the window's top left corner", + "description": "The vertical position of the window's top left corner in logical pixels", "type": [ "number", "null" @@ -278,19 +278,19 @@ "format": "double" }, "width": { - "description": "The window width.", + "description": "The window width in logical pixels.", "default": 800.0, "type": "number", "format": "double" }, "height": { - "description": "The window height.", + "description": "The window height in logical pixels.", "default": 600.0, "type": "number", "format": "double" }, "minWidth": { - "description": "The min window width.", + "description": "The min window width in logical pixels.", "type": [ "number", "null" @@ -298,7 +298,7 @@ "format": "double" }, "minHeight": { - "description": "The min window height.", + "description": "The min window height in logical pixels.", "type": [ "number", "null" @@ -306,7 +306,7 @@ "format": "double" }, "maxWidth": { - "description": "The max window width.", + "description": "The max window width in logical pixels.", "type": [ "number", "null" @@ -314,7 +314,7 @@ "format": "double" }, "maxHeight": { - "description": "The max window height.", + "description": "The max window height in logical pixels.", "type": [ "number", "null" @@ -652,13 +652,13 @@ ], "properties": { "width": { - "description": "Horizontal margin in physical unit", + "description": "Horizontal margin in physical pixels", "type": "integer", "format": "uint32", "minimum": 0.0 }, "height": { - "description": "Vertical margin in physical unit", + "description": "Vertical margin in physical pixels", "type": "integer", "format": "uint32", "minimum": 0.0 diff --git a/crates/tauri-runtime/src/window.rs b/crates/tauri-runtime/src/window.rs index cdda26883..652832c1e 100644 --- a/crates/tauri-runtime/src/window.rs +++ b/crates/tauri-runtime/src/window.rs @@ -247,19 +247,19 @@ pub trait WindowBuilder: WindowBuilderBase { #[must_use] fn center(self) -> Self; - /// The initial position of the window's. + /// The initial position of the window in logical pixels. #[must_use] fn position(self, x: f64, y: f64) -> Self; - /// Window size. + /// Window size in logical pixels. #[must_use] fn inner_size(self, width: f64, height: f64) -> Self; - /// Window min inner size. + /// Window min inner size in logical pixels. #[must_use] fn min_inner_size(self, min_width: f64, min_height: f64) -> Self; - /// Window max inner size. + /// Window max inner size in logical pixels. #[must_use] fn max_inner_size(self, max_width: f64, max_height: f64) -> Self; diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index 5e4a5a349..02c0bf908 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -262,7 +262,7 @@ "type": "boolean" }, "x": { - "description": "The horizontal position of the window's top left corner", + "description": "The horizontal position of the window's top left corner in logical pixels", "type": [ "number", "null" @@ -270,7 +270,7 @@ "format": "double" }, "y": { - "description": "The vertical position of the window's top left corner", + "description": "The vertical position of the window's top left corner in logical pixels", "type": [ "number", "null" @@ -278,19 +278,19 @@ "format": "double" }, "width": { - "description": "The window width.", + "description": "The window width in logical pixels.", "default": 800.0, "type": "number", "format": "double" }, "height": { - "description": "The window height.", + "description": "The window height in logical pixels.", "default": 600.0, "type": "number", "format": "double" }, "minWidth": { - "description": "The min window width.", + "description": "The min window width in logical pixels.", "type": [ "number", "null" @@ -298,7 +298,7 @@ "format": "double" }, "minHeight": { - "description": "The min window height.", + "description": "The min window height in logical pixels.", "type": [ "number", "null" @@ -306,7 +306,7 @@ "format": "double" }, "maxWidth": { - "description": "The max window width.", + "description": "The max window width in logical pixels.", "type": [ "number", "null" @@ -314,7 +314,7 @@ "format": "double" }, "maxHeight": { - "description": "The max window height.", + "description": "The max window height in logical pixels.", "type": [ "number", "null" @@ -652,13 +652,13 @@ ], "properties": { "width": { - "description": "Horizontal margin in physical unit", + "description": "Horizontal margin in physical pixels", "type": "integer", "format": "uint32", "minimum": 0.0 }, "height": { - "description": "Vertical margin in physical unit", + "description": "Vertical margin in physical pixels", "type": "integer", "format": "uint32", "minimum": 0.0 diff --git a/crates/tauri-utils/src/config.rs b/crates/tauri-utils/src/config.rs index 2c1b6938e..ada9041a6 100644 --- a/crates/tauri-utils/src/config.rs +++ b/crates/tauri-utils/src/config.rs @@ -1593,9 +1593,9 @@ pub struct WindowEffectsConfig { #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct PreventOverflowMargin { - /// Horizontal margin in physical unit + /// Horizontal margin in physical pixels pub width: u32, - /// Vertical margin in physical unit + /// Vertical margin in physical pixels pub height: u32, } @@ -1673,26 +1673,26 @@ pub struct WindowConfig { /// Whether or not the window starts centered or not. #[serde(default)] pub center: bool, - /// The horizontal position of the window's top left corner + /// The horizontal position of the window's top left corner in logical pixels pub x: Option, - /// The vertical position of the window's top left corner + /// The vertical position of the window's top left corner in logical pixels pub y: Option, - /// The window width. + /// The window width in logical pixels. #[serde(default = "default_width")] pub width: f64, - /// The window height. + /// The window height in logical pixels. #[serde(default = "default_height")] pub height: f64, - /// The min window width. + /// The min window width in logical pixels. #[serde(alias = "min-width")] pub min_width: Option, - /// The min window height. + /// The min window height in logical pixels. #[serde(alias = "min-height")] pub min_height: Option, - /// The max window width. + /// The max window width in logical pixels. #[serde(alias = "max-width")] pub max_width: Option, - /// The max window height. + /// The max window height in logical pixels. #[serde(alias = "max-height")] pub max_height: Option, /// Whether or not to prevent the window from overflowing the workarea diff --git a/crates/tauri/src/webview/webview_window.rs b/crates/tauri/src/webview/webview_window.rs index 24232993a..f3c8665c3 100644 --- a/crates/tauri/src/webview/webview_window.rs +++ b/crates/tauri/src/webview/webview_window.rs @@ -465,28 +465,28 @@ impl<'a, R: Runtime, M: Manager> WebviewWindowBuilder<'a, R, M> { self } - /// The initial position of the window's. + /// The initial position of the window in logical pixels. #[must_use] pub fn position(mut self, x: f64, y: f64) -> Self { self.window_builder = self.window_builder.position(x, y); self } - /// Window size. + /// Window size in logical pixels. #[must_use] pub fn inner_size(mut self, width: f64, height: f64) -> Self { self.window_builder = self.window_builder.inner_size(width, height); self } - /// Window min inner size. + /// Window min inner size in logical pixels. #[must_use] pub fn min_inner_size(mut self, min_width: f64, min_height: f64) -> Self { self.window_builder = self.window_builder.min_inner_size(min_width, min_height); self } - /// Window max inner size. + /// Window max inner size in logical pixels. #[must_use] pub fn max_inner_size(mut self, max_width: f64, max_height: f64) -> Self { self.window_builder = self.window_builder.max_inner_size(max_width, max_height); diff --git a/crates/tauri/src/window/mod.rs b/crates/tauri/src/window/mod.rs index 9e74e694b..a67784cc3 100644 --- a/crates/tauri/src/window/mod.rs +++ b/crates/tauri/src/window/mod.rs @@ -443,28 +443,28 @@ impl<'a, R: Runtime, M: Manager> WindowBuilder<'a, R, M> { self } - /// The initial position of the window's. + /// The initial position of the window in logical pixels. #[must_use] pub fn position(mut self, x: f64, y: f64) -> Self { self.window_builder = self.window_builder.position(x, y); self } - /// Window size. + /// Window size in logical pixels. #[must_use] pub fn inner_size(mut self, width: f64, height: f64) -> Self { self.window_builder = self.window_builder.inner_size(width, height); self } - /// Window min inner size. + /// Window min inner size in logical pixels. #[must_use] pub fn min_inner_size(mut self, min_width: f64, min_height: f64) -> Self { self.window_builder = self.window_builder.min_inner_size(min_width, min_height); self } - /// Window max inner size. + /// Window max inner size in logical pixels. #[must_use] pub fn max_inner_size(mut self, max_width: f64, max_height: f64) -> Self { self.window_builder = self.window_builder.max_inner_size(max_width, max_height); diff --git a/packages/api/src/webview.ts b/packages/api/src/webview.ts index cf78dffe6..47a497fb6 100644 --- a/packages/api/src/webview.ts +++ b/packages/api/src/webview.ts @@ -714,13 +714,13 @@ interface WebviewOptions { * - local file path or route such as `/path/to/page.html` or `/users` is appended to the application URL (the devServer URL on development, or `tauri://localhost/` and `https://tauri.localhost/` on production). */ url?: string - /** The initial vertical position. */ + /** The initial vertical position in logical pixels. */ x: number - /** The initial horizontal position. */ + /** The initial horizontal position in logical pixels. */ y: number - /** The initial width. */ + /** The initial width in logical pixels. */ width: number - /** The initial height. */ + /** The initial height in logical pixels. */ height: number /** * Whether the webview is transparent or not. diff --git a/packages/api/src/window.ts b/packages/api/src/window.ts index 090108337..8a11d2cc3 100644 --- a/packages/api/src/window.ts +++ b/packages/api/src/window.ts @@ -2305,21 +2305,21 @@ interface PreventOverflowMargin { interface WindowOptions { /** Show window in the center of the screen.. */ center?: boolean - /** The initial vertical position. Only applies if `y` is also set. */ + /** The initial vertical position in logical pixels. Only applies if `y` is also set. */ x?: number - /** The initial horizontal position. Only applies if `x` is also set. */ + /** The initial horizontal position in logical pixels. Only applies if `x` is also set. */ y?: number - /** The initial width. */ + /** The initial width in logical pixels. */ width?: number - /** The initial height. */ + /** The initial height in logical pixels. */ height?: number - /** The minimum width. Only applies if `minHeight` is also set. */ + /** The minimum width in logical pixels. Only applies if `minHeight` is also set. */ minWidth?: number - /** The minimum height. Only applies if `minWidth` is also set. */ + /** The minimum height in logical pixels. Only applies if `minWidth` is also set. */ minHeight?: number - /** The maximum width. Only applies if `maxHeight` is also set. */ + /** The maximum width in logical pixels. Only applies if `maxHeight` is also set. */ maxWidth?: number - /** The maximum height. Only applies if `maxWidth` is also set. */ + /** The maximum height in logical pixels. Only applies if `maxWidth` is also set. */ maxHeight?: number /** * Prevent the window from overflowing the working area (e.g. monitor size - taskbar size)