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
dfd7003c
Unverified
Commit
dfd7003c
authored
3 years ago
by
Ygg01
Browse files
Options
Downloads
Patches
Plain Diff
Add `on_layout` to `text` and `windows`. Remove from `if_element`.
parent
f75e6bf9
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/widgets/if_element.rs
+1
-5
1 addition, 5 deletions
src/widgets/if_element.rs
src/widgets/text.rs
+4
-2
4 additions, 2 deletions
src/widgets/text.rs
src/widgets/window.rs
+4
-1
4 additions, 1 deletion
src/widgets/window.rs
with
9 additions
and
8 deletions
src/widgets/if_element.rs
+
1
−
5
View file @
dfd7003c
use
kayak_core
::
OnLayout
;
use
crate
::
core
::{
rsx
,
styles
::
Style
,
widget
,
Children
,
OnEvent
,
WidgetProps
};
/// Props used by the [`If`] widget
...
...
@@ -13,8 +11,6 @@ pub struct IfProps {
pub
children
:
Option
<
Children
>
,
#[prop_field(OnEvent)]
pub
on_event
:
Option
<
OnEvent
>
,
#[prop_field(OnLayout)]
pub
on_layout
:
Option
<
OnLayout
>
,
#[prop_field(Focusable)]
pub
focusable
:
Option
<
bool
>
,
}
...
...
@@ -31,7 +27,7 @@ pub struct IfProps {
/// | `children` | ✅ |
/// | `styles` | ✅ |
/// | `on_event` | ✅ |
/// | `on_layout` |
✅
|
/// | `on_layout` |
❌
|
/// | `focusable` | ✅ |
///
pub
fn
If
(
props
:
IfProps
)
{
...
...
This diff is collapsed.
Click to expand it.
src/widgets/text.rs
+
4
−
2
View file @
dfd7003c
use
kayak_core
::{
styles
::
Units
,
Binding
,
Bound
,
CursorIcon
};
use
kayak_core
::{
styles
::
Units
,
Binding
,
Bound
,
CursorIcon
,
OnLayout
};
use
kayak_font
::{
CoordinateSystem
,
KayakFont
};
use
crate
::
core
::{
...
...
@@ -24,6 +24,8 @@ pub struct TextProps {
pub
styles
:
Option
<
Style
>
,
#[prop_field(OnEvent)]
pub
on_event
:
Option
<
OnEvent
>
,
#[prop_field(OnLayout)]
pub
on_layout
:
Option
<
OnLayout
>
,
#[prop_field(Focusable)]
pub
focusable
:
Option
<
bool
>
,
}
...
...
@@ -40,7 +42,7 @@ pub struct TextProps {
/// | `children` | ❌ |
/// | `styles` | ✅ |
/// | `on_event` | ✅ |
/// | `on_layout` |
❌
|
/// | `on_layout` |
✅
|
/// | `focusable` | ✅ |
///
pub
fn
Text
(
props
:
TextProps
)
{
...
...
This diff is collapsed.
Click to expand it.
src/widgets/window.rs
+
4
−
1
View file @
dfd7003c
...
...
@@ -5,7 +5,7 @@ use crate::core::{
styles
::{
Corner
,
Edge
,
PositionType
,
Style
,
StyleProp
,
Units
},
use_state
,
widget
,
Children
,
EventType
,
OnEvent
,
WidgetProps
,
};
use
kayak_core
::
CursorIcon
;
use
kayak_core
::
{
CursorIcon
,
OnLayout
}
;
use
crate
::
widgets
::{
Background
,
Clip
,
Element
,
Text
};
...
...
@@ -26,6 +26,8 @@ pub struct WindowProps {
pub
children
:
Option
<
Children
>
,
#[prop_field(OnEvent)]
pub
on_event
:
Option
<
OnEvent
>
,
#[prop_field(OnLayout)]
pub
on_layout
:
Option
<
OnLayout
>
,
#[prop_field(Focusable)]
pub
focusable
:
Option
<
bool
>
,
}
...
...
@@ -42,6 +44,7 @@ pub struct WindowProps {
/// | `children` | ✅ |
/// | `styles` | ✅ |
/// | `on_event` | ✅ |
/// | `on_layout` | ✅ |
/// | `focusable` | ✅ |
///
pub
fn
Window
(
props
:
WindowProps
)
{
...
...
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