Proc macros for components, views

This commit is contained in:
2026-03-21 20:50:13 -04:00
parent 497dff987e
commit 437b318ad9
6 changed files with 625 additions and 5 deletions

View File

@@ -12,13 +12,15 @@ use std::rc::Rc;
use ruin_reactivity::effect;
use ruin_ui::{
Color, CursorIcon, Edges, Element, ElementId, InteractionTree, LayoutSnapshot, PlatformEvent,
PointerButton, PointerEvent, PointerRouter, RoutedPointerEvent, RoutedPointerEventKind,
TextFontFamily, TextSpan, TextSpanWeight, TextStyle, TextSystem, UiSize, WindowController,
WindowSpec, WindowUpdate, layout_snapshot_with_text_system,
Border, Color, CursorIcon, Edges, Element, ElementId, InteractionTree, LayoutSnapshot,
PlatformEvent, PointerButton, PointerEvent, PointerRouter, RoutedPointerEvent,
RoutedPointerEventKind, TextFontFamily, TextSpan, TextSpanWeight, TextStyle, TextSystem,
UiSize, WindowController, WindowSpec, WindowUpdate, layout_snapshot_with_text_system,
};
use ruin_ui_platform_wayland::start_wayland_ui;
pub use ruin_app_proc_macros::{component, view};
pub type Result<T> = std::result::Result<T, Box<dyn Error>>;
#[derive(Clone, Debug)]
@@ -564,6 +566,11 @@ impl ContainerBuilder {
self
}
pub fn border(mut self, border: Border) -> Self {
self.element = self.element.border(border.width, border.color);
self
}
pub fn width(mut self, width: f32) -> Self {
self.element = self.element.width(width);
self
@@ -949,7 +956,8 @@ pub mod prelude {
pub use crate::{
App, ButtonBuilder, Children, Component, ContainerBuilder, FontWeight, IntoEdges, IntoView,
Memo, Mountable, Result, Signal, TextBuilder, TextChildren, TextRole, View, Window, block,
button, colors, column, row, surfaces, text, use_memo, use_signal, use_window_title,
button, colors, column, component, row, surfaces, text, use_memo, use_signal,
use_window_title, view,
};
pub use ruin_ui::{
Color, CursorIcon, Edges, Element, ElementId, PointerButton, PointerEventKind,