Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Widget::update; use input data #396

Merged
merged 93 commits into from
Jul 27, 2023
Merged

Add Widget::update; use input data #396

merged 93 commits into from
Jul 27, 2023

Conversation

dhardy
Copy link
Collaborator

@dhardy dhardy commented Jul 10, 2023

This builds on #395, making use of input data.

Significant changes:

  • Add Action::EVENT_CONFIG, Action::UPDATE; remove Action::EMPTY
  • Add Events::update, fn EventState::request_update; call from configure and ConfigMgr::update; remove data from Events::configure; remove Event::Update
  • Basic support for limiting recursion of updates with fn ConfigMgr::restrict_recursion_to
  • Rename Events::handle_messageEvents::handle_messages
  • Alternative (now default) implementation of Node/NodeMut using dyn traits instead of unsafe
  • Add Node::for_child, for_children, for_children_try, for_path
  • Add ErasedStack and ability to send messages via the proxy
  • Alternative configuration tweaking mechanism: fn EventState::change_config and configuration widget
  • Move all of kas::model to kas-view; revise data traits, Driver trait, list filter mechanism; remove SingleView and revise ListData and MatrixData to use input data
  • New widgets: Adapt, Map, OnUpdate
  • Revise widget library to input data; revise EditGuard and impls
  • Update examples to use input data; async-event is re-written, sync-counter more complex (global + per-window state), several are significantly shorter (especially counter, calculator, times-tables); others like clock and cursors and not affected much.

Overall the "input data" approach remains very performant, provides a more complete and integrated experience to ListView / MatrixView, and allows significantly less boilerplate in many example UIs.

There remain a few less-than-ideal items: inability to pass messages to children (e.g. the Gallery's filter list copies both selection mode and filter string to data since this is currently the only provided method of passing data to children); menus possibly need a redesign.

dhardy added 25 commits July 27, 2023 10:47
The models are no longer used by any other part of Kas
This is now independent of kas-view code.
There are a few issues to be resolved in the following commits
Since the view size is small we can just update all visible
children, in-line with the previous commit's new policy.
@dhardy dhardy changed the title Add Adapt, Widget::update; examples/counter and sync-counter use input data Add Widget::update; use input data Jul 27, 2023
or-fun-call lint is not really useful without being able to
tell which functions may be inlined.
@dhardy dhardy merged commit d73d0b3 into master Jul 27, 2023
5 checks passed
@dhardy
Copy link
Collaborator Author

dhardy commented Jul 27, 2023

Design document (belatedly) posted: kas-gui/design#6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant