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:
Tobias Hunger 2022-09-13 08:55:31 +02:00 committed by GitHub
parent 9bef6f519a
commit 53a3c72b57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 298 additions and 85 deletions

View file

@ -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>;
}