mirror of
https://github.com/jwinterm/grim.git
synced 2026-10-17 14:21:24 +02:00
ui: show scan and wallet actions before getting data from node
This commit is contained in:
@@ -156,13 +156,10 @@ impl WalletAccountContent {
|
|||||||
|
|
||||||
ui.allocate_ui_with_layout(rect.size(), Layout::right_to_left(Align::Center), |ui| {
|
ui.allocate_ui_with_layout(rect.size(), Layout::right_to_left(Align::Center), |ui| {
|
||||||
// Draw button to show QR code scanner.
|
// Draw button to show QR code scanner.
|
||||||
let wallet_synced = wallet.synced_from_node();
|
View::item_button(ui, View::item_rounding(0, 2, true), SCAN, None, || {
|
||||||
if wallet_synced {
|
self.qr_scan_content = Some(CameraContent::default());
|
||||||
View::item_button(ui, View::item_rounding(0, 2, true), SCAN, None, || {
|
cb.start_camera();
|
||||||
self.qr_scan_content = Some(CameraContent::default());
|
});
|
||||||
cb.start_camera();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw button to show list of accounts.
|
// Draw button to show list of accounts.
|
||||||
let accounts = wallet.accounts();
|
let accounts = wallet.accounts();
|
||||||
@@ -171,11 +168,7 @@ impl WalletAccountContent {
|
|||||||
} else {
|
} else {
|
||||||
USER_PLUS
|
USER_PLUS
|
||||||
};
|
};
|
||||||
let rounding = if wallet_synced {
|
let rounding = View::item_rounding(1, 3, true);
|
||||||
View::item_rounding(1, 3, true)
|
|
||||||
} else {
|
|
||||||
View::item_rounding(0, 2, true)
|
|
||||||
};
|
|
||||||
View::item_button(ui, rounding, accounts_icon, None, || {
|
View::item_button(ui, rounding, accounts_icon, None, || {
|
||||||
if accounts.len() == 1 {
|
if accounts.len() == 1 {
|
||||||
self.create_account_content = CreateAccountContent::default();
|
self.create_account_content = CreateAccountContent::default();
|
||||||
|
|||||||
@@ -386,8 +386,7 @@ impl WalletContent {
|
|||||||
self.settings_content = None;
|
self.settings_content = None;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
let active = if wallet.synced_from_node() &&
|
let active = if has_wallet_data { Some(false) } else { None };
|
||||||
has_wallet_data { Some(false) } else { None };
|
|
||||||
columns[1].vertical_centered_justified(|ui| {
|
columns[1].vertical_centered_justified(|ui| {
|
||||||
if wallet.invoice_creating() {
|
if wallet.invoice_creating() {
|
||||||
ui.add_space(4.0);
|
ui.add_space(4.0);
|
||||||
|
|||||||
Reference in New Issue
Block a user