mirror of
https://github.com/danbulant/cushy
synced 2026-06-14 12:01:13 +00:00
parent
48133cdac3
commit
459dc3f96a
3 changed files with 16 additions and 10 deletions
|
|
@ -19,6 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- `Source::for_each_*` now invoke the callback with the current contents of of
|
||||
the source before attaching the callback. New functions beginning with
|
||||
`for_each_subsequent_` have been added with the original behavior.
|
||||
- `CushyWindowBuilder` has been renamed to `StandaloneWindowBuilder` and
|
||||
`MakeWidget::build_virtual_window` has been renamed to
|
||||
`build_standalone_window`.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ use crate::widgets::{
|
|||
};
|
||||
use crate::window::sealed::WindowCommand;
|
||||
use crate::window::{
|
||||
CushyWindowBuilder, DeviceId, KeyEvent, Rgb8, RunningWindow, ThemeMode, VirtualRecorderBuilder,
|
||||
Window, WindowBehavior, WindowHandle, WindowLocal,
|
||||
DeviceId, KeyEvent, Rgb8, RunningWindow, StandaloneWindowBuilder, ThemeMode,
|
||||
VirtualRecorderBuilder, Window, WindowBehavior, WindowHandle, WindowLocal,
|
||||
};
|
||||
use crate::ConstraintLimit;
|
||||
|
||||
|
|
@ -919,10 +919,13 @@ pub trait MakeWidget: Sized {
|
|||
Window::new(self.make_widget())
|
||||
}
|
||||
|
||||
/// Returns a builder for a [`VirtualWindow`](crate::window::VirtualWindow)
|
||||
/// or a [`CushyWindow`](crate::window::CushyWindow).
|
||||
fn build_virtual_window(self) -> CushyWindowBuilder {
|
||||
CushyWindowBuilder::new(self)
|
||||
/// Returns a builder for a standalone window.
|
||||
///
|
||||
/// A standalone window can be either a
|
||||
/// [`VirtualWindow`](crate::window::VirtualWindow) or a
|
||||
/// [`CushyWindow`](crate::window::CushyWindow).
|
||||
fn build_standalone_window(self) -> StandaloneWindowBuilder {
|
||||
StandaloneWindowBuilder::new(self)
|
||||
}
|
||||
|
||||
/// Returns a builder for a [`VirtualRecorder`](crate::window::VirtualRecorder)
|
||||
|
|
|
|||
|
|
@ -2570,8 +2570,8 @@ impl PlatformWindowImplementation for &mut VirtualState {
|
|||
}
|
||||
}
|
||||
|
||||
/// A builder for a [`VirtualWindow`] or a [`CushyWindow`].
|
||||
pub struct CushyWindowBuilder {
|
||||
/// A builder that creates either a [`VirtualWindow`] or a [`CushyWindow`].
|
||||
pub struct StandaloneWindowBuilder {
|
||||
widget: WidgetInstance,
|
||||
multisample_count: NonZeroU32,
|
||||
initial_size: Size<UPx>,
|
||||
|
|
@ -2580,7 +2580,7 @@ pub struct CushyWindowBuilder {
|
|||
zoom: Dynamic<Fraction>,
|
||||
}
|
||||
|
||||
impl CushyWindowBuilder {
|
||||
impl StandaloneWindowBuilder {
|
||||
/// Returns a new builder for a standalone window that contains `contents`.
|
||||
#[must_use]
|
||||
pub fn new(contents: impl MakeWidget) -> Self {
|
||||
|
|
@ -3375,7 +3375,7 @@ where
|
|||
))?;
|
||||
|
||||
let window = contents
|
||||
.build_virtual_window()
|
||||
.build_standalone_window()
|
||||
.size(size)
|
||||
.scale(scale)
|
||||
.transparent()
|
||||
|
|
|
|||
Loading…
Reference in a new issue