From 9b28a4a07647e4c114dc80a2cdee2465f8b63f9b Mon Sep 17 00:00:00 2001 From: Well Date: Fri, 24 Jun 2022 01:14:46 -0300 Subject: [PATCH] Removed outdated TODOs. Fixed typo. --- TODO/Focus.md | 6 +----- TODO/Html.md | 2 +- TODO/Scroll.md | 4 ++-- TODO/Variables.md | 7 ++----- TODO/_current.md | 4 ---- zero-ui-core/src/border.rs | 4 ++-- zero-ui-core/src/lib.rs | 4 ++-- zero-ui-core/src/tests/widget.rs | 2 +- zero-ui-core/src/ui_list/vec.rs | 4 ++-- zero-ui-core/src/ui_list/z_sorted.rs | 4 ++-- zero-ui-core/src/ui_node.rs | 2 +- zero-ui-core/src/var.rs | 2 +- zero-ui-core/src/widget_base.rs | 6 +++--- zero-ui-core/src/widget_info.rs | 6 +++--- zero-ui-core/src/window/types.rs | 2 +- zero-ui/src/lib.rs | 6 +++--- zero-ui/src/properties/layout.rs | 6 +++--- zero-ui/src/widgets/image_wgt/nodes.rs | 2 +- zero-ui/src/widgets/image_wgt/properties.rs | 4 ++-- zero-ui/src/widgets/layouts/stacks.rs | 4 ++-- zero-ui/src/widgets/layouts/uniform_grid_wgt.rs | 2 +- zero-ui/src/widgets/scroll_wgt/types.rs | 2 +- zero-ui/src/widgets/slot_wgt.rs | 2 +- 23 files changed, 38 insertions(+), 49 deletions(-) diff --git a/TODO/Focus.md b/TODO/Focus.md index 31c8dd88d..b54c1f241 100644 --- a/TODO/Focus.md +++ b/TODO/Focus.md @@ -3,8 +3,4 @@ * Restore focus from `modal` focus scope to button that opened it. * Support more than one ALT scopes. - Like the main-menu vs. a docked panel main tool-bar in Visual Studio. -* Mnemonics. - -## Icon Example - -* Focus moving twice when cycling from one of the icons \ No newline at end of file +* Mnemonics. \ No newline at end of file diff --git a/TODO/Html.md b/TODO/Html.md index 8180c4457..a4269a879 100644 --- a/TODO/Html.md +++ b/TODO/Html.md @@ -1,3 +1,3 @@ # Html Widget TODO -* Implement an widget that renders static HTML, good enough to render e-books. \ No newline at end of file +* Implement a widget that renders static HTML, good enough to render e-books. \ No newline at end of file diff --git a/TODO/Scroll.md b/TODO/Scroll.md index 1623236a7..fb288751b 100644 --- a/TODO/Scroll.md +++ b/TODO/Scroll.md @@ -4,9 +4,9 @@ - Test access to the scroll offset inside the content. * Test scroll to end when the height changes by scrolling. -* How this ties in with virtualization? Widgets that are only reserve layout space when not visible. +* How this ties in with virtualization? Widgets that only reserve layout space when not visible. -* Widgets may want to know what percentage of an widget is visible in the viewport, see flutter "slivers" concept. +* Widgets may want to know what percentage of a widget is visible in the viewport, see flutter "slivers" concept. * "Sliver" widgets may change size due to scrolling. * Touch scrolling. diff --git a/TODO/Variables.md b/TODO/Variables.md index c79968b40..d34d99e3b 100644 --- a/TODO/Variables.md +++ b/TODO/Variables.md @@ -1,8 +1,5 @@ # Variables TODO -* `Var::chase`, a transition animation that can update its final value, reset time. - - Make a `ChaseAnimationHandle` that can change the target value. - * Changes to enable [# Widget Property Transition]: - "Easing-map", a variable that eases between changes in a source variable, like a map that clones and transitions. - "Ease-switch", a `switch_var!` that eases between changes (probably just as good as an "easing-map"). @@ -15,7 +12,7 @@ # Widget Property Transition -* How do we define a transition that gets applied to an widget's property? +* How do we define a transition that gets applied to a widget's property? - Use a *fake* attribute, `#[ease(..)]`. * How do we apply the ease attribute? - Use the `ChaserVar` on the `switch_var!` just before passing it to the property? @@ -31,7 +28,7 @@ Attribute that configures the transition of a property changed by `when`. ```rust // in widget-decl properties! { - #[transition(150.ms(), easing::linear)]// ease applied in the when generated switch_var!. + #[transition(150.ms(), easing::linear)]// ease applied in the when-generated switch_var!. background_color = colors::RED; #[transition(150.ms(), easing::linear)]// ease applied to all switch_vars of this property, (error is not all transitionable). diff --git a/TODO/_current.md b/TODO/_current.md index 40164960f..29306bcd0 100644 --- a/TODO/_current.md +++ b/TODO/_current.md @@ -2,7 +2,3 @@ - The image example tries to do this manually, but there is some flickering due to Px rounding on the scroll vs on the offset. - CSS has the "position" property, that has sticky, webrender has something for this that we can use? - Current idea, have a `layout_parent = LayoutParent::Viewport`. - -* Focus, see `Focus.md`. -* Scrolling, see `Scrolling.md`. -* Animation, see `Variables.md`. diff --git a/zero-ui-core/src/border.rs b/zero-ui-core/src/border.rs index 22032b057..644c7e36f 100644 --- a/zero-ui-core/src/border.rs +++ b/zero-ui-core/src/border.rs @@ -645,7 +645,7 @@ pub fn corner_radius_fit(child: impl UiNode, fit: impl IntoVar) with_context_var(child, CornerRadiusFitVar, fit) } -/// Position of an widget borders in relation to the widget fill. +/// Position of a widget borders in relation to the widget fill. /// /// This property defines how much the widget's border offsets affect the layout of the fill content, by default /// (0%) the fill content stretchers *under* the borders and is clipped by the [`corner_radius`], in the other end @@ -664,7 +664,7 @@ pub fn border_align(child: impl UiNode, align: impl IntoVar) } context_var! { - /// How much an widget's border offsets affects the widget's fill content. + /// How much a widget's border offsets affects the widget's fill content. /// /// See [`border_align`](fn@border_align) for more details. pub struct BorderAlignVar: FactorSideOffsets = FactorSideOffsets::zero(); diff --git a/zero-ui-core/src/lib.rs b/zero-ui-core/src/lib.rs index f3bdf914a..ace58e318 100644 --- a/zero-ui-core/src/lib.rs +++ b/zero-ui-core/src/lib.rs @@ -391,7 +391,7 @@ pub use zero_ui_proc_macros::impl_ui_node; /// ## State Probing /// /// Properties with the `is_` prefix are special, they output information about the widget instead of shaping it. They are automatically set -/// to a new [`StateVar`] when used in an widget when condition expression. +/// to a new [`StateVar`] when used in a widget when condition expression. /// /// # Default /// @@ -793,7 +793,7 @@ pub use zero_ui_proc_macros::property; /// /// #### Reference Property /// -/// Use `self.` to reference to an widget property, the value resolves to the variable value of the first member of the property, +/// Use `self.` to reference to a widget property, the value resolves to the variable value of the first member of the property, /// if the property has a default value it does not need to be defined in the widget before usage. /// /// ``` diff --git a/zero-ui-core/src/tests/widget.rs b/zero-ui-core/src/tests/widget.rs index c2e735b68..516fea548 100644 --- a/zero-ui-core/src/tests/widget.rs +++ b/zero-ui-core/src/tests/widget.rs @@ -1617,7 +1617,7 @@ mod util { pub fn is_state(child: impl UiNode, state: StateVar) -> impl UiNode { IsStateNode { child, state } } - /// Sets the [`is_state`] of an widget. + /// Sets the [`is_state`] of a widget. /// /// Note only applies after update. pub fn set_state(ctx: &mut TestWidgetContext, wgt: &mut impl Widget, state: bool) { diff --git a/zero-ui-core/src/ui_list/vec.rs b/zero-ui-core/src/ui_list/vec.rs index 35389d002..dec961b50 100644 --- a/zero-ui-core/src/ui_list/vec.rs +++ b/zero-ui-core/src/ui_list/vec.rs @@ -634,7 +634,7 @@ impl WidgetVecRef { }) } - /// Request an widget remove and re-insert. + /// Request a widget remove and re-insert. /// /// If the `remove_index` is out of bounds nothing happens, if the `insert_index` is out-of-bounds /// the widget is pushed to the end of the vector, if `remove_index` and `insert_index` are equal nothing happens. @@ -650,7 +650,7 @@ impl WidgetVecRef { } } - /// Request an widget move, the widget is searched by `id`, if found `get_move_to` id called with the index of the widget and length + /// Request a widget move, the widget is searched by `id`, if found `get_move_to` id called with the index of the widget and length /// of the vector, it must return the index the widget is inserted after it is removed. /// /// If the widget is not found nothing happens, if the returned index is the same nothing happens, if the returned index diff --git a/zero-ui-core/src/ui_list/z_sorted.rs b/zero-ui-core/src/ui_list/z_sorted.rs index 2b89f4ef8..88fedfe95 100644 --- a/zero-ui-core/src/ui_list/z_sorted.rs +++ b/zero-ui-core/src/ui_list/z_sorted.rs @@ -332,7 +332,7 @@ impl WidgetList for ZSortedWidgetList { } } -/// Defines the render order of an widget in a layout panel. +/// Defines the render order of a widget in a layout panel. /// /// When set the widget will still update and layout according to their *logical* position in the list but /// they will render according to the order defined by the [`ZIndex`] value. @@ -530,7 +530,7 @@ pub trait WidgetListZIndexExt { /// [`init_all`]: UiNodeList::init_all fn init_all_z(&mut self, ctx: &mut WidgetContext, sort_z: &mut bool); - /// Does an [`update_all`], sets `resort_z` if the z-index changed for any widget or an widget was inited (inserted) with + /// Does an [`update_all`], sets `resort_z` if the z-index changed for any widget or a widget was inited (inserted) with /// a non-default index. /// /// Note that if the list is already sorting or has observed a non-default index it must also resort for any change diff --git a/zero-ui-core/src/ui_node.rs b/zero-ui-core/src/ui_node.rs index 5380ef223..795544b2f 100644 --- a/zero-ui-core/src/ui_node.rs +++ b/zero-ui-core/src/ui_node.rs @@ -719,7 +719,7 @@ macro_rules! declare_widget_test_calls { })+}; } -/// Represents an widget [`UiNode`]. +/// Represents a widget [`UiNode`]. #[cfg_attr(doc_nightly, doc(notable_trait))] pub trait Widget: UiNode { /// Id of the widget. diff --git a/zero-ui-core/src/var.rs b/zero-ui-core/src/var.rs index c807ab215..21dc6b94c 100644 --- a/zero-ui-core/src/var.rs +++ b/zero-ui-core/src/var.rs @@ -2474,7 +2474,7 @@ impl<'a, T: VarValue> DerefMut for VarModify<'a, T> { /// # Examples /// /// The example declares an `enum` that represents the values possible in a property `foo` and -/// then implements conversions from literals the user may want to type in an widget: +/// then implements conversions from literals the user may want to type in a widget: /// /// ``` /// # use zero_ui_core::var::impl_from_and_into_var; diff --git a/zero-ui-core/src/widget_base.rs b/zero-ui-core/src/widget_base.rs index 935593fa3..e7c55bb8d 100644 --- a/zero-ui-core/src/widget_base.rs +++ b/zero-ui-core/src/widget_base.rs @@ -686,7 +686,7 @@ pub fn interactive_node(child: impl UiNode, interactive: impl IntoVar) -> if self.interactive.copy(ctx) { self.child.info(ctx, info); } else if let Some(id) = self.child.try_id() { - // child is an widget. + // child is a widget. info.push_interactivity_filter(move |args| { if args.info.widget_id() == id { Interactivity::BLOCKED @@ -778,7 +778,7 @@ pub fn is_disabled(child: impl UiNode, state: StateVar) -> impl UiNode { /// widgets that don't render anything are considered `Hidden` even if the visibility property is not set, this property /// only forces the widget to layout and render according to the specified visibility. /// -/// To probe the visibility state of an widget in `when` clauses use [`is_visible`], [`is_hidden`] or [`is_collapsed`] in `when` clauses, +/// To probe the visibility state of a widget in `when` clauses use [`is_visible`], [`is_hidden`] or [`is_collapsed`] in `when` clauses, /// to probe a widget state use [`Widget::render_info`] or [`WidgetInfo::visibility`]. /// /// # Implicit @@ -896,7 +896,7 @@ pub fn is_collapsed(child: impl UiNode, state: StateVar) -> impl UiNode { visibility_eq_state(child, state, Visibility::Collapsed) } -/// Defines if and how an widget is hit-tested. +/// Defines if and how a widget is hit-tested. /// /// See [`hit_test_mode`](fn@hit_test_mode) for more details. #[derive(Copy, Clone, PartialEq, Eq)] diff --git a/zero-ui-core/src/widget_info.rs b/zero-ui-core/src/widget_info.rs index 03cb0804d..600ce5746 100644 --- a/zero-ui-core/src/widget_info.rs +++ b/zero-ui-core/src/widget_info.rs @@ -22,7 +22,7 @@ unique_id_64! { struct WidgetInfoTreeId; } -/// Represents the in-progress layout pass for an widget tree. +/// Represents the in-progress layout pass for a widget tree. pub struct WidgetLayout { t: WidgetLayoutTranslation, known_collapsed: bool, @@ -2421,7 +2421,7 @@ update_mask! { pub struct EventMask <- EventSlot; } -/// Represents all event and update subscriptions of an widget. +/// Represents all event and update subscriptions of a widget. /// /// Properties must register their interest in events and variables here otherwise a call to [`UiNode::event`] or /// [`UiNode::update`] can end-up skipped due to optimizations. @@ -2571,7 +2571,7 @@ impl<'a> InteractivityFilterArgs<'a> { type InteractivityFilters = Vec Interactivity>>; bitflags! { - /// Represents the level of interaction allowed for an widget. + /// Represents the level of interaction allowed for a widget. pub struct Interactivity: u8 { /// Normal interactions allowed. /// diff --git a/zero-ui-core/src/window/types.rs b/zero-ui-core/src/window/types.rs index 4b4e33d38..5f5612602 100644 --- a/zero-ui-core/src/window/types.rs +++ b/zero-ui-core/src/window/types.rs @@ -198,7 +198,7 @@ impl Window { /// New window from a `child` node that becomes the child of the window root widget. /// /// The `child` parameter is a node that is the window's content, if it is an [`Widget`] the `root_id` is the id of - /// an internal container widget that is the parent of `child`, if it is not an widget it will still be placed in the inner + /// an internal container widget that is the parent of `child`, if it is not a widget it will still be placed in the inner /// priority of the root widget. /// /// See [`new_root`] for other parameters. diff --git a/zero-ui/src/lib.rs b/zero-ui/src/lib.rs index 04b705eb8..fc75d1040 100644 --- a/zero-ui/src/lib.rs +++ b/zero-ui/src/lib.rs @@ -193,7 +193,7 @@ //! ``` //! //! Some property kinds can be identified using the prefix of their names, `on_foo` indicates that the property setups an event handler, -//! `is_foo` indicates a property that reports an widget state. +//! `is_foo` indicates a property that reports a widget state. //! //! ### Declaring Properties //! @@ -441,7 +441,7 @@ //! Early listeners can also use the [`EventArgs`] to signal later listeners that an event has been //! handled by calling [`propagation().stop()`]. //! -//! You usually don't setup an widget event handler directly, but instead use a property that does the message filtering and only +//! You usually don't setup a widget event handler directly, but instead use a property that does the message filtering and only //! calls your handler if the message is valid in the widget and not already handled. These *event properties* follow a common pattern, //! each is named with the `on_` prefix and each receive an [`WidgetHandler`] as input. The handler is essentially a closure that //! takes the [`WidgetContext`] and event arguments as input, the handler trait allows properties to receive both **mut** and **once** @@ -645,7 +645,7 @@ //! ``` //! //! The preview route is sometimes called *tunneling* or *capturing* and the main route is sometimes called *bubbling*. Not -//! all event properties exist in these two routes, some events are *direct*, meaning they exist in the scope of an widget only, +//! all event properties exist in these two routes, some events are *direct*, meaning they exist in the scope of a widget only, //! the preview handler is called and then the main handler, but only in the same widget. And finally some rare events are //! unfiltered and visible in all widgets, this is a *broadcast* event, each window receives the event, *oldest-first*, and in //! each window every widget receives the event, *depth-first*, the preview handlers in this case only preview their branch diff --git a/zero-ui/src/properties/layout.rs b/zero-ui/src/properties/layout.rs index 9269fd8a7..5df233636 100644 --- a/zero-ui/src/properties/layout.rs +++ b/zero-ui/src/properties/layout.rs @@ -78,7 +78,7 @@ pub fn margin(child: impl UiNode, margin: impl IntoVar) -> impl UiN } } -/// Margin space around the *content* of an widget. +/// Margin space around the *content* of a widget. /// /// This property is [`margin`](fn@margin) with priority `child_layout`. #[property(child_layout, default(0))] @@ -1062,7 +1062,7 @@ pub fn baseline(child: impl UiNode, baseline: impl IntoVar) -> impl UiNo .cfg_boxed() } -/// Defines how an widget layout translation is computed. +/// Defines how a widget layout translation is computed. /// /// See the [`position`] property for more details. /// @@ -1089,7 +1089,7 @@ impl Default for Position { } } -/// Defines how an widget translation is computed. +/// Defines how a widget translation is computed. /// /// Note that in all the position modes the widget affects the size of the parent and has the z-index the parent gives it, /// to fully remove the widget from the parent declare it in a layer instead, see [`WindowLayers`]. diff --git a/zero-ui/src/widgets/image_wgt/nodes.rs b/zero-ui/src/widgets/image_wgt/nodes.rs index 549179d39..6bb9bb198 100644 --- a/zero-ui/src/widgets/image_wgt/nodes.rs +++ b/zero-ui/src/widgets/image_wgt/nodes.rs @@ -23,7 +23,7 @@ context_var! { /// /// The image is not rendered by this property, the [`image_presenter`] renders the image in [`ContextImageVar`]. /// -/// In an widget this should be placed inside context properties and before event properties. +/// In a widget this should be placed inside context properties and before event properties. /// /// [`Images`]: crate::core::image::Images /// [`image_cache`]: mod@crate::widgets::image::properties::image_cache diff --git a/zero-ui/src/widgets/image_wgt/properties.rs b/zero-ui/src/widgets/image_wgt/properties.rs index 7558fb91a..e8e5afbe4 100644 --- a/zero-ui/src/widgets/image_wgt/properties.rs +++ b/zero-ui/src/widgets/image_wgt/properties.rs @@ -266,7 +266,7 @@ pub struct ImageErrorArgs { /// /// # Route /// -/// This property is not routed, it works only inside an widget that loads images. There is also no *preview* event. +/// This property is not routed, it works only inside a widget that loads images. There is also no *preview* event. #[property(event, default( hn!(|_, _|{}) ))] pub fn on_error(child: impl UiNode, handler: impl WidgetHandler) -> impl UiNode { struct OnErrorNode { @@ -323,7 +323,7 @@ pub fn on_error(child: impl UiNode, handler: impl WidgetHandler) /// /// # Route /// -/// This property is not routed, it works only inside an widget that loads images. There is also no *preview* event. +/// This property is not routed, it works only inside a widget that loads images. There is also no *preview* event. #[property(event, default( hn!(|_, _|{}) ))] pub fn on_load(child: impl UiNode, handler: impl WidgetHandler) -> impl UiNode { struct OnLoadNode { diff --git a/zero-ui/src/widgets/layouts/stacks.rs b/zero-ui/src/widgets/layouts/stacks.rs index 1dd92d3f0..c9b9bab4d 100644 --- a/zero-ui/src/widgets/layouts/stacks.rs +++ b/zero-ui/src/widgets/layouts/stacks.rs @@ -5,7 +5,7 @@ use crate::prelude::new_widget::*; /// # Z-Index /// /// By default the widgets are layout without overlap, but you can use properties like [`transform`] to cause -/// an widget overlap, in this case the widget will be rendered above its previous sibling and below its next sibling, +/// a widget overlap, in this case the widget will be rendered above its previous sibling and below its next sibling, /// you can change this by setting the [`z_index`] property in the item widget. /// /// # Examples @@ -252,7 +252,7 @@ pub mod h_stack { /// # Z-Index /// /// By default the widgets are layout without overlap, but you can use properties like [`transform`] to cause -/// an widget overlap, in this case the widget will be rendered above its previous sibling and below its next sibling, +/// a widget overlap, in this case the widget will be rendered above its previous sibling and below its next sibling, /// you can change this by setting the [`z_index`] property in the item widget. /// /// # Examples diff --git a/zero-ui/src/widgets/layouts/uniform_grid_wgt.rs b/zero-ui/src/widgets/layouts/uniform_grid_wgt.rs index f1d97a318..72e059270 100644 --- a/zero-ui/src/widgets/layouts/uniform_grid_wgt.rs +++ b/zero-ui/src/widgets/layouts/uniform_grid_wgt.rs @@ -5,7 +5,7 @@ use crate::prelude::new_widget::*; /// # Z-Index /// /// By default the widgets are layout without overlap, but you can use properties like [`transform`] to cause -/// an widget overlap, in this case the widget will be rendered above its previous sibling and below its next sibling, +/// a widget overlap, in this case the widget will be rendered above its previous sibling and below its next sibling, /// you can change this by setting the [`z_index`] property in the item widget. /// /// diff --git a/zero-ui/src/widgets/scroll_wgt/types.rs b/zero-ui/src/widgets/scroll_wgt/types.rs index 88d350efd..bf754f6a6 100644 --- a/zero-ui/src/widgets/scroll_wgt/types.rs +++ b/zero-ui/src/widgets/scroll_wgt/types.rs @@ -18,7 +18,7 @@ use zero_ui_core::var::animation::ChaseAnimation; use super::scroll::properties::SmoothScrollingVar; bitflags! { - /// What dimensions are scrollable in an widget. + /// What dimensions are scrollable in a widget. /// /// If a dimension is scrollable the content can be any size in that dimension, if the size /// is more then available scrolling is enabled for that dimension. diff --git a/zero-ui/src/widgets/slot_wgt.rs b/zero-ui/src/widgets/slot_wgt.rs index 44e1ffc79..d040bde44 100644 --- a/zero-ui/src/widgets/slot_wgt.rs +++ b/zero-ui/src/widgets/slot_wgt.rs @@ -5,7 +5,7 @@ use crate::prelude::new_widget::*; /// /// ## `slot()` /// -/// If you only want to create a slot as an widget there is a [`slot`](fn@slot) shortcut function. +/// If you only want to create a slot as a widget there is a [`slot`](fn@slot) shortcut function. #[widget($crate::widgets::slot)] pub mod slot {