From 00dbf96acc388616e606eace000309f62666ed14 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sat, 8 Jun 2019 22:30:19 -0230 Subject: [PATCH] PopupWidget/ContextMenu is now dynamic; one can add items after it is created. --- src/gui/Dialog.cxx | 3 +++ src/gui/UIDialog.cxx | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index 65c69a720..027015e2e 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -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 diff --git a/src/gui/UIDialog.cxx b/src/gui/UIDialog.cxx index 3859b660c..f2f1e1d17 100644 --- a/src/gui/UIDialog.cxx +++ b/src/gui/UIDialog.cxx @@ -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) "); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -