add scroll_offset to NoteAction::Note
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -24,7 +24,11 @@ pub enum NoteAction {
|
|||||||
Profile(Pubkey),
|
Profile(Pubkey),
|
||||||
|
|
||||||
/// User has clicked a note link
|
/// User has clicked a note link
|
||||||
Note { note_id: NoteId, preview: bool },
|
Note {
|
||||||
|
note_id: NoteId,
|
||||||
|
preview: bool,
|
||||||
|
scroll_offset: f32,
|
||||||
|
},
|
||||||
|
|
||||||
/// User has selected some context option
|
/// User has selected some context option
|
||||||
Context(ContextSelection),
|
Context(ContextSelection),
|
||||||
@@ -44,6 +48,7 @@ impl NoteAction {
|
|||||||
NoteAction::Note {
|
NoteAction::Note {
|
||||||
note_id: id,
|
note_id: id,
|
||||||
preview: false,
|
preview: false,
|
||||||
|
scroll_offset: 0.0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,11 @@ fn execute_note_action(
|
|||||||
.open(ndb, note_cache, txn, pool, &kind)
|
.open(ndb, note_cache, txn, pool, &kind)
|
||||||
.map(NotesOpenResult::Timeline);
|
.map(NotesOpenResult::Timeline);
|
||||||
}
|
}
|
||||||
NoteAction::Note { note_id, preview } => 'ex: {
|
NoteAction::Note {
|
||||||
|
note_id,
|
||||||
|
preview,
|
||||||
|
scroll_offset,
|
||||||
|
} => 'ex: {
|
||||||
let Ok(thread_selection) = ThreadSelection::from_note_id(ndb, note_cache, txn, note_id)
|
let Ok(thread_selection) = ThreadSelection::from_note_id(ndb, note_cache, txn, note_id)
|
||||||
else {
|
else {
|
||||||
tracing::error!("No thread selection for {}?", hex::encode(note_id.bytes()));
|
tracing::error!("No thread selection for {}?", hex::encode(note_id.bytes()));
|
||||||
|
|||||||
@@ -195,6 +195,7 @@ fn strip_note_action(action: NoteAction) -> Option<NoteAction> {
|
|||||||
NoteAction::Note {
|
NoteAction::Note {
|
||||||
note_id: _,
|
note_id: _,
|
||||||
preview: false,
|
preview: false,
|
||||||
|
scroll_offset: _,
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
return None;
|
return None;
|
||||||
|
|||||||
@@ -363,6 +363,7 @@ fn render_undecorated_note_contents<'a>(
|
|||||||
NoteAction::Note { note_id, .. } => NoteAction::Note {
|
NoteAction::Note { note_id, .. } => NoteAction::Note {
|
||||||
note_id,
|
note_id,
|
||||||
preview: true,
|
preview: true,
|
||||||
|
scroll_offset: 0.0,
|
||||||
},
|
},
|
||||||
other => other,
|
other => other,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user