From e54e4dd5320543a554d40d85862fe6383dcff194 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 4 Mar 2020 11:16:25 +0100 Subject: [PATCH] sculpt: anchor popup position at '+' button This patch restores the anchoring of the popup menu to the original behavior, placing the popup to the right of the '+' button. The anchoring got lost due to the recent structural changes of the GUI, which affect the hover XML structure. --- repos/gems/src/app/sculpt_manager/graph.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/repos/gems/src/app/sculpt_manager/graph.cc b/repos/gems/src/app/sculpt_manager/graph.cc index 941b9706c..aa1b8ecf3 100644 --- a/repos/gems/src/app/sculpt_manager/graph.cc +++ b/repos/gems/src/app/sculpt_manager/graph.cc @@ -282,7 +282,9 @@ Dialog::Hover_result Graph::hover(Xml_node hover) if (_add_button_item.hovered("global+")) { /* update anchor geometry of popup menu */ - auto hovered_rect = [] (Xml_node const hover) { + auto hovered_rect = [] (Xml_node const dialog) + { + if (!dialog.has_type("dialog")) return Rect(); auto point_from_xml = [] (Xml_node node) { return Point(node.attribute_value("xpos", 0L), @@ -292,9 +294,6 @@ Dialog::Hover_result Graph::hover(Xml_node hover) return Area(node.attribute_value("width", 0UL), node.attribute_value("height", 0UL)); }; - if (!hover.has_sub_node("dialog")) return Rect(); - Xml_node const dialog = hover.sub_node("dialog"); - if (!dialog.has_sub_node("depgraph")) return Rect(); Xml_node const depgraph = dialog.sub_node("depgraph");