Merge branch 'wip-orbtk' into no_locales
Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
@@ -41,12 +41,14 @@ impl State for MainViewState {
|
||||
main_view(ctx.widget())
|
||||
.list_mut()
|
||||
.push(format!("Item {}", len + 1));
|
||||
ctx.child("items").set::<usize>("blub", len + 1);
|
||||
ctx.child("items").clone_or_default::<usize>("Item");
|
||||
items_widget(ctx.child("items")).set_count(len + 1);
|
||||
button(ctx.child("remove-item-button")).set_enabled(true);
|
||||
button(ctx.child("remove-item-button")).set_visibility(Visibility::Visible);
|
||||
|
||||
if len == 4 {
|
||||
button(ctx.child("add-item-button")).set_enabled(false);
|
||||
button(ctx.child("add-item-button")).set_visibility(Visibility::Collapsed);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,10 +58,11 @@ impl State for MainViewState {
|
||||
main_view(ctx.widget()).list_mut().remove(len - 1);
|
||||
items_widget(ctx.child("items")).set_count(len - 1);
|
||||
button(ctx.child("add-item-button")).set_enabled(true);
|
||||
button(ctx.child("add-item-button")).set_visibility(Visibility::Visible);
|
||||
|
||||
if len == 1 {
|
||||
button(ctx.child("remove-item-button")).set_enabled(false);
|
||||
}
|
||||
button(ctx.child("remove-item-button")).set_visibility(Visibility::Collapsed); }
|
||||
}
|
||||
}
|
||||
Action::IncrementCounter => {
|
||||
@@ -189,7 +192,7 @@ impl Template for MainView {
|
||||
Button::new()
|
||||
.text("Button")
|
||||
.margin((0., 8., 0., 0.))
|
||||
.icon(material_icons_font_ttf::MD_CHECK)
|
||||
.icon(material_icons_font::MD_CHECK)
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::row(1))
|
||||
.on_click(move |states, _| {
|
||||
@@ -204,7 +207,7 @@ impl Template for MainView {
|
||||
.element("button")
|
||||
.class("primary")
|
||||
.margin((0., 8., 0., 0.))
|
||||
.icon(material_icons_font_ttf::MD_360)
|
||||
.icon(material_icons_font::MD_360)
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::row(2))
|
||||
.build(ctx),
|
||||
@@ -214,7 +217,7 @@ impl Template for MainView {
|
||||
.class("single_content")
|
||||
.text("ToggleButton")
|
||||
.margin((0., 8., 2., 0.))
|
||||
.icon(material_icons_font_ttf::MD_ALARM_ON)
|
||||
.icon(material_icons_font::MD_ALARM_ON)
|
||||
.attach(Grid::column(0))
|
||||
.attach(Grid::row(3))
|
||||
.build(ctx),
|
||||
@@ -300,7 +303,7 @@ impl Template for MainView {
|
||||
.margin((0., 8., 0., 0.))
|
||||
.class("single_content")
|
||||
.margin((0., 8., 8., 0.))
|
||||
.icon(material_icons_font_ttf::MD_CLEAR)
|
||||
.icon(material_icons_font::MD_CLEAR)
|
||||
.text("clear text")
|
||||
.on_click(move |states, _| {
|
||||
state(id, states).action(Action::ClearText);
|
||||
@@ -390,7 +393,7 @@ impl Template for MainView {
|
||||
.element("button")
|
||||
.class("single_content")
|
||||
.id("remove-item-button")
|
||||
.icon(material_icons_font_ttf::MD_REMOVE_CIRCLE)
|
||||
.icon(material_icons_font::MD_REMOVE_CIRCLE)
|
||||
.on_click(move |states, _| {
|
||||
state(id, states).action(Action::RemoveItem);
|
||||
true
|
||||
@@ -405,7 +408,7 @@ impl Template for MainView {
|
||||
.element("button")
|
||||
.class("single_content")
|
||||
.id("add-item-button")
|
||||
.icon(material_icons_font_ttf::MD_ADD_CIRCLE)
|
||||
.icon(material_icons_font::MD_ADD_CIRCLE)
|
||||
.on_click(move |states, _| {
|
||||
state(id, states).action(Action::AddItem);
|
||||
true
|
||||
|
||||
@@ -39,8 +39,7 @@ impl Template for PolicyCheckView {
|
||||
let policy_check_menu_button = Button::new()
|
||||
.id(ID_POLICY_CHECK_MENU_BUTTON)
|
||||
.margin((0.0, 0.0, 12.0, 12.0))
|
||||
.icon(material_icons_font_ttf::MD_MENU)
|
||||
//.icon(material_icons_font_ttf::MD_ADD_CIRCLE)
|
||||
.icon(material_icons_font::MD_MENU)
|
||||
.class(CLASS_ICON_ONLY)
|
||||
//.attach(Grid::row(0))
|
||||
.attach(Grid::column(2))
|
||||
@@ -271,7 +270,7 @@ impl Template for PolicyCheckView {
|
||||
// })
|
||||
.build(ctx),
|
||||
)
|
||||
//.icon(material_icons_font_ttf::MD_ADD_CIRCLE)
|
||||
//.icon(material_icons_font::MD_ADD_CIRCLE)
|
||||
// .child()
|
||||
// NumericBox::new()
|
||||
// .id(ID_POLICY_CHECK_POLICY_NUMBER)
|
||||
|
||||
Reference in New Issue
Block a user