Skip to content
Snippets Groups Projects
Commit 23938a80 authored by MrGVSV's avatar MrGVSV
Browse files

Formatting

parent 7f26311e
No related branches found
No related tags found
No related merge requests found
......@@ -38,4 +38,4 @@ pub fn convert_cursor_icon(cursor_icon: CursorIcon) -> bevy::prelude::CursorIcon
CursorIcon::ColResize => bevy::prelude::CursorIcon::ColResize,
CursorIcon::RowResize => bevy::prelude::CursorIcon::RowResize,
}
}
\ No newline at end of file
}
......@@ -8,16 +8,16 @@ use bevy::{
mod bevy_context;
mod camera;
mod cursor;
mod key;
mod render;
mod cursor;
use crate::cursor::convert_cursor_icon;
pub use bevy_context::BevyContext;
pub use camera::*;
use kayak_core::{bind, Binding, InputEvent, MutableBound};
pub use render::unified::font::FontMapping;
pub use render::unified::image::ImageManager;
use crate::cursor::convert_cursor_icon;
#[derive(Default)]
pub struct BevyKayakUIPlugin;
......
......@@ -27,7 +27,7 @@ pub struct KayakContext {
widget_state_lifetimes:
HashMap<crate::Index, HashMap<crate::flo_binding::Uuid, Box<dyn crate::Releasable>>>,
widget_states: HashMap<crate::Index, resources::Resources>,
cursor_icon: CursorIcon
cursor_icon: CursorIcon,
}
impl std::fmt::Debug for KayakContext {
......@@ -577,8 +577,8 @@ impl KayakContext {
let hovered = self.event_dispatcher.hovered.unwrap();
if let Some(node) = self.widget_manager.nodes.get(hovered) {
if let Some(node) = node {
let icon = node.resolved_styles.cursor.resolve();
self.cursor_icon = icon;
let icon = node.resolved_styles.cursor.resolve();
self.cursor_icon = icon;
}
}
}
......
......@@ -41,4 +41,4 @@ impl Default for CursorIcon {
fn default() -> Self {
CursorIcon::Default
}
}
\ No newline at end of file
}
......@@ -48,7 +48,7 @@ pub(crate) struct EventDispatcher {
wants_cursor: Option<bool>,
has_cursor: Option<Index>,
pub cursor_capture: Option<Index>,
pub hovered: Option<Index>
pub hovered: Option<Index>,
}
impl EventDispatcher {
......@@ -65,7 +65,7 @@ impl EventDispatcher {
wants_cursor: None,
has_cursor: None,
cursor_capture: None,
hovered: None
hovered: None,
}
}
......
......@@ -5,6 +5,7 @@ pub mod color;
pub mod context;
mod context_ref;
mod cursor;
mod cursor_icon;
pub mod event;
mod event_dispatcher;
mod flo_binding;
......@@ -25,7 +26,6 @@ pub mod tree;
mod vec;
pub mod widget;
pub mod widget_manager;
mod cursor_icon;
use std::sync::{Arc, RwLock};
......
pub use morphorm::{LayoutType, PositionType, Units};
use crate::cursor::PointerEvents;
use crate::{color::Color, CursorIcon, render_command::RenderCommand};
use crate::{color::Color, render_command::RenderCommand, CursorIcon};
#[derive(Debug, Clone, PartialEq)]
pub enum StyleProp<T: Default + Clone> {
......
use kayak_core::CursorIcon;
use crate::core::{
render_command::RenderCommand,
rsx,
styles::{Style, StyleProp, Units},
widget, Children, Color, Fragment, OnEvent, WidgetProps,
};
use kayak_core::CursorIcon;
#[derive(Default, Debug, PartialEq, Clone)]
pub struct ButtonProps {
......
......@@ -78,7 +78,8 @@ pub fn Text(props: TextProps) {
render_command: StyleProp::Value(render_command),
width: StyleProp::Value(Units::Pixels(layout_size.0)),
height: StyleProp::Value(Units::Pixels(layout_size.1)),
cursor: StyleProp::select(&[&styles.cursor, &StyleProp::Value(CursorIcon::Text)]).clone(),
cursor: StyleProp::select(&[&styles.cursor, &StyleProp::Value(CursorIcon::Text)])
.clone(),
..styles
});
} else {
......
......@@ -4,8 +4,8 @@ use crate::core::{
styles::{Style, Units},
widget, Bound, Children, Color, EventType, MutableBound, OnEvent, WidgetProps,
};
use std::sync::{Arc, RwLock};
use kayak_core::CursorIcon;
use std::sync::{Arc, RwLock};
use crate::widgets::{Background, Clip, Text};
......
use kayak_core::CursorIcon;
use crate::core::{
color::Color,
render_command::RenderCommand,
......@@ -6,6 +5,7 @@ use crate::core::{
styles::{PositionType, Style, StyleProp, Units},
use_state, widget, Children, EventType, OnEvent, WidgetProps,
};
use kayak_core::CursorIcon;
use crate::widgets::{Background, Clip, Element, Text};
......
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