mirror of
https://github.com/jwinterm/grim.git
synced 2026-11-25 23:43:53 +01:00
desktop: parse file content from argument on launch, single app instance, wallets selection and opening modals refactoring
This commit is contained in:
@@ -35,7 +35,7 @@ pub struct Modal {
|
||||
/// Identifier for modal.
|
||||
pub(crate) id: &'static str,
|
||||
/// Position on the screen.
|
||||
position: ModalPosition,
|
||||
pub position: ModalPosition,
|
||||
/// To check if it can be closed.
|
||||
closeable: Arc<AtomicBool>,
|
||||
/// Title text
|
||||
@@ -64,6 +64,12 @@ impl Modal {
|
||||
self
|
||||
}
|
||||
|
||||
/// Change [`Modal`] position on the screen.
|
||||
pub fn change_position(position: ModalPosition) {
|
||||
let mut w_state = MODAL_STATE.write();
|
||||
w_state.modal.as_mut().unwrap().position = position;
|
||||
}
|
||||
|
||||
/// Mark [`Modal`] closed.
|
||||
pub fn close(&self) {
|
||||
let mut w_nav = MODAL_STATE.write();
|
||||
|
||||
Reference in New Issue
Block a user