Preferences menu and toggle for in_transfer hashes

This commit is contained in:
Emilia Allison 2023-12-29 18:11:00 -05:00
parent 0101846b52
commit 4937d4ad28
Signed by: emilia
GPG Key ID: 7A3F8997BFE894E0
2 changed files with 20 additions and 0 deletions

View File

@ -12,6 +12,8 @@ div.upper_menu {
visibility: inherit; visibility: inherit;
display: flex;
div.dropdown { div.dropdown {
margin-right: 2px; margin-right: 2px;

View File

@ -49,6 +49,15 @@ pub fn MainWindow() -> Html {
}); });
} }
let toggle_in_transfer_hashes_callback = {
let main_dispatch = main_dispatch.clone();
Callback::from(move |_| {
main_dispatch.reduce_mut(|state| {
state.preferences.in_transfer_hashes ^= true;
})
})
};
let new_plate_dialog_is_open = use_state_eq(|| false); let new_plate_dialog_is_open = use_state_eq(|| false);
let new_plate_dialog_callback = { let new_plate_dialog_callback = {
let new_plate_dialog_is_open = new_plate_dialog_is_open.clone(); let new_plate_dialog_is_open = new_plate_dialog_is_open.clone();
@ -476,6 +485,15 @@ pub fn MainWindow() -> Html {
</div> </div>
</div> </div>
</div> </div>
<div class="dropdown">
<button>{"Options"}</button>
<div class="dropdown-sub">
<button>{"Styles"}</button>
<div>
<button onclick={toggle_in_transfer_hashes_callback}>{"Toggle in transfer hashes"}</button>
</div>
</div>
</div>
</div> </div>
<div class="main_container"> <div class="main_container">
<Tree open_new_plate_callback={open_new_plate_dialog_callback}/> <Tree open_new_plate_callback={open_new_plate_dialog_callback}/>