use entity::collection::{CollectionType, Model as Collection, Node};
use ui_rs::ui::widget::Widget;
use crate::attachment::Attachment;
+use crate::attachments_window::attachments_window_create;
use crate::newnotebook::new_notebook_dialog;
use crate::notebook::{notelist_getvalue, Notebook, NotebookItem};
.varname("note_attachments")
.container(SubContainer::HBox)
.createui(|obj, data, _i|{
+ let note_id = data.attachment.note_id;
+ let attachment_id = data.attachment.attachment_id;
let imgviewer = imageviewer!(obj,
scrollview = false,
- autoscale = true);
+ autoscale = true,
+ onbuttonpress = move|event|{
+ attachments_window_create(note_id, Some(attachment_id));
+ });
imgviewer.set_size(100, 80);
if let Some(thumbnail) = &data.attachment.thumbnail {
imgviewer.load_data(thumbnail);
}
-
})
.create();
});