Skip to content
Snippets Groups Projects
Unverified Commit f75e6bf9 authored by Ygg01's avatar Ygg01
Browse files

Add `on_layout` to most custom widgets

parent 3303d995
No related branches found
No related tags found
No related merge requests found
use kayak_core::OnLayout;
use crate::core::{
render_command::RenderCommand,
rsx,
......@@ -16,6 +18,8 @@ pub struct AppProps {
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>,
}
......@@ -32,6 +36,7 @@ pub struct AppProps {
/// | `children` | ✅ |
/// | `styles` | ✅ |
/// | `on_event` | ✅ |
/// | `on_layout` | ✅ |
/// | `focusable` | ✅ |
///
/// # Using the `bevy_renderer` feature
......
use kayak_core::OnLayout;
use crate::core::{
render_command::RenderCommand,
rsx,
......@@ -14,6 +16,8 @@ pub struct ClipProps {
pub children: Option<Children>,
#[prop_field(OnEvent)]
pub on_event: Option<OnEvent>,
#[prop_field(OnLayout)]
pub on_layout: Option<OnLayout>,
}
#[widget]
......@@ -29,6 +33,7 @@ pub struct ClipProps {
/// | `children` | ✅ |
/// | `styles` | ✅ |
/// | `on_event` | ✅ |
/// | `on_layout` | ✅ |
/// | `focusable` | ❌ |
///
pub fn Clip(props: ClipProps) {
......
use kayak_core::OnLayout;
use crate::core::{
render_command::RenderCommand,
rsx,
......@@ -14,6 +16,8 @@ pub struct ElementProps {
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>,
}
......@@ -32,6 +36,7 @@ pub struct ElementProps {
/// | `children` | ✅ |
/// | `styles` | ✅ |
/// | `on_event` | ✅ |
/// | `on_layout` | ✅ |
/// | `focusable` | ✅ |
///
pub fn Element(props: ElementProps) {
......
use kayak_core::OnLayout;
use crate::core::{
render_command::RenderCommand,
rsx,
......@@ -33,6 +35,8 @@ pub struct FoldProps {
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>,
}
......@@ -49,6 +53,7 @@ pub struct FoldProps {
/// | `children` | ✅ |
/// | `styles` | ✅ |
/// | `on_event` | ✅ |
/// | `on_layout` | ✅ |
/// | `focusable` | ✅ |
///
/// # Examples
......
use kayak_core::OnLayout;
use crate::core::{rsx, styles::Style, widget, Children, OnEvent, WidgetProps};
/// Props used by the [`If`] widget
......@@ -11,6 +13,8 @@ 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>,
}
......@@ -27,6 +31,7 @@ pub struct IfProps {
/// | `children` | ✅ |
/// | `styles` | ✅ |
/// | `on_event` | ✅ |
/// | `on_layout` | ✅ |
/// | `focusable` | ✅ |
///
pub fn If(props: IfProps) {
......
use kayak_core::OnLayout;
use crate::core::{
render_command::RenderCommand,
rsx,
......@@ -15,6 +17,8 @@ pub struct ImageProps {
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,6 +35,7 @@ pub struct ImageProps {
/// | `children` | ✅ |
/// | `styles` | ✅ |
/// | `on_event` | ✅ |
/// | `on_layout` | ✅ |
/// | `focusable` | ✅ |
///
pub fn Image(props: ImageProps) {
......
......@@ -34,6 +34,7 @@ pub struct InspectorProps {
/// | `children` | ❌ |
/// | `styles` | ✅ |
/// | `on_event` | ❌ |
/// | `on_layout` | ❌ |
/// | `focusable` | ❌ |
///
pub fn Inspector(props: InspectorProps) {
......
use kayak_core::OnLayout;
use crate::core::{
render_command::RenderCommand,
rsx,
......@@ -18,6 +20,8 @@ pub struct NinePatchProps {
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>,
}
......@@ -48,6 +52,7 @@ pub struct NinePatchProps {
/// | `children` | ✅ |
/// | `styles` | ✅ |
/// | `on_event` | ✅ |
/// | `on_layout` | ✅ |
/// | `focusable` | ✅ |
///
pub fn NinePatch(props: NinePatchProps) {
......
......@@ -40,6 +40,7 @@ pub struct TextProps {
/// | `children` | ❌ |
/// | `styles` | ✅ |
/// | `on_event` | ✅ |
/// | `on_layout` | ❌ |
/// | `focusable` | ✅ |
///
pub fn Text(props: TextProps) {
......
......@@ -72,6 +72,7 @@ pub struct TooltipConsumerProps {
/// | `children` | ✅ |
/// | `styles` | ✅ |
/// | `on_event` | ✅ |
/// | `on_layout` | ❌ |
/// | `focusable` | ❌ |
///
/// # Styles
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment