Skip to content

Commit

Permalink
note: make links clickable
Browse files Browse the repository at this point in the history
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed Feb 11, 2024
1 parent c05d071 commit 63e1958
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 64 deletions.
126 changes: 63 additions & 63 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::Result;
use egui::containers::scroll_area::ScrollBarVisibility;

use egui::widgets::Spinner;
use egui::{Color32, Context, Frame, Margin, TextureHandle};
use egui::{Color32, Context, Frame, Hyperlink, Margin, RichText, TextureHandle};

use enostr::{ClientMessage, Filter, Pubkey, RelayEvent, RelayMessage};
use nostrdb::{
Expand Down Expand Up @@ -630,6 +630,13 @@ fn render_note_contents(
ui.colored_label(PURPLE, block.as_str());
}

BlockType::Url => {
ui.add(Hyperlink::from_label_and_url(
RichText::new(block.as_str()).color(PURPLE),
block.as_str(),
));
}

BlockType::Text => {
ui.weak(block.as_str());
}
Expand Down

0 comments on commit 63e1958

Please sign in to comment.