Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
Bevy Cosmic Edit
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microhacks
Bevy Forks
Bevy Cosmic Edit
Commits
11e8904e
Unverified
Commit
11e8904e
authored
1 year ago
by
sam
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
show cursor on readonly widget (#71)
parent
c9eb67b0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cursor.rs
+3
-13
3 additions, 13 deletions
src/cursor.rs
with
3 additions
and
13 deletions
src/cursor.rs
+
3
−
13
View file @
11e8904e
use
bevy
::{
input
::
mouse
::
MouseMotion
,
prelude
::
*
,
window
::
PrimaryWindow
};
use
crate
::{
CosmicEditor
,
CosmicTextChanged
,
ReadOnly
};
use
crate
::{
CosmicEditor
,
CosmicTextChanged
};
/// For use with custom cursor control; Event is emitted when cursor enters a text widget
#[derive(Event)]
...
...
@@ -33,13 +33,9 @@ pub fn change_cursor(
}
}
// TODO: Only emit events; If configured to, have a fn to act on the events
pub
fn
hover_sprites
(
windows
:
Query
<&
Window
,
With
<
PrimaryWindow
>>
,
mut
cosmic_edit_query
:
Query
<
(
&
mut
Sprite
,
&
GlobalTransform
),
(
With
<
CosmicEditor
>
,
Without
<
ReadOnly
>
),
>
,
mut
cosmic_edit_query
:
Query
<
(
&
mut
Sprite
,
&
GlobalTransform
),
With
<
CosmicEditor
>>
,
camera_q
:
Query
<
(
&
Camera
,
&
GlobalTransform
)
>
,
mut
hovered
:
Local
<
bool
>
,
mut
last_hovered
:
Local
<
bool
>
,
...
...
@@ -76,13 +72,7 @@ pub fn hover_sprites(
}
pub
fn
hover_ui
(
mut
interaction_query
:
Query
<
&
Interaction
,
(
Changed
<
Interaction
>
,
(
With
<
CosmicEditor
>
,
Without
<
ReadOnly
>
),
),
>
,
mut
interaction_query
:
Query
<&
Interaction
,
(
Changed
<
Interaction
>
,
With
<
CosmicEditor
>
)
>
,
mut
evw_hover_in
:
EventWriter
<
TextHoverIn
>
,
mut
evw_hover_out
:
EventWriter
<
TextHoverOut
>
,
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment