commit 623b4617d2e42b90ef2a80e2bb6a9560df149ef3
parent f8f3676450eab0ab38f443b3c6b5d90eacda5c88
Author: kernelkind <kernelkind@gmail.com>
Date: Mon, 3 Feb 2025 15:30:32 -0500
move login help text below TextEdit
closes: https://github.com/damus-io/notedeck/issues/687
Signed-off-by: kernelkind <kernelkind@gmail.com>
Diffstat:
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/crates/notedeck_columns/src/ui/account_login_view.rs b/crates/notedeck_columns/src/ui/account_login_view.rs
@@ -1,8 +1,9 @@
use crate::login_manager::AcquireKeyState;
use crate::ui::{Preview, PreviewConfig};
-use egui::TextEdit;
use egui::{Align, Button, Color32, Frame, InnerResponse, Margin, RichText, Vec2};
+use egui::{Layout, TextEdit};
use enostr::Keypair;
+use notedeck::fonts::get_font_size;
use notedeck::NotedeckTextStyle;
pub struct AccountLoginView<'a> {
@@ -38,6 +39,14 @@ impl<'a> AccountLoginView<'a> {
ui.vertical_centered_justified(|ui| {
ui.add(login_textedit(self.manager));
+ ui.with_layout(Layout::left_to_right(Align::TOP), |ui| {
+ let help_text_style = NotedeckTextStyle::Small;
+ ui.add(egui::Label::new(
+ RichText::new("Enter your public key (npub), nostr address (e.g. vrod@damus.io), or private key (nsec). You must enter your private key to be able to post, reply, etc.")
+ .text_style(help_text_style.text_style())
+ .size(get_font_size(ui.ctx(), &help_text_style)).color(ui.visuals().weak_text_color()),
+ ).wrap())
+ });
self.manager.loading_and_error_ui(ui);
@@ -99,8 +108,7 @@ fn login_textedit(manager: &mut AcquireKeyState) -> TextEdit {
manager.get_acquire_textedit(|text| {
egui::TextEdit::singleline(text)
.hint_text(
- RichText::new("Enter your public key (npub), nostr address (e.g. vrod@damus.io), or private key (nsec) here...")
- .text_style(NotedeckTextStyle::Body.text_style()),
+ RichText::new("Your key here...").text_style(NotedeckTextStyle::Body.text_style()),
)
.vertical_align(Align::Center)
.min_size(Vec2::new(0.0, 40.0))