macro goodness
This commit is contained in:
1 parent
0b8a93c5ce
commit
8d1a810483
9 files changed
+131
-61
No files matched your search
+8
-11
@@ -1,23 +1,20 @@
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
|
||||
use cosmic_text::Family;
|
||||
use iris::prelude::*;
|
||||
use len_fns::*;
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
use winit::{event::WindowEvent, event_loop::ActiveEventLoop, window::WindowAttributes};
|
||||
|
||||
iris::state_prelude!(Client);
|
||||
|
||||
fn main() {
|
||||
App::<Client>::run();
|
||||
}
|
||||
|
||||
#[derive(HasUi, HasUiState)]
|
||||
#[derive(DefaultUiState)]
|
||||
pub struct Client {
|
||||
ui: Ui<Self>,
|
||||
ui_state: UiState<Self>,
|
||||
info: WidgetRef<Self, Text<Self>>,
|
||||
ui: Ui,
|
||||
ui_state: UiState,
|
||||
info: WidgetRef<Text>,
|
||||
}
|
||||
|
||||
event_ctx!(Client);
|
||||
|
||||
impl DefaultAppState for Client {
|
||||
fn new(event_loop: &ActiveEventLoop, _proxy: Proxy<Self::Event>) -> Self {
|
||||
let mut ui = Ui::new();
|
||||
@@ -153,7 +150,7 @@ impl DefaultAppState for Client {
|
||||
let main = WidgetPtr::new().handles(ui);
|
||||
|
||||
let vals = Rc::new(RefCell::new((0, Vec::new())));
|
||||
let mut switch_button = |color, to: WidgetHandle<Self>, label| {
|
||||
let mut switch_button = |color, to: WidgetHandle, label| {
|
||||
let vec = &mut vals.borrow_mut().1;
|
||||
let i = vec.len();
|
||||
if vec.is_empty() {
|
||||
|
||||
Reference in new issue
Block a user