Skip to content

Commit

Permalink
1. Support to set list item' selectedIcon in Editor.
Browse files Browse the repository at this point in the history
2. Set popup's sorting order automatically.
  • Loading branch information
gzytom committed Mar 18, 2018
1 parent 011482c commit a0bb47d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libfairygui/Classes/GList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2518,6 +2518,9 @@ void GList::setup_BeforeAdd(TXMLElement * xml)
p = ix->Attribute("name");
if (p)
obj->name = p;
p = ix->Attribute("selectedIcon");
if (p && dynamic_cast<GButton*>(obj))
dynamic_cast<GButton*>(obj)->setSelectedIcon(p);
}

ix = ix->NextSiblingElement("item");
Expand Down
17 changes: 17 additions & 0 deletions libfairygui/Classes/GRoot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,23 @@ void GRoot::showPopup(GObject * popup, GObject * target, PopupDirection dir)

_popupStack.push_back(WeakPtr(popup));

if (target != nullptr)
{
GObject* p = target;
while (p != nullptr)
{
if (p->getParent() == this)
{
if (popup->getSortingOrder() < p->getSortingOrder())
{
popup->setSortingOrder(p->getSortingOrder());
}
break;
}
p = p->getParent();
}
}

addChild(popup);
adjustModalLayer();

Expand Down

0 comments on commit a0bb47d

Please sign in to comment.