sculpt: show '+' button only when partition 'used'

This prevents the situation where the user has booted the system, has
not yet selected a storage target to "use" for Sculpt, yet clicks on the
'+' menu. Such clicks show no immediate response because Sculpt cannot
know where to deploy the selected package. But since the user is not
guided towards resolving this prerequisite, it's better to not present
the menu in the first place. The '+' appears as soon as a storage target
is selected for "use".
This commit is contained in:
Norman Feske 2019-02-19 16:31:00 +01:00 committed by Christian Helmuth
parent db8b054fa4
commit de26d3c099
1 changed files with 8 additions and 6 deletions

View File

@ -153,14 +153,16 @@ struct Sculpt::Graph
xml.node("depgraph", [&] () {
gen_named_node(xml, "button", "global+", [&] () {
_add_button_item.gen_button_attr(xml, "global+");
if (_sculpt_partition.valid()) {
gen_named_node(xml, "button", "global+", [&] () {
_add_button_item.gen_button_attr(xml, "global+");
if (_popup_state == Popup::VISIBLE)
xml.attribute("selected", "yes");
if (_popup_state == Popup::VISIBLE)
xml.attribute("selected", "yes");
xml.node("label", [&] () {
xml.attribute("text", "+"); }); });
xml.node("label", [&] () {
xml.attribute("text", "+"); }); });
}
config.for_each_sub_node("start", [&] (Xml_node start) {