gui(settings): add a copy button to auth fields
This commit is contained in:
parent
c9743b4070
commit
523bcbdb1f
@ -5,7 +5,7 @@ use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
|
||||
use chrono::{NaiveDate, Utc};
|
||||
use iced::Command;
|
||||
use iced::{clipboard, Command};
|
||||
use tracing::info;
|
||||
|
||||
use liana::miniscript::bitcoin::Network;
|
||||
@ -361,6 +361,7 @@ impl BitcoindSettings {
|
||||
});
|
||||
}
|
||||
}
|
||||
view::SettingsEditMessage::Clipboard(text) => return clipboard::write(text),
|
||||
};
|
||||
Command::none()
|
||||
}
|
||||
|
||||
@ -91,6 +91,7 @@ pub enum SettingsEditMessage {
|
||||
BitcoindRpcAuthTypeSelected(RpcAuthType),
|
||||
Cancel,
|
||||
Confirm,
|
||||
Clipboard(String),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
||||
@ -507,7 +507,14 @@ pub fn bitcoind<'a>(
|
||||
col_fields = col_fields.push(
|
||||
Row::new()
|
||||
.push(Container::new(text(k).bold().small()).width(Length::Fill))
|
||||
.push(text(v).small()),
|
||||
.push(text(v.clone()).small())
|
||||
.push(Space::with_width(10))
|
||||
.push(
|
||||
Button::new(icon::clipboard_icon())
|
||||
.style(theme::Button::TransparentBorder)
|
||||
.on_press(SettingsEditMessage::Clipboard(v.to_string())),
|
||||
)
|
||||
.align_items(Alignment::Center),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user