diff --git a/src/ui/feed.rs b/src/ui/feed.rs index 7a2af94a..0da485aa 100644 --- a/src/ui/feed.rs +++ b/src/ui/feed.rs @@ -1,9 +1,12 @@ use super::{GossipUi, Page}; use crate::comms::BusMessage; use crate::globals::{Globals, GLOBALS}; -use eframe::egui; -use egui::{Align, Color32, Context, Layout, RichText, ScrollArea, TextStyle, Ui, Vec2}; +use crate::ui::widgets::CopyButton; +use eframe::{egui, epaint}; +use egui::{Align, Color32, Context, Layout, Pos2, RichText, ScrollArea, Shape, TextStyle, Ui, Vec2}; +use epaint::{PathShape, Stroke}; use nostr_types::{EventKind, Id}; +use tracing::info; pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Frame, ui: &mut Ui) { let feed = Globals::blocking_get_feed(true); @@ -75,7 +78,7 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram fn render_post( app: &mut GossipUi, - _ctx: &Context, + ctx: &Context, _frame: &mut eframe::Frame, ui: &mut Ui, id: Id, @@ -197,6 +200,13 @@ fn render_post( }); ui.label(&event.content); + + // Under row + ui.horizontal(|ui| { + if ui.add(CopyButton { }).clicked() { + ui.output().copied_text = event.content.clone(); + } + }); }); }); @@ -204,7 +214,8 @@ fn render_post( if app.settings.view_threaded { for reply_id in replies { - render_post(app, _ctx, _frame, ui, reply_id, indent + 1); + render_post(app, ctx, _frame, ui, reply_id, indent + 1); } } } +