]> uap-core.de Git - note.git/commitdiff
open attachments window when you click on a attachment in the note view main
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Thu, 3 Sep 2026 18:41:04 +0000 (20:41 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Thu, 3 Sep 2026 18:41:04 +0000 (20:41 +0200)
application/note/src/attachments_window.rs
application/note/src/window.rs

index 00cda9c03ab090c9f0195e6946c71677e65268c9..64c0d2fee755b29c010a1834b9205cd032403340 100644 (file)
@@ -48,6 +48,7 @@ pub fn attachments_window_create(note_id: i32, selected_attachment: Option<i32>)
             });
         });
     });
+    obj.show();
 }
 
 
index 6d877a416c33c64476d3ee5bba93e21e3c3e5c0f..e0451483076f27b2036c49f9575540ffc316898c 100644 (file)
@@ -34,6 +34,7 @@ use crate::{App, AppStates};
 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};
 
@@ -293,14 +294,18 @@ pub fn create_window(app: &App, ctx: &AppContext<MainWindow>) -> UiObject<MainWi
                                 .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();
                         });