Skip to content

Commit a0bb47d

Browse files
author
gzytom
committed
1. Support to set list item' selectedIcon in Editor.
2. Set popup's sorting order automatically.
1 parent 011482c commit a0bb47d

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

libfairygui/Classes/GList.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,6 +2518,9 @@ void GList::setup_BeforeAdd(TXMLElement * xml)
25182518
p = ix->Attribute("name");
25192519
if (p)
25202520
obj->name = p;
2521+
p = ix->Attribute("selectedIcon");
2522+
if (p && dynamic_cast<GButton*>(obj))
2523+
dynamic_cast<GButton*>(obj)->setSelectedIcon(p);
25212524
}
25222525

25232526
ix = ix->NextSiblingElement("item");

libfairygui/Classes/GRoot.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,23 @@ void GRoot::showPopup(GObject * popup, GObject * target, PopupDirection dir)
233233

234234
_popupStack.push_back(WeakPtr(popup));
235235

236+
if (target != nullptr)
237+
{
238+
GObject* p = target;
239+
while (p != nullptr)
240+
{
241+
if (p->getParent() == this)
242+
{
243+
if (popup->getSortingOrder() < p->getSortingOrder())
244+
{
245+
popup->setSortingOrder(p->getSortingOrder());
246+
}
247+
break;
248+
}
249+
p = p->getParent();
250+
}
251+
}
252+
236253
addChild(popup);
237254
adjustModalLayer();
238255

0 commit comments

Comments
 (0)