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.
This commit is contained in:
Norman Feske 2020-03-04 11:16:25 +01:00 committed by Christian Helmuth
parent c856ba2a49
commit e54e4dd532
1 changed files with 3 additions and 4 deletions

View File

@ -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");