-
Notifications
You must be signed in to change notification settings - Fork 115
Mouse Events Implementation #180
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
Closed
Closed
Changes from 2 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3dbc231
Hover Event Implementation
wheregmis db0d812
Remove Focused Node
wheregmis 7e0c0fe
Merge branch 'main' into hover_impl
wheregmis e6d7fda
refactor: Replace hover event handling with mouseover and mouseleave …
wheregmis 070e2c4
feat: Implement hover counters for multiple boxes with styling
wheregmis 18bbe5d
refactor: add TODO for mouse leave cases
wheregmis 2ba7944
Merge branch 'main' into hover_impl
wheregmis f312520
Add hover state management for mouse leave events
wheregmis a02ca44
Remove MouseOver event handling from DioxusDocument
wheregmis 44292bf
Revert "Remove MouseOver event handling from DioxusDocument"
wheregmis 097f391
Using Combined Mouse event handling from DioxusDocument
wheregmis 181a03e
Merge branch 'DioxusLabs:main' into hover_impl
wheregmis 6ce6e24
Mouse Enter and Leave also implemented
wheregmis dfabc45
remove println
wheregmis fa97d93
Consistent Naming BlitzMousePositionEvent
wheregmis b009dbb
Merge main into hover_impl
wheregmis 34dcbce
Fix compilation errors after merge
wheregmis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| use dioxus::prelude::*; | ||
|
|
||
| fn main() { | ||
| dioxus_native::launch(app); | ||
| } | ||
|
|
||
| fn app() -> Element { | ||
| let mut hover_count = use_signal(|| 0); | ||
|
|
||
| rsx! { | ||
| div { | ||
| style: "padding: 20px; background: #eee; cursor: pointer;", | ||
| onmouseenter: move |_| hover_count += 1, | ||
| "Hover count: {hover_count}" | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| use crate::BaseDocument; | ||
|
|
||
| pub(crate) fn handle_hover(doc: &mut BaseDocument, _target: usize, x: f32, y: f32) { | ||
| if let Some(node) = doc.get_node_mut(_target) { | ||
| // Toggle hover state on the node | ||
| node.hover(); | ||
|
|
||
| doc.set_focus_to(_target); | ||
|
|
||
| doc.set_hover_to(x, y); | ||
| } | ||
| } |
This file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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 file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.