-
Notifications
You must be signed in to change notification settings - Fork 25
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
Config editor; revise model traits, Spinner widget, SizeMgr::dpem, ... #334
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This avoids the need for macros to depend on kas_widgets Also: document macro syntax for implicit widgets in layout
…abs) Also: use L-inf metric in EventState::config_test_pan_thresh
Rationale: commit after next
Rationale: the Driver impl knows about the view widget and what messages it sends. The Data type doesn't.
Also: add NotifyGuard type Also: event handling for Driver impls over Edit* widgets
Also: add EventMgr::try_observe_msg
Also: add Toolkit::event_config
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The highlight of this PR is a new editor for event config:
The code for this in the gallery is tiny; essentially just:
Instead the editor implementation is an impl of
kas::widgets::view::driver::Driver
fordriver::DefaultView
, and thus easy to re-use.Quite a few other changes happened as part of this work:
kas_core::label::StrLabel
: a hidden simple label widget used for macro-generated implicit widgets from string literals (rationale: this feature is now usable withinkas_widgets
)Vec2::max_abs_comp
withmax_comp
(can be used withVec2::abs
)TkAction::EMPTY
Spinner
widget: bug-fix + cleaner codeSpinnerType
→SpinnerValue
andSliderType
→SliderValue
Slider
andSpinner
now have optional event-handling closures likeButton
,CheckBox
etc.Rc<RefCell<Config>>
withSharedRc<Config>
and update derived values when the shared value is updatedSharedRc
: addborrow
,try_borrow
,update_mut
methods (eventually these should move to theSharedData
trait but that requires GATs)SharedRc
: removeListData
andMatrixData
implsSingleData
toSharedData
(and*Mut
version); use as base ofListData
,MatrixData
: this means we now have a useful trait as the basis of all shared dataData: SharedData
as a type parameter toDriver
; addDriver::on_message
to handle event messages (this replacesSingleData::handle_message
etc.)kas_widgets::edit
a public module containingEditField
and associatesSizeMgr::dpem
,min_scroll_size
; removepixels_from_*
methods andline_height