Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kayak UI 0.11
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
Kayak UI 0.11
Commits
5f7aaa7e
Commit
5f7aaa7e
authored
3 years ago
by
MrGVSV
Browse files
Options
Downloads
Patches
Plain Diff
Formatting
parent
f4eb7520
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
kayak_core/src/context.rs
+2
-2
2 additions, 2 deletions
kayak_core/src/context.rs
kayak_core/src/event_dispatcher.rs
+10
-3
10 additions, 3 deletions
kayak_core/src/event_dispatcher.rs
with
12 additions
and
5 deletions
kayak_core/src/context.rs
+
2
−
2
View file @
5f7aaa7e
...
...
@@ -460,8 +460,8 @@ impl KayakContext {
#[cfg(feature
=
"bevy_renderer"
)]
pub
fn
query_world
<
T
:
bevy
::
ecs
::
system
::
SystemParam
,
F
,
R
>
(
&
mut
self
,
mut
f
:
F
)
->
R
where
F
:
FnMut
(
<
T
::
Fetch
as
bevy
::
ecs
::
system
::
SystemParamFetch
<
'_
,
'_
>>
::
Item
)
->
R
,
where
F
:
FnMut
(
<
T
::
Fetch
as
bevy
::
ecs
::
system
::
SystemParamFetch
<
'_
,
'_
>>
::
Item
)
->
R
,
{
let
mut
world
=
self
.get_global_state
::
<
bevy
::
prelude
::
World
>
()
.unwrap
();
let
mut
system_state
=
bevy
::
ecs
::
system
::
SystemState
::
<
T
>
::
new
(
&
mut
world
);
...
...
This diff is collapsed.
Click to expand it.
kayak_core/src/event_dispatcher.rs
+
10
−
3
View file @
5f7aaa7e
...
...
@@ -3,7 +3,10 @@ use crate::flo_binding::{Binding, MutableBound};
use
crate
::
layout_cache
::
Rect
;
use
crate
::
render_command
::
RenderCommand
;
use
crate
::
widget_manager
::
WidgetManager
;
use
crate
::{
Event
,
EventType
,
Index
,
InputEvent
,
InputEventCategory
,
KayakContext
,
KeyCode
,
KeyboardEvent
,
KeyboardModifiers
,
PointerEvents
,
Widget
};
use
crate
::{
Event
,
EventType
,
Index
,
InputEvent
,
InputEventCategory
,
KayakContext
,
KeyCode
,
KeyboardEvent
,
KeyboardModifiers
,
PointerEvents
,
Widget
,
};
use
std
::
collections
::{
HashMap
,
HashSet
};
type
EventMap
=
HashMap
<
Index
,
HashSet
<
EventType
>>
;
...
...
@@ -363,7 +366,8 @@ impl EventDispatcher {
}
if
self
.has_cursor
.is_none
()
{
if
let
Some
(
widget
)
=
widget_manager
.current_widgets
.get
(
node
)
.unwrap
()
{
let
widget
=
widget_manager
.current_widgets
.get
(
node
)
.unwrap
();
if
let
Some
(
widget
)
=
widget
{
// Check if the cursor moved onto a widget that qualifies as one that can contain it
if
Self
::
can_contain_cursor
(
widget
)
{
self
.has_cursor
=
Some
(
node
);
...
...
@@ -490,7 +494,10 @@ impl EventDispatcher {
fn
can_contain_cursor
(
widget
:
&
Box
<
dyn
Widget
>
)
->
bool
{
if
let
Some
(
styles
)
=
widget
.get_styles
()
{
let
cmds
=
styles
.render_command
.resolve
();
!
matches!
(
cmds
,
RenderCommand
::
Empty
|
RenderCommand
::
Layout
|
RenderCommand
::
Clip
)
!
matches!
(
cmds
,
RenderCommand
::
Empty
|
RenderCommand
::
Layout
|
RenderCommand
::
Clip
)
}
else
{
false
}
...
...
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