AddRemove: Make a button that adds points
All checks were successful
/ test (pull_request) Successful in 2m25s

This commit is contained in:
Aaron Fenyes 2025-04-28 11:38:45 -07:00
parent b7375e7101
commit 07a415843d
2 changed files with 11 additions and 3 deletions

View file

@ -42,9 +42,9 @@ body {
} }
#add-remove > button { #add-remove > button {
width: 32px; /*width: 32px;*/
height: 32px; height: 32px;
font-size: large; /*font-size: large;*/
} }
/* KLUDGE */ /* KLUDGE */
@ -53,7 +53,9 @@ body {
buttons need to be displayed in an emoji font buttons need to be displayed in an emoji font
*/ */
#add-remove > button.emoji { #add-remove > button.emoji {
width: 32px;
font-family: 'Noto Emoji', sans-serif; font-family: 'Noto Emoji', sans-serif;
font-size: large;
} }
/* outline */ /* outline */

View file

@ -214,7 +214,13 @@ pub fn AddRemove() -> View {
let state = use_context::<AppState>(); let state = use_context::<AppState>();
state.assembly.insert_element_default::<Sphere>(); state.assembly.insert_element_default::<Sphere>();
} }
) { "+" } ) { "Add sphere" }
button(
on:click=|_| {
let state = use_context::<AppState>();
state.assembly.insert_element_default::<Point>();
}
) { "Add point" }
button( button(
class="emoji", /* KLUDGE */ // for convenience, we're using an emoji as a temporary icon for this button class="emoji", /* KLUDGE */ // for convenience, we're using an emoji as a temporary icon for this button
disabled={ disabled={