note/action: add ScrollInfo

I might need this... lets add it just in case

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2025-07-10 09:01:41 -07:00
parent bb0262e09e
commit e4e8d7fcf3
5 changed files with 29 additions and 4 deletions

View File

@@ -51,7 +51,7 @@ pub use muted::{MuteFun, Muted};
pub use name::NostrName;
pub use note::{
BroadcastContext, ContextSelection, NoteAction, NoteContext, NoteContextSelection, NoteRef,
RootIdError, RootNoteId, RootNoteIdBuf, ZapAction,
RootIdError, RootNoteId, RootNoteIdBuf, ScrollInfo, ZapAction,
};
pub use notecache::{CachedNote, NoteCache};
pub use persist::*;

View File

@@ -1,8 +1,15 @@
use super::context::ContextSelection;
use crate::{zaps::NoteZapTargetOwned, Images, MediaCacheType, TexturedImage};
use egui::Vec2;
use enostr::{NoteId, Pubkey};
use poll_promise::Promise;
#[derive(Debug)]
pub struct ScrollInfo {
pub velocity: Vec2,
pub offset: Vec2,
}
#[derive(Debug)]
pub enum NoteAction {
/// User has clicked the quote reply action
@@ -28,6 +35,9 @@ pub enum NoteAction {
/// User clicked on media
Media(MediaAction),
/// User scrolled the timeline
Scroll(ScrollInfo),
}
impl NoteAction {

View File

@@ -1,7 +1,7 @@
mod action;
mod context;
pub use action::{MediaAction, NoteAction, ZapAction, ZapTargetAmount};
pub use action::{MediaAction, NoteAction, ScrollInfo, ZapAction, ZapTargetAmount};
pub use context::{BroadcastContext, ContextSelection, NoteContextSelection};
use crate::JobPool;