reintroduce account management

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2024-06-23 19:46:58 -04:00
parent ac0821db79
commit 6afb618089
9 changed files with 181 additions and 21 deletions

View File

@@ -10,7 +10,7 @@ use crate::relay_pool_manager::RelayPoolManager;
use crate::route::Route;
use crate::timeline;
use crate::timeline::{MergeKind, NoteRef, Timeline, ViewFilter};
use crate::ui::{self, AccountSelectionWidget};
use crate::ui::{self, AccountSelectionWidget, DesktopGlobalPopup};
use crate::ui::{DesktopSidePanel, RelayView, View};
use crate::Result;
use egui_nav::{Nav, NavAction};
@@ -46,7 +46,7 @@ pub struct Damus {
is_mobile: bool,
/// global navigation for account management popups, etc.
//nav: Vec<Route>,
pub global_nav: Vec<Route>,
pub textmode: bool,
pub drafts: HashMap<enostr::NoteId, Draft>,
@@ -59,6 +59,7 @@ pub struct Damus {
frame_history: crate::frame_history::FrameHistory,
pub show_account_switcher: bool,
pub show_global_popup: bool,
}
fn relay_setup(pool: &mut RelayPool, ctx: &egui::Context) {
@@ -728,6 +729,8 @@ impl Damus {
//compose: "".to_string(),
frame_history: FrameHistory::default(),
show_account_switcher: false,
show_global_popup: false,
global_nav: Vec::new(),
}
}
@@ -755,6 +758,8 @@ impl Damus {
account_manager: AccountManager::new(None, crate::key_storage::KeyStorage::None),
frame_history: FrameHistory::default(),
show_account_switcher: false,
show_global_popup: true,
global_nav: Vec::new(),
}
}
@@ -990,9 +995,8 @@ fn render_damus_desktop(ctx: &egui::Context, app: &mut Damus) {
main_panel(&ctx.style(), app.is_mobile()).show(ctx, |ui| {
ui.spacing_mut().item_spacing.x = 0.0;
if app.show_account_switcher {
AccountSelectionWidget::ui(app, ui);
}
AccountSelectionWidget::ui(app, ui);
DesktopGlobalPopup::show(app.global_nav.clone(), app, ui);
if need_scroll {
egui::ScrollArea::horizontal().show(ui, |ui| {
timelines_view(ui, panel_sizes, app, app.timelines.len());