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 get/update from fn #559

Merged
merged 9 commits into from
Aug 27, 2024
Merged

add get/update from fn #559

merged 9 commits into from
Aug 27, 2024

Conversation

jrmoulton
Copy link
Collaborator

  • Creates two new traits SignalRead and SignalWrite that just split out the accessing of the Rc data from the get and update traits.

  • Adds a new signal type that lets you define a base signal and then a custom getter function and a custom setter function. This type implements the new signal traits

  • Changes the checkbox widget to just accept in input that implements the signal traits.

  • Changes the slider to use the more typical rusty new function instead of a create_*. (I'm leaning towards switching all of our APIs to this format).

  • Adds a few different Slider::new_* functions that accept inputs that implement different sets of the Signal traits.

  • Changes the slider example in the widget gallery to have the only state the the string for the text input and then the slider is driven by a GetUpdateFn with custom accessors.

I don't love the name GetUpdateFn but I haven't come up with anything better

src/views/checkbox.rs Outdated Show resolved Hide resolved
@dzhou121
Copy link
Contributor

For create_*, I personally prefer this over "RwSignal::new()`, because it blends well with all the view creation functions.

Also, it's simply easier to type in, I normally just put crrw and the auto completion will pick it up :)

@jrmoulton
Copy link
Collaborator Author

Part of the reason that I like the ::new_*() methods is because that works better for when there are multiple ways to constructor methods create a view. Like how I currently have it with slider. But I agree that in the simple case the create_* methods are cleaner. I'll just make sure to have a create_* function that creates the default view

@dzhou121 dzhou121 merged commit 259b23d into lapce:main Aug 27, 2024
7 checks passed
jrmoulton added a commit to jrmoulton/floem that referenced this pull request Sep 9, 2024
* add get/update from fn

* update radio buttons and example

* Add stack ext trait

* update dropdown

* change custom constructors return self to allow custom styles

* fix flight booker

* fix other examples

* better support for simple closure input

* fix clippy
jrmoulton added a commit to jrmoulton/floem that referenced this pull request Sep 9, 2024
vello w/ gradients and brush override

vello chnages. before parley

attempt parley

Revert "attempt parley"

This reverts commit 851ae9d8067e1ec570bed4fa865980f6b10ba33b.

wip

updates

wip

wip

wip

new vello

fixed lapce#554 (lapce#555)

- fixed tab navigation wrapping the tab button
- fixed lapce#554

Add SignalGet SignalWith SignalUpdate traits (lapce#558)

* Add SignalGet SignalWith SignalUpdate traits

* fix doc

* fix Linux

make SignalUpdate non panic

Add initial wasm support (lapce#527)

* Add initial wasm support

* Bump web-time version

* Run cargo fmt

* Fix webgpu example

* Fix clippy warning

* Switch to latest floem-winit commit

* Fix conditional import in keyboard.rs

* Fix webgpu example

* Automatically follow canvas size by default

* Remove unused import

* Remove unused import

* Use latest floem-vger from git

add get/update from fn (lapce#559)

* add get/update from fn

* update radio buttons and example

* Add stack ext trait

* update dropdown

* change custom constructors return self to allow custom styles

* fix flight booker

* fix other examples

* better support for simple closure input

* fix clippy

rename SignalWith track method (lapce#562)

* rename SignalWith track method

* add SignalTrack trait

Keyframe Animations (lapce#563)

* add keyframed animations

* Make animations reactive and stackable

* remove old files

* fix bezier

* add reactive animation state control

* remove animation message comment

* improve easing

* clippy

* add delay

* Fix transition on layout props

* Fix animate towards default

* fix animation view state

* fix animation view state again

* fix clippy

* remove old comment

* fix clippy 2
jrmoulton added a commit to jrmoulton/floem that referenced this pull request Sep 9, 2024
vello w/ gradients and brush override

vello chnages. before parley

attempt parley

Revert "attempt parley"

This reverts commit 851ae9d8067e1ec570bed4fa865980f6b10ba33b.

wip

updates

wip

wip

wip

new vello

fixed lapce#554 (lapce#555)

- fixed tab navigation wrapping the tab button
- fixed lapce#554

Add SignalGet SignalWith SignalUpdate traits (lapce#558)

* Add SignalGet SignalWith SignalUpdate traits

* fix doc

* fix Linux

make SignalUpdate non panic

Add initial wasm support (lapce#527)

* Add initial wasm support

* Bump web-time version

* Run cargo fmt

* Fix webgpu example

* Fix clippy warning

* Switch to latest floem-winit commit

* Fix conditional import in keyboard.rs

* Fix webgpu example

* Automatically follow canvas size by default

* Remove unused import

* Remove unused import

* Use latest floem-vger from git

add get/update from fn (lapce#559)

* add get/update from fn

* update radio buttons and example

* Add stack ext trait

* update dropdown

* change custom constructors return self to allow custom styles

* fix flight booker

* fix other examples

* better support for simple closure input

* fix clippy

rename SignalWith track method (lapce#562)

* rename SignalWith track method

* add SignalTrack trait

Keyframe Animations (lapce#563)

* add keyframed animations

* Make animations reactive and stackable

* remove old files

* fix bezier

* add reactive animation state control

* remove animation message comment

* improve easing

* clippy

* add delay

* Fix transition on layout props

* Fix animate towards default

* fix animation view state

* fix animation view state again

* fix clippy

* remove old comment

* fix clippy 2
@jrmoulton jrmoulton deleted the signal-traits branch September 18, 2024 02:35
jrmoulton added a commit to jrmoulton/floem that referenced this pull request Sep 26, 2024
* add get/update from fn

* update radio buttons and example

* Add stack ext trait

* update dropdown

* change custom constructors return self to allow custom styles

* fix flight booker

* fix other examples

* better support for simple closure input

* fix clippy
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.

2 participants