start account ui
This commit is contained in:
@@ -37,14 +37,23 @@ pub fn submit_button(
|
||||
text: &str,
|
||||
on_submit: impl Fn(&mut Client, &mut Ui) + 'static,
|
||||
) -> impl WidgetRet {
|
||||
let color = Color::GREEN;
|
||||
let color = Color::rgb(0, 200, 0);
|
||||
rect(color)
|
||||
.radius(15)
|
||||
.on(CursorSense::click(), move |ctx| {
|
||||
ctx.ui[ctx.id].color = color.darker(0.3);
|
||||
ctx.ui[ctx.id].color = color.darker(0.2);
|
||||
on_submit(ctx.state, ctx.ui);
|
||||
})
|
||||
.height(40)
|
||||
.foreground(wtext(text).size(20).text_align(Align::CENTER))
|
||||
.on(
|
||||
CursorSense::HoverStart | CursorSense::unclick(),
|
||||
move |ctx| {
|
||||
ctx.ui[ctx.id].color = color.brighter(0.1);
|
||||
},
|
||||
)
|
||||
.on(CursorSense::HoverEnd, move |ctx| {
|
||||
ctx.ui[ctx.id].color = color;
|
||||
})
|
||||
.height(60)
|
||||
.foreground(wtext(text).size(25).text_align(Align::CENTER))
|
||||
.to_any()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user