Open amrbashir opened 2 years ago
I think it is a valid use-case to only constrain the window width or height.
I think an implementation of this would be similar to LogicalSize and PhysicalSize
LogicalSize
PhysicalSize
I couldn't think of a better names so these are subject to change ofc #[derive(Debug, Copy, Clone, Eq, PartialEq, Default, Hash)] struct LogicalUnit<P>(P); // conversion methods similar to `LogicalSize`
I couldn't think of a better names so these are subject to change ofc
#[derive(Debug, Copy, Clone, Eq, PartialEq, Default, Hash)] struct LogicalUnit<P>(P); // conversion methods similar to `LogicalSize`
struct PhysicalUnit
(P); // conversion methods similar to PhysicalSize
enum Unit { Physical(PhysicalUnit), Logical(LogicalUnit), } // conversion methods similar to Size
Size
impl WindowBuilder { fn with_max_inner_size<S: Into>(width: Option, height: Option); }
The implementation could build upon https://github.com/rust-windowing/winit/pull/2148
I think it is a valid use-case to only constrain the window width or height.
I think an implementation of this would be similar to
LogicalSize
andPhysicalSize
[derive(Debug, Copy, Clone, Eq, PartialEq, Default, Hash)]
struct PhysicalUnit
(P); // conversion methods similar to
PhysicalSize
[derive(Debug, Copy, Clone, PartialEq)]
enum Unit { Physical(PhysicalUnit),
Logical(LogicalUnit),
}
// conversion methods similar to
Size
impl WindowBuilder { fn with_max_inner_size<S: Into>(width: Option, height: Option);
}