From 7460aa5e3b249ce53fcde0cfd6babcdfd0680dcc Mon Sep 17 00:00:00 2001 From: Olaf Wintermann Date: Thu, 21 May 2026 19:10:56 +0200 Subject: [PATCH] add notebook uidoc --- application/src/main.rs | 1 + application/src/notebook.rs | 17 +++++++++++++++++ application/src/window.rs | 7 +++++++ entity/src/lib.rs | 3 ++- entity/src/note.rs | 29 +++++++++++++++++++++++++++++ 5 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 application/src/notebook.rs create mode 100644 entity/src/note.rs diff --git a/application/src/main.rs b/application/src/main.rs index 4a5620a..fe08b48 100644 --- a/application/src/main.rs +++ b/application/src/main.rs @@ -29,6 +29,7 @@ mod window; mod backend; mod newnotebook; +mod notebook; use std::env; use entity::collection::{create_notebook_hierarchy, Node}; diff --git a/application/src/notebook.rs b/application/src/notebook.rs new file mode 100644 index 0000000..80df474 --- /dev/null +++ b/application/src/notebook.rs @@ -0,0 +1,17 @@ +use ui_rs::{action, ui_actions, UiModel}; +use ui_rs::ui::*; + +use entity::note::Model as Note; + +#[derive(UiModel, Default)] +pub struct Notebook { + #[bind] + pub notes: UiList +} + +#[ui_actions] +impl Notebook { + pub fn new() -> Self { + Default::default() + } +} diff --git a/application/src/window.rs b/application/src/window.rs index fad8730..d1bd531 100644 --- a/application/src/window.rs +++ b/application/src/window.rs @@ -32,6 +32,7 @@ use crate::App; use entity::collection::{Model as Collection, Node}; use crate::backend::{BackendHandle, BroadcastMessage}; use crate::newnotebook::new_notebook_dialog; +use crate::notebook::Notebook; #[derive(UiModel)] pub struct MainWindow { @@ -39,6 +40,8 @@ pub struct MainWindow { pub backend: BackendHandle, + selected_notebook: Option>, + groups: Vec, #[bind] @@ -51,6 +54,7 @@ impl MainWindow { MainWindow { obj: UiObjRef::default(), backend: app.backend.clone(), + selected_notebook: None, groups: Vec::new(), notebooks: UiSourceList::default() } @@ -120,6 +124,9 @@ pub fn create_window(app: &App, ctx: &AppContext) -> UiObject