commit 63e195852b9a5fd19a6feab3f84c41fb5a6f6538
parent c05d0713b7cf2342d0d19c20a7cc476894f179e3
Author: William Casarin <jb55@jb55.com>
Date: Sun, 11 Feb 2024 13:00:07 -0800
note: make links clickable
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
M | Cargo.lock | | | 126 | ++++++++++++++++++++++++++++++++++++++++---------------------------------------- |
M | src/app.rs | | | 9 | ++++++++- |
2 files changed, 71 insertions(+), 64 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
@@ -752,36 +752,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991"
[[package]]
-name = "damus"
-version = "0.1.0"
-dependencies = [
- "android-activity 0.4.3",
- "android_logger",
- "console_error_panic_hook",
- "eframe",
- "egui 0.26.0",
- "egui_extras",
- "ehttp",
- "enostr",
- "env_logger 0.10.2",
- "image",
- "log",
- "nostrdb",
- "poll-promise",
- "puffin",
- "puffin_egui",
- "serde",
- "serde_derive",
- "serde_json",
- "tokio",
- "tracing",
- "tracing-subscriber",
- "tracing-wasm",
- "wasm-bindgen-futures",
- "winit",
-]
-
-[[package]]
name = "data-url"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -844,9 +814,9 @@ checksum = "57539aabcdbb733b6806ef421b66dec158dc1582107ad6d51913db3600303354"
[[package]]
name = "ecolor"
-version = "0.26.0"
+version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "169a0e42e2b3d0f663e100f5c10710ffdb9748f7e7565305ecc09044d59e0fbd"
+checksum = "9c912193fa5698d4fbc857b831fb96b42215dcf565e06012993a65901299a21f"
dependencies = [
"bytemuck",
"serde",
@@ -854,14 +824,14 @@ dependencies = [
[[package]]
name = "eframe"
-version = "0.26.0"
+version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2230537c7ee42c4c329461bad5933e91a8f938a9314645961e12e57080478731"
+checksum = "f31ff7b8ea429daa1370069cdca84cce0bc8e4358068fc50daef5e07b7e84481"
dependencies = [
"bytemuck",
"cocoa",
"document-features",
- "egui 0.26.0",
+ "egui 0.26.1",
"egui-wgpu",
"egui-winit",
"egui_glow",
@@ -902,13 +872,13 @@ dependencies = [
[[package]]
name = "egui"
-version = "0.26.0"
+version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5493685c2ca33e06b5ad45ae304b13bc084c395f422268bff1377633552f69ac"
+checksum = "abecd396ede556116fceaa0098a1c9278ef526119c5097311eac4bcf57484c52"
dependencies = [
"accesskit",
"ahash",
- "epaint 0.26.0",
+ "epaint 0.26.1",
"log",
"nohash-hasher",
"puffin",
@@ -917,14 +887,14 @@ dependencies = [
[[package]]
name = "egui-wgpu"
-version = "0.26.0"
+version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "094ce3408f61ead0747b506aeb9e3fa9adbd5d937096a26dfbee24387bce8b3a"
+checksum = "5c3b9dafdf68e57b0553205fa32bb111d84573de58410cd5fa448dc716e1d597"
dependencies = [
"bytemuck",
"document-features",
- "egui 0.26.0",
- "epaint 0.26.0",
+ "egui 0.26.1",
+ "epaint 0.26.1",
"log",
"puffin",
"thiserror",
@@ -936,12 +906,12 @@ dependencies = [
[[package]]
name = "egui-winit"
-version = "0.26.0"
+version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d85f8f89d6a937535e164a5bd6e31719fd7db01bc188d7b59425414b160a2ee1"
+checksum = "d0ef887214f5b65883cd1c85b0a5335e06f2876446c67fb64939c1ef0be518e0"
dependencies = [
"arboard",
- "egui 0.26.0",
+ "egui 0.26.1",
"log",
"puffin",
"raw-window-handle 0.6.0",
@@ -953,11 +923,11 @@ dependencies = [
[[package]]
name = "egui_extras"
-version = "0.26.0"
+version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34bb4782902b4c314ab3bef2dd8a23c634df2e88978fa358cd2c09fb60bab172"
+checksum = "011213c1c95821080d1ea7a28cb2928f89df4d794a4c5f0ed034958966c58860"
dependencies = [
- "egui 0.26.0",
+ "egui 0.26.1",
"enum-map",
"image",
"log",
@@ -968,12 +938,12 @@ dependencies = [
[[package]]
name = "egui_glow"
-version = "0.26.0"
+version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3b8d8d33da3d2ae4db39b30ddcbc5f31e9b0d74e65dc028cf711e94b68ec4d6"
+checksum = "95307de94643fc205543c4145f2ce254685f6a6ead906393e3996ede9a67b87f"
dependencies = [
"bytemuck",
- "egui 0.26.0",
+ "egui 0.26.1",
"egui-winit",
"glow",
"log",
@@ -1011,9 +981,9 @@ checksum = "3ee58355767587db7ba3738930d93cad3052cd834c2b48b9ef6ef26fe4823b7e"
[[package]]
name = "emath"
-version = "0.26.0"
+version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ba2475f57a416ce2a05e557f3d18e465c7aef23f3f6da2252b428eaaaaa6a65"
+checksum = "2386663fafbd043f2cd14f0ded4702deb9348fb7e7bacba9c9087a31b17487f1"
dependencies = [
"bytemuck",
"serde",
@@ -1118,15 +1088,15 @@ dependencies = [
[[package]]
name = "epaint"
-version = "0.26.0"
+version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b823734a8b7e81302a5f1a8ba041ab4ed7805a43d8dfec4dac0c72b933699bbc"
+checksum = "36ac8c9ca960f0263856a7fbc90d7ad41280e8865a7cd3c64d3daec016bd7115"
dependencies = [
"ab_glyph",
"ahash",
"bytemuck",
- "ecolor 0.26.0",
- "emath 0.26.0",
+ "ecolor 0.26.1",
+ "emath 0.26.1",
"log",
"nohash-hasher",
"parking_lot",
@@ -2118,6 +2088,36 @@ dependencies = [
]
[[package]]
+name = "notedeck"
+version = "0.1.0"
+dependencies = [
+ "android-activity 0.4.3",
+ "android_logger",
+ "console_error_panic_hook",
+ "eframe",
+ "egui 0.26.1",
+ "egui_extras",
+ "ehttp",
+ "enostr",
+ "env_logger 0.10.2",
+ "image",
+ "log",
+ "nostrdb",
+ "poll-promise",
+ "puffin",
+ "puffin_egui",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "tokio",
+ "tracing",
+ "tracing-subscriber",
+ "tracing-wasm",
+ "wasm-bindgen-futures",
+ "winit",
+]
+
+[[package]]
name = "nu-ansi-term"
version = "0.46.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3982,21 +3982,21 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows"
-version = "0.52.0"
+version = "0.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
+checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9"
dependencies = [
"windows-core",
- "windows-targets 0.52.0",
+ "windows-targets 0.48.5",
]
[[package]]
name = "windows-core"
-version = "0.52.0"
+version = "0.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
+checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64"
dependencies = [
- "windows-targets 0.52.0",
+ "windows-targets 0.48.5",
]
[[package]]
diff --git a/src/app.rs b/src/app.rs
@@ -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::{
@@ -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());
}