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

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
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) {
......
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) {
......
......@@ -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) {
......
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