parent
5a33512cc3
commit
9b28a4a076
|
@ -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
|
||||
* Mnemonics.
|
|
@ -1,3 +1,3 @@
|
|||
# Html Widget TODO
|
||||
|
||||
* Implement an widget that renders static HTML, good enough to render e-books.
|
||||
* Implement a widget that renders static HTML, good enough to render e-books.
|
|
@ -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.
|
||||
|
|
|
@ -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).
|
||||
|
|
|
@ -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`.
|
||||
|
|
|
@ -645,7 +645,7 @@ pub fn corner_radius_fit(child: impl UiNode, fit: impl IntoVar<CornerRadiusFit>)
|
|||
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<FactorSideOffsets>)
|
|||
}
|
||||
|
||||
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();
|
||||
|
|
|
@ -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.<property>` to reference to an widget property, the value resolves to the variable value of the first member of the property,
|
||||
/// Use `self.<property>` 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.
|
||||
///
|
||||
/// ```
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -332,7 +332,7 @@ impl<W: WidgetList> WidgetList for ZSortedWidgetList<W> {
|
|||
}
|
||||
}
|
||||
|
||||
/// 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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -686,7 +686,7 @@ pub fn interactive_node(child: impl UiNode, interactive: impl IntoVar<bool>) ->
|
|||
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)]
|
||||
|
|
|
@ -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<Rc<dyn Fn(&InteractivityFilterArgs) -> 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.
|
||||
///
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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<T>`] 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
|
||||
|
|
|
@ -78,7 +78,7 @@ pub fn margin(child: impl UiNode, margin: impl IntoVar<SideOffsets>) -> 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<Length>) -> 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`].
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<ImageErrorArgs>) -> impl UiNode {
|
||||
struct OnErrorNode<C, H> {
|
||||
|
@ -323,7 +323,7 @@ pub fn on_error(child: impl UiNode, handler: impl WidgetHandler<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_load(child: impl UiNode, handler: impl WidgetHandler<ImageLoadArgs>) -> impl UiNode {
|
||||
struct OnLoadNode<C, H> {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
///
|
||||
///
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
Loading…
Reference in New Issue