]> uap-core.de Git - note.git/commitdiff
use new widget macros in the newnotebook dialog main
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Sat, 25 Jul 2026 10:32:52 +0000 (12:32 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Sat, 25 Jul 2026 10:32:52 +0000 (12:32 +0200)
application/note/src/newnotebook.rs

index 7c6a5199b4b85b08df77b757bac8c573ac647f9c..78e25f06248e4e90a8ebe3c4c97ae56c6e447e5a 100644 (file)
@@ -26,7 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 use backend::backend::BackendHandle;
-use ui_rs::{UiModel, ui_actions};
+use ui_rs::{UiModel, ui_actions, grid, rlabel, dropdown, textfield, llabel};
 use ui_rs::ui::*;
 use entity::collection::{Model as Collection};
 
@@ -109,26 +109,29 @@ pub fn new_notebook_dialog<T>(parent: &UiObject<T>, groups: &Vec<Collection>, ba
         data.groups.data_mut().extend(groups.clone());
 
         // create dialog UI
-        obj.grid(|a| {
-            a.margin(10);
-            a.columnspacing(10);
-            a.rowspacing(10);
-            a.def_hexpand(true);
-            a.def_hfill(true);
-            a.def_vfill(true);
-            a.fill(true);
-        }, |obj| {
-            obj.grid_row(|obj| {
-                obj.rlabel_builder().label("Group").create();
-                obj.dropdown_builder::<Collection>().value(&data.groups).getvalue(|e, _col, _row| ListValue::String(e.name.clone()) ).create();
-            });
-            obj.grid_row(|obj| {
-                obj.rlabel_builder().label("Name").create();
-                obj.textfield_builder().value(&data.name).create();
-            });
-            obj.grid_row(|obj| {
-                obj.llabel_builder().value(&data.message).colspan(2).create();
-            });
-        });
+        grid!(obj,
+            margin = 10,
+            columnspacing = 10,
+            rowspacing = 10,
+            def_hexpand = true,
+            def_hfill = true,
+            def_vfill = true,
+            fill = true,
+            |g|{
+                g.grid_row(|obj|{
+                    rlabel!(obj, label = "Group");
+                    dropdown!(obj,
+                        value = &data.groups,
+                        getvalue = |e: &Collection, _col, _row| ListValue::String(e.name.clone()));
+                });
+                g.grid_row(|obj|{
+                    rlabel!(obj, label = "Name");
+                    textfield!(obj, value = &data.name);
+                });
+                g.grid_row(|obj|{
+                    llabel!(obj, value = &data.message, colspan = 2);
+                });
+            }
+        );
     }).show();
 }
\ No newline at end of file