mirror of
https://github.com/danbulant/cushy
synced 2026-07-05 11:10:34 +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
|
- `Source::for_each_*` now invoke the callback with the current contents of of
|
||||||
the source before attaching the callback. New functions beginning with
|
the source before attaching the callback. New functions beginning with
|
||||||
`for_each_subsequent_` have been added with the original behavior.
|
`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
|
### Fixed
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ use crate::widgets::{
|
||||||
};
|
};
|
||||||
use crate::window::sealed::WindowCommand;
|
use crate::window::sealed::WindowCommand;
|
||||||
use crate::window::{
|
use crate::window::{
|
||||||
CushyWindowBuilder, DeviceId, KeyEvent, Rgb8, RunningWindow, ThemeMode, VirtualRecorderBuilder,
|
DeviceId, KeyEvent, Rgb8, RunningWindow, StandaloneWindowBuilder, ThemeMode,
|
||||||
Window, WindowBehavior, WindowHandle, WindowLocal,
|
VirtualRecorderBuilder, Window, WindowBehavior, WindowHandle, WindowLocal,
|
||||||
};
|
};
|
||||||
use crate::ConstraintLimit;
|
use crate::ConstraintLimit;
|
||||||
|
|
||||||
|
|
@ -919,10 +919,13 @@ pub trait MakeWidget: Sized {
|
||||||
Window::new(self.make_widget())
|
Window::new(self.make_widget())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a builder for a [`VirtualWindow`](crate::window::VirtualWindow)
|
/// Returns a builder for a standalone window.
|
||||||
/// or a [`CushyWindow`](crate::window::CushyWindow).
|
///
|
||||||
fn build_virtual_window(self) -> CushyWindowBuilder {
|
/// A standalone window can be either a
|
||||||
CushyWindowBuilder::new(self)
|
/// [`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)
|
/// 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`].
|
/// A builder that creates either a [`VirtualWindow`] or a [`CushyWindow`].
|
||||||
pub struct CushyWindowBuilder {
|
pub struct StandaloneWindowBuilder {
|
||||||
widget: WidgetInstance,
|
widget: WidgetInstance,
|
||||||
multisample_count: NonZeroU32,
|
multisample_count: NonZeroU32,
|
||||||
initial_size: Size<UPx>,
|
initial_size: Size<UPx>,
|
||||||
|
|
@ -2580,7 +2580,7 @@ pub struct CushyWindowBuilder {
|
||||||
zoom: Dynamic<Fraction>,
|
zoom: Dynamic<Fraction>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CushyWindowBuilder {
|
impl StandaloneWindowBuilder {
|
||||||
/// Returns a new builder for a standalone window that contains `contents`.
|
/// Returns a new builder for a standalone window that contains `contents`.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn new(contents: impl MakeWidget) -> Self {
|
pub fn new(contents: impl MakeWidget) -> Self {
|
||||||
|
|
@ -3375,7 +3375,7 @@ where
|
||||||
))?;
|
))?;
|
||||||
|
|
||||||
let window = contents
|
let window = contents
|
||||||
.build_virtual_window()
|
.build_standalone_window()
|
||||||
.size(size)
|
.size(size)
|
||||||
.scale(scale)
|
.scale(scale)
|
||||||
.transparent()
|
.transparent()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue