From de26d3c099fc53d26916486019e29e13252dc5d3 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 19 Feb 2019 16:31:00 +0100 Subject: [PATCH] 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". --- repos/gems/src/app/sculpt_manager/graph.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/repos/gems/src/app/sculpt_manager/graph.h b/repos/gems/src/app/sculpt_manager/graph.h index a10a73d845..5a80abc333 100644 --- a/repos/gems/src/app/sculpt_manager/graph.h +++ b/repos/gems/src/app/sculpt_manager/graph.h @@ -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) {