Merge profiling editing #625

Changelog-Added: Added profile editing
This commit is contained in:
William Casarin
2025-01-04 13:15:25 -08:00
24 changed files with 893 additions and 209 deletions

View File

@@ -330,6 +330,14 @@ impl Accounts {
None
}
pub fn contains_full_kp(&self, pubkey: &enostr::Pubkey) -> bool {
if let Some(contains) = self.contains_account(pubkey.bytes()) {
contains.has_nsec
} else {
false
}
}
#[must_use = "UnknownIdAction's must be handled. Use .process_unknown_id_action()"]
pub fn add_account(&mut self, account: Keypair) -> AddAccountAction {
let pubkey = account.pubkey;
@@ -567,6 +575,18 @@ impl Accounts {
self.needs_relay_config = false;
}
}
pub fn get_full<'a>(&'a self, pubkey: &[u8; 32]) -> Option<FilledKeypair<'a>> {
if let Some(contains) = self.contains_account(pubkey) {
if contains.has_nsec {
if let Some(kp) = self.get_account(contains.index) {
return kp.to_full();
}
}
}
None
}
}
fn get_selected_index(accounts: &[UserAccount], keystore: &KeyStorageType) -> Option<usize> {

View File

@@ -49,4 +49,11 @@ impl NotedeckTextStyle {
pub fn get_font_id(&self, ctx: &Context) -> FontId {
FontId::new(get_font_size(ctx, self), self.font_family())
}
pub fn get_bolded_font(&self, ctx: &Context) -> FontId {
FontId::new(
get_font_size(ctx, self),
egui::FontFamily::Name(crate::NamedFontFamily::Bold.as_str().into()),
)
}
}