From db7042ddca17753040626fe1c87eef6d9f6b18ef Mon Sep 17 00:00:00 2001 From: Gino Valente <gino.valente.code@gmail.com> Date: Fri, 25 Mar 2022 13:14:30 -0700 Subject: [PATCH] Reformat --- examples/shrink_grow_layout.rs | 4 ++-- kayak_core/src/layout.rs | 4 ++-- kayak_core/src/layout_dispatcher.rs | 2 +- kayak_core/src/vec.rs | 5 ++++- src/widgets/background.rs | 2 +- src/widgets/text_box.rs | 2 +- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/examples/shrink_grow_layout.rs b/examples/shrink_grow_layout.rs index 958be0c..fa1be48 100644 --- a/examples/shrink_grow_layout.rs +++ b/examples/shrink_grow_layout.rs @@ -10,12 +10,12 @@ use bevy::{ DefaultPlugins, }; use kayak_core::{ - styles::{LayoutType, Style, StyleProp, Units, Edge}, + styles::{Edge, LayoutType, Style, StyleProp, Units}, OnLayout, }; use kayak_core::{Color, EventType, OnEvent}; use kayak_render_macros::use_state; -use kayak_ui::widgets::{App, Text, Window, Element}; +use kayak_ui::widgets::{App, Element, Text, Window}; use kayak_ui::{ bevy::{BevyContext, BevyKayakUIPlugin, FontMapping, UICameraBundle}, widgets::Button, diff --git a/kayak_core/src/layout.rs b/kayak_core/src/layout.rs index 492bfe3..2ad33a4 100644 --- a/kayak_core/src/layout.rs +++ b/kayak_core/src/layout.rs @@ -3,12 +3,12 @@ use crate::Index; pub use morphorm::GeometryChanged; /// A layout data sent to widgets on layout. -/// +/// /// Similar and interchangeable with [Rect] /// ``` /// use kayak_core::layout_cache::Rect; /// use kayak_core::Layout; -/// +/// /// let layout = Layout::default(); /// let rect : Rect = layout.into(); /// let layout : Layout = rect.into(); diff --git a/kayak_core/src/layout_dispatcher.rs b/kayak_core/src/layout_dispatcher.rs index bcbba9e..7c35b56 100644 --- a/kayak_core/src/layout_dispatcher.rs +++ b/kayak_core/src/layout_dispatcher.rs @@ -1,5 +1,5 @@ use indexmap::IndexSet; -use morphorm::{Cache}; +use morphorm::Cache; use crate::{Index, KayakContext, KayakContextRef, LayoutEvent}; diff --git a/kayak_core/src/vec.rs b/kayak_core/src/vec.rs index 6e054fd..b70767c 100644 --- a/kayak_core/src/vec.rs +++ b/kayak_core/src/vec.rs @@ -1,4 +1,7 @@ -use crate::{context_ref::KayakContextRef, styles::Style, Children, Index, OnEvent, Widget, WidgetProps, OnLayout}; +use crate::{ + context_ref::KayakContextRef, styles::Style, Children, Index, OnEvent, OnLayout, Widget, + WidgetProps, +}; /// Props used by the [`VecTracker`] widget #[derive(Default, Debug, PartialEq, Clone)] diff --git a/src/widgets/background.rs b/src/widgets/background.rs index b2b917f..3e91253 100644 --- a/src/widgets/background.rs +++ b/src/widgets/background.rs @@ -1,10 +1,10 @@ -use kayak_core::OnLayout; use crate::core::{ render_command::RenderCommand, rsx, styles::{Style, StyleProp}, widget, Children, Fragment, OnEvent, WidgetProps, }; +use kayak_core::OnLayout; /// Props used by the [`Background`] widget #[derive(WidgetProps, Default, Debug, PartialEq, Clone)] diff --git a/src/widgets/text_box.rs b/src/widgets/text_box.rs index ceee81f..f872d2e 100644 --- a/src/widgets/text_box.rs +++ b/src/widgets/text_box.rs @@ -50,7 +50,7 @@ impl WidgetProps for TextBoxProps { fn get_on_layout(&self) -> Option<OnLayout> { self.on_layout.clone() } - + fn get_focusable(&self) -> Option<bool> { Some(!self.disabled) } -- GitLab