columns: clean up flags, refactor content rendering

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-08-03 14:02:05 -07:00
parent 30eb2e0258
commit 391abe817d
6 changed files with 81 additions and 59 deletions

View File

@@ -10,7 +10,7 @@ use crate::{
PulseAlpha, Username,
};
pub use contents::{render_note_contents, render_note_preview, NoteContents};
pub use contents::{render_note_preview, NoteContents};
pub use context::NoteContextButton;
use notedeck::get_current_wallet;
use notedeck::note::ZapTargetAmount;
@@ -366,11 +366,11 @@ impl<'a, 'd> NoteView<'a, 'd> {
flags: NoteOptions,
) {
let horiz_resp = ui
.horizontal(|ui| {
.horizontal_wrapped(|ui| {
ui.spacing_mut().item_spacing.x = if is_narrow(ui.ctx()) { 1.0 } else { 2.0 };
let response = ui
.add(Username::new(i18n, profile.as_ref().ok(), note.pubkey()).abbreviated(20));
if !flags.contains(NoteOptions::ShowCreatedAtBottom) {
if !flags.contains(NoteOptions::FullCreatedDate) {
return render_notetime(ui, i18n, note.created_at(), true).response;
}
response
@@ -508,8 +508,6 @@ impl<'a, 'd> NoteView<'a, 'd> {
let pfp_rect = pfp_resp.bounding_rect;
let mut note_action: Option<NoteAction> = pfp_resp.into_action(self.note.pubkey());
self.flags.set(NoteOptions::ShowCreatedAtBottom, false);
ui.with_layout(egui::Layout::top_down(egui::Align::LEFT), |ui| {
NoteView::note_header(
ui,