mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 12:24:16 +00:00
api: Change logical/physical position and size on window (#1620)
* Add `RequestedSize` and `RequestedPosition` enum to enable asking for logical or physical size/position. * Rename `Window::size()` to `Window::physical_size()` * Make `Window::set_size(...)` take an `Into<RequestedSize>` * Rename `Window::position()` to `Window::physical_position()` * Make `Window::set_position(...)` take an `Into<RequestedPosition>` * Change `WindowAdapter` and related classes to be able to handle requests being made in the either physical or logical units. Implement this for C++, Rust and node.
This commit is contained in:
parent
9bef6f519a
commit
53a3c72b57
11 changed files with 298 additions and 85 deletions
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace slint {
|
||||
|
||||
/// The Point structure is used to represent a two-dimensional point
|
||||
|
|
@ -26,4 +28,9 @@ template<typename T>
|
|||
using Point2D = Point<T>;
|
||||
}
|
||||
|
||||
/// A position in logical pixel coordinates
|
||||
using LogicalPosition = Point<float>;
|
||||
/// A position in physical pixel coordinates
|
||||
using PhysicalPosition = Point<int32_t>;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue