def construct_ui(u: Declarative.DeclarativeUI) -> Declarative.UIDescription: title_field = u.create_line_edit(text="@binding(title_model.value)") add_button = u.create_push_button(text="Add", on_clicked="add_mode") modes_menu = u.create_combo_box(name="modes_menu", items_ref="@binding(mode_titles_model.value)", current_index="@binding(model.mode_index)") modes_stack = u.create_stack(items="model.modes", item_component_id="mode", current_index="@binding(model.mode_index)") modes_group = u.create_group(modes_stack) return u.create_column(title_field, add_button, modes_menu, modes_group, spacing=8, margin=12)
def construct_ui(u: Declarative.DeclarativeUI) -> Declarative.UIDescription: label = u.create_label(text="@binding(slider_value_model.value)") button = u.create_push_button(text="Reset to 50", on_clicked="reset") content = u.create_column(label, button, spacing=8) left = u.create_label(text="LEFT") right = u.create_label(text="RIGHT") group_row = u.create_row(left, u.create_stretch(), right, spacing=8) status_bar = u.create_group(group_row) return u.create_column(content, u.create_stretch(), status_bar, spacing=8)
def construct_ui(u: Declarative.DeclarativeUI) -> Declarative.UIDescription: slider = u.create_slider(value="@binding(slider_value_model.value)") progress_bar = u.create_progress_bar( value="@binding(slider_value_model.value)") label = u.create_label(text="@binding(slider_value_model.value)") button = u.create_push_button(text="Reset to 50", on_clicked="reset") group_column = u.create_column(slider, label, spacing=8) group = u.create_group(group_column, title="Group", margin=4) return u.create_column(progress_bar, group, button, spacing=8)