]> uap-core.de Git - note.git/commitdiff
add UI for file notes
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Tue, 14 Jul 2026 17:35:35 +0000 (19:35 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Tue, 14 Jul 2026 17:35:35 +0000 (19:35 +0200)
application/note/src/note.rs
application/note/src/window.rs

index 6307b1eb184e01149d7643e82f0a9c0962fda44d..3a70e93c5f16f3099d04ec1e9068c75c607e1c1c 100644 (file)
@@ -152,6 +152,7 @@ impl Note {
         let tab = match model.kind {
             NoteType::PlainTextNote => NoteTypeTabView::TextArea,
             NoteType::MDTextNote => NoteTypeTabView::TextArea,
+            NoteType::File => NoteTypeTabView::File,
             _ => NoteTypeTabView::Empty
         };
         self.note_type.set(tab as i64);
index 14269eadbc06fda890a5d331d2ee36aa760318a5..17af135460454841a68c9265030bb8829727d28b 100644 (file)
@@ -266,6 +266,34 @@ pub fn create_window(app: &App, ctx: &AppContext<MainWindow>) -> UiObject<MainWi
                             textarea.focus();
                         });
                     });
+
+                    tabview.tab("file", |obj| {
+                        obj.grid(
+                            |g|{
+                                g.fill(true);
+                                g.margin(8);
+                                g.columnspacing(8);
+                                g.rowspacing(8);
+                                g.def_vfill(true);
+                            },
+                            |obj|{
+                                obj.grid_row(|obj|{
+                                    obj.rlabel(|l|{
+                                        l.label("Name");
+                                    });
+                                    obj.textfield(|t|{
+                                        t.hexpand(true);
+                                        t.hfill(true);
+                                        t.varname("note_nodename");
+                                    });
+                                    obj.button(|b|{
+                                        b.label("Open");
+                                        b.action("open_extern");
+                                    });
+                                });
+                            }
+                        );
+                    });
                 });
         });
     });
@@ -298,7 +326,8 @@ fn find_notebook(sourcelist: &UiSourceList<NotebookItem>, collection_id: i32) ->
 
 pub enum NoteTypeTabView {
     Empty = 0,
-    TextArea = 1
+    TextArea = 1,
+    File = 2,
 }
 
 #[derive(Default)]