fix flickering on account switch
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
committed by
William Casarin
parent
950a47119e
commit
aa82cb9fda
@@ -48,11 +48,16 @@ impl AccountManagementView {
|
|||||||
ndb: &Ndb,
|
ndb: &Ndb,
|
||||||
img_cache: &mut ImageCache,
|
img_cache: &mut ImageCache,
|
||||||
) -> Option<AccountManagementViewResponse> {
|
) -> Option<AccountManagementViewResponse> {
|
||||||
|
let mut return_op: Option<AccountManagementViewResponse> = None;
|
||||||
ui.allocate_ui_with_layout(
|
ui.allocate_ui_with_layout(
|
||||||
Vec2::new(ui.available_size_before_wrap().x, 32.0),
|
Vec2::new(ui.available_size_before_wrap().x, 32.0),
|
||||||
Layout::top_down(egui::Align::Min),
|
Layout::top_down(egui::Align::Min),
|
||||||
|ui| {
|
|ui| {
|
||||||
let txn = Transaction::new(ndb).ok()?;
|
let txn = if let Ok(txn) = Transaction::new(ndb) {
|
||||||
|
txn
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
for i in 0..account_manager.num_accounts() {
|
for i in 0..account_manager.num_accounts() {
|
||||||
let account_pubkey = account_manager
|
let account_pubkey = account_manager
|
||||||
@@ -76,7 +81,7 @@ impl AccountManagementView {
|
|||||||
if let Some(op) =
|
if let Some(op) =
|
||||||
profile_preview_view(ui, profile.as_ref(), img_cache, is_selected)
|
profile_preview_view(ui, profile.as_ref(), img_cache, is_selected)
|
||||||
{
|
{
|
||||||
return Some(match op {
|
return_op = Some(match op {
|
||||||
ProfilePreviewOp::SwitchTo => {
|
ProfilePreviewOp::SwitchTo => {
|
||||||
AccountManagementViewResponse::SelectAccount(i)
|
AccountManagementViewResponse::SelectAccount(i)
|
||||||
}
|
}
|
||||||
@@ -86,10 +91,9 @@ impl AccountManagementView {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None
|
|
||||||
},
|
},
|
||||||
)
|
);
|
||||||
.inner
|
return_op
|
||||||
}
|
}
|
||||||
|
|
||||||
fn top_section_buttons_widget(
|
fn top_section_buttons_widget(
|
||||||
|
|||||||
Reference in New Issue
Block a user