bsnes-libretro/hiro/qt/popup-menu.cpp
byuu 903d1e4012 v107.8
* GB: integrated SameBoy v0.12.1 by Lior Halphon
* SFC: added HG51B169 (Cx4) math tables into bsnes binary
2019-07-17 21:11:46 +09:00

41 lines
739 B
C++
Executable File

#if defined(Hiro_PopupMenu)
namespace hiro {
auto pPopupMenu::construct() -> void {
qtPopupMenu = new QMenu;
_setState();
}
auto pPopupMenu::destruct() -> void {
delete qtPopupMenu;
qtPopupMenu = nullptr;
}
auto pPopupMenu::append(sAction action) -> void {
_setState();
}
auto pPopupMenu::remove(sAction action) -> void {
_setState();
}
auto pPopupMenu::setFont(const Font& font) -> void {
_setState();
}
auto pPopupMenu::setVisible(bool visible) -> void {
if(visible) qtPopupMenu->popup(QCursor::pos());
}
auto pPopupMenu::_setState() -> void {
qtPopupMenu->setFont(pFont::create(self().font(true)));
for(auto& action : state().actions) {
if(auto self = action->self()) self->_setState();
}
}
}
#endif