feat: nip4e (#188)
* encryption keys * . * . * move nip4e to device crate * . * . * use i18n for device crate * refactor * refactor * . * add reset button * send message with encryption keys * clean up * . * choose signer * fix * update i18n * fix sending
This commit is contained in:
@@ -76,6 +76,7 @@ pub trait PopupMenuExt: Styled + Selectable + InteractiveElement + IntoElement +
|
||||
impl PopupMenuExt for Button {}
|
||||
|
||||
enum PopupMenuItem {
|
||||
Title(SharedString),
|
||||
Separator,
|
||||
Item {
|
||||
icon: Option<Icon>,
|
||||
@@ -314,6 +315,20 @@ impl PopupMenu {
|
||||
self
|
||||
}
|
||||
|
||||
/// Add a title menu item
|
||||
pub fn title(mut self, label: impl Into<SharedString>) -> Self {
|
||||
if self.menu_items.is_empty() {
|
||||
return self;
|
||||
}
|
||||
|
||||
if let Some(PopupMenuItem::Title(_)) = self.menu_items.last() {
|
||||
return self;
|
||||
}
|
||||
|
||||
self.menu_items.push(PopupMenuItem::Title(label.into()));
|
||||
self
|
||||
}
|
||||
|
||||
/// Add a separator Menu Item
|
||||
pub fn separator(mut self) -> Self {
|
||||
if self.menu_items.is_empty() {
|
||||
@@ -588,6 +603,15 @@ impl Render for PopupMenu {
|
||||
}));
|
||||
|
||||
match item {
|
||||
PopupMenuItem::Title(label) => {
|
||||
this.child(
|
||||
div()
|
||||
.text_xs()
|
||||
.font_semibold()
|
||||
.text_color(cx.theme().text_muted)
|
||||
.child(label.clone())
|
||||
)
|
||||
},
|
||||
PopupMenuItem::Separator => this.h_auto().p_0().disabled(true).child(
|
||||
div()
|
||||
.rounded_none()
|
||||
|
||||
Reference in New Issue
Block a user