]> uap-core.de Git - note.git/commitdiff
add new_notebook toolbar item
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Sat, 16 May 2026 12:07:44 +0000 (14:07 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Sat, 16 May 2026 12:07:44 +0000 (14:07 +0200)
application/src/main.rs
application/src/window.rs

index 78ae303b9ec99bf513d29f4840e4c392efb4be18..82dfcda18fe35f78cf1ee8caea45f78fb258df4a 100644 (file)
@@ -133,10 +133,12 @@ impl Application<MainWindow> for App {
 }
 
 fn create_toolbar(app: &AppContext<MainWindow>) {
+    app.toolbar_item("new_notebook").icon("folder-new").action("new_notebook").create();
     app.toolbar_item("go_back").icon("go-previous").action("go_back").create();
     app.toolbar_item("go_forward").icon("go-next").action("go_forward").create();
     app.toolbar_item("new_note").icon("document-new").action("new_note").create();
 
+    app.toolbar_add_default("new_notebook", ToolbarItemPosition::SidebarRight);
     app.toolbar_add_default("go_back", ToolbarItemPosition::Left);
     app.toolbar_add_default("go_forward", ToolbarItemPosition::Left);
     app.toolbar_add_default("new_note", ToolbarItemPosition::Left);
index 2880d3ae7f56624e327bf2cd960ee8088f16769a..e32fee984b0576295e2eac86cedb8a279efcb5ed 100644 (file)
@@ -40,7 +40,7 @@ pub struct MainWindow {
 #[ui_actions]
 impl MainWindow {
     #[action]
-    pub fn my_action(&mut self, _event: &ActionEvent) {
+    pub fn new_notebook(&mut self, _event: &ActionEvent) {
 
     }
 }