PopupWidget/ContextMenu is now dynamic; one can add items after it is created.

This commit is contained in:
Stephen Anthony 2019-06-08 22:30:19 -02:30
parent 2ed934d718
commit 00dbf96acc
2 changed files with 6 additions and 2 deletions

View File

@ -98,6 +98,9 @@ void Dialog::open()
// dialogs cause drawing to occur within loadConfig()
if (_surface == nullptr)
_surface = instance().frameBuffer().allocateSurface(_w, _h);
else if (_w > _surface->width() || _h > _surface->height())
_surface->resize(_w, _h);
_surface->setSrcSize(_w, _h);
_layer = parent().addDialog(this);
// Take hidpi scaling into account

View File

@ -477,7 +477,7 @@ void UIDialog::handleRomViewer()
myOpenBrowserButton->setEnabled(enable);
mySnapLoadPath->setEnabled(enable);
/*items.clear();
items.clear();
VarList::push_back(items, "Off", "0");
VarList::push_back(items, "1x (640x480) ", "1");
if(myLauncherWidthSlider->getValue() >= 1000 &&
@ -487,7 +487,8 @@ void UIDialog::handleRomViewer()
}
myRomViewerPopup->addItems(items);
//myRomViewerPopup->setSelected("1x(640x480) ");*/
// FIXME (remove when done) - Thomas, you can continue from here ...
//myRomViewerPopup->setSelected("1x(640x480) ");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -