* 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};
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