supply inner_rect for PostView

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-02-02 16:52:10 -05:00
parent 8c49e6e5f6
commit c1c4c1cc7a
5 changed files with 29 additions and 8 deletions

View File

@@ -22,6 +22,7 @@ pub struct PostView<'a> {
note_cache: &'a mut NoteCache,
poster: FilledKeypair<'a>,
id_source: Option<egui::Id>,
inner_rect: egui::Rect,
}
#[derive(Clone)]
@@ -84,6 +85,7 @@ impl<'a> PostView<'a> {
img_cache: &'a mut ImageCache,
note_cache: &'a mut NoteCache,
poster: FilledKeypair<'a>,
inner_rect: egui::Rect,
) -> Self {
let id_source: Option<egui::Id> = None;
PostView {
@@ -94,6 +96,7 @@ impl<'a> PostView<'a> {
poster,
id_source,
post_type,
inner_rect,
}
}
@@ -535,6 +538,7 @@ mod preview {
app.img_cache,
app.note_cache,
self.poster.to_filled(),
ui.available_rect_before_wrap(),
)
.ui(&txn, ui);
}

View File

@@ -14,6 +14,7 @@ pub struct QuoteRepostView<'a> {
draft: &'a mut Draft,
quoting_note: &'a nostrdb::Note<'a>,
id_source: Option<egui::Id>,
inner_rect: egui::Rect,
}
impl<'a> QuoteRepostView<'a> {
@@ -24,6 +25,7 @@ impl<'a> QuoteRepostView<'a> {
img_cache: &'a mut ImageCache,
draft: &'a mut Draft,
quoting_note: &'a nostrdb::Note<'a>,
inner_rect: egui::Rect,
) -> Self {
let id_source: Option<egui::Id> = None;
QuoteRepostView {
@@ -34,6 +36,7 @@ impl<'a> QuoteRepostView<'a> {
draft,
quoting_note,
id_source,
inner_rect,
}
}
@@ -48,6 +51,7 @@ impl<'a> QuoteRepostView<'a> {
self.img_cache,
self.note_cache,
self.poster,
self.inner_rect,
)
.id_source(id)
.ui(self.quoting_note.txn().unwrap(), ui)

View File

@@ -14,6 +14,7 @@ pub struct PostReplyView<'a> {
draft: &'a mut Draft,
note: &'a nostrdb::Note<'a>,
id_source: Option<egui::Id>,
inner_rect: egui::Rect,
}
impl<'a> PostReplyView<'a> {
@@ -24,6 +25,7 @@ impl<'a> PostReplyView<'a> {
note_cache: &'a mut NoteCache,
img_cache: &'a mut ImageCache,
note: &'a nostrdb::Note<'a>,
inner_rect: egui::Rect,
) -> Self {
let id_source: Option<egui::Id> = None;
PostReplyView {
@@ -34,6 +36,7 @@ impl<'a> PostReplyView<'a> {
note_cache,
img_cache,
id_source,
inner_rect,
}
}
@@ -83,6 +86,7 @@ impl<'a> PostReplyView<'a> {
self.img_cache,
self.note_cache,
self.poster,
self.inner_rect,
)
.id_source(id)
.ui(self.note.txn().unwrap(), ui)