mirror of
https://github.com/danbulant/cushy
synced 2026-06-14 20:11:04 +00:00
Clarified some window builder documentation
Really the functions should be renamed -- see #155
This commit is contained in:
parent
3da08bca62
commit
8c8dca63ba
4 changed files with 8 additions and 6 deletions
|
|
@ -11,8 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
### Fixed
|
||||
|
||||
- Fixed a panic that could occur when removing some deeply nested hierarchies
|
||||
from a window.
|
||||
- Fixed a panic that could occur when removing certain nested hierarchies from a
|
||||
window.
|
||||
|
||||
### Added
|
||||
|
||||
|
|
|
|||
|
|
@ -919,7 +919,8 @@ pub trait MakeWidget: Sized {
|
|||
Window::new(self.make_widget())
|
||||
}
|
||||
|
||||
/// Returns a builder for a [`VirtualWindow`](crate::window::VirtualWindow).
|
||||
/// Returns a builder for a [`VirtualWindow`](crate::window::VirtualWindow)
|
||||
/// or a [`CushyWindow`](crate::window::CushyWindow).
|
||||
fn build_virtual_window(self) -> CushyWindowBuilder {
|
||||
CushyWindowBuilder::new(self)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,8 @@ impl WrapperWidget for Switcher {
|
|||
available_space: Size<ConstraintLimit>,
|
||||
context: &mut LayoutContext<'_, '_, '_, '_>,
|
||||
) -> Size<ConstraintLimit> {
|
||||
if self.source.has_updated() {
|
||||
let current_source = self.source.get_tracking_invalidate(context);
|
||||
if ¤t_source != self.child.widget() {
|
||||
self.child.unmount_in(context);
|
||||
self.child = WidgetRef::new(self.source.get());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2474,7 +2474,7 @@ impl PlatformWindowImplementation for &mut VirtualState {
|
|||
}
|
||||
}
|
||||
|
||||
/// A builder for a [`VirtualWindow`].
|
||||
/// A builder for a [`VirtualWindow`] or a [`CushyWindow`].
|
||||
pub struct CushyWindowBuilder {
|
||||
widget: WidgetInstance,
|
||||
multisample_count: NonZeroU32,
|
||||
|
|
@ -2484,7 +2484,7 @@ pub struct CushyWindowBuilder {
|
|||
}
|
||||
|
||||
impl CushyWindowBuilder {
|
||||
/// Returns a new builder for a Cushy window that contains `contents`.
|
||||
/// Returns a new builder for a standalone window that contains `contents`.
|
||||
#[must_use]
|
||||
pub fn new(contents: impl MakeWidget) -> Self {
|
||||
Self {
|
||||
|
|
|
|||
Loading…
Reference in a new issue