dave: improve multi-note display

This commit is contained in:
William Casarin
2025-04-20 09:05:02 -07:00
parent a33aad1f62
commit 5811a5f4e6
3 changed files with 42 additions and 22 deletions

View File

@@ -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),
);
}
}

View File

@@ -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,