mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-18 17:14:21 +01:00
dave: improve multi-note display
This commit is contained in:
@@ -255,8 +255,12 @@ You are an AI agent for the nostr protocol called Dave, created by Damus. nostr
|
||||
|
||||
let txn = Transaction::new(note_context.ndb).unwrap();
|
||||
|
||||
egui::ScrollArea::horizontal().show(ui, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
egui::ScrollArea::horizontal()
|
||||
.max_height(400.0)
|
||||
.show(ui, |ui| {
|
||||
ui.with_layout(Layout::left_to_right(Align::Min), |ui| {
|
||||
ui.spacing_mut().item_spacing.x = 10.0;
|
||||
|
||||
for note_id in &call.note_ids {
|
||||
let Ok(note) =
|
||||
note_context.ndb.get_note_by_id(&txn, note_id.bytes())
|
||||
@@ -264,15 +268,16 @@ You are an AI agent for the nostr protocol called Dave, created by Damus. nostr
|
||||
continue;
|
||||
};
|
||||
|
||||
// TODO: remove current account thing, just add to note context
|
||||
notedeck_ui::NoteView::new(
|
||||
let mut note_view = notedeck_ui::NoteView::new(
|
||||
&mut note_context,
|
||||
&None,
|
||||
¬e,
|
||||
NoteOptions::default(),
|
||||
)
|
||||
.preview_style()
|
||||
.show(ui);
|
||||
.preview_style();
|
||||
|
||||
// TODO: remove current account thing, just add to note context
|
||||
ui.add_sized([400.0, 400.0], &mut note_view);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -211,9 +211,17 @@ pub fn render_note_contents(
|
||||
|
||||
BlockType::Text => {
|
||||
if options.has_scramble_text() {
|
||||
ui.add(egui::Label::new(rot13(block.as_str())).selectable(selectable));
|
||||
ui.add(
|
||||
egui::Label::new(rot13(block.as_str()))
|
||||
.wrap()
|
||||
.selectable(selectable),
|
||||
);
|
||||
} else {
|
||||
ui.add(egui::Label::new(block.as_str()).selectable(selectable));
|
||||
ui.add(
|
||||
egui::Label::new(block.as_str())
|
||||
.wrap()
|
||||
.selectable(selectable),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,12 @@ impl View for NoteView<'_, '_> {
|
||||
}
|
||||
*/
|
||||
|
||||
impl egui::Widget for &mut NoteView<'_, '_> {
|
||||
fn ui(self, ui: &mut egui::Ui) -> egui::Response {
|
||||
self.show(ui).response
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'd> NoteView<'a, 'd> {
|
||||
pub fn new(
|
||||
note_context: &'a mut NoteContext<'d>,
|
||||
@@ -69,9 +75,10 @@ impl<'a, 'd> NoteView<'a, 'd> {
|
||||
) -> Self {
|
||||
flags.set_actionbar(true);
|
||||
flags.set_note_previews(true);
|
||||
let framed = false;
|
||||
|
||||
let framed = false;
|
||||
let parent: Option<NoteKey> = None;
|
||||
|
||||
Self {
|
||||
note_context,
|
||||
cur_acc,
|
||||
|
||||
Reference in New Issue
Block a user