Overlay: I forgot about pop_document()

This in turn fixes a bug that I was about to bother encounter about, smh
This commit is contained in:
Irastris
2026-04-30 21:54:52 -04:00
parent 57061fba38
commit dca3e2eba6
3 changed files with 3 additions and 14 deletions
+2 -6
View File
@@ -135,8 +135,7 @@ Overlay::Overlay(OverlayProps props)
: Document("res/rml/overlay.rml"),
mOption(props.option),
mValueMin(props.valueMin),
mValueMax(props.valueMax),
mOpenerDocument(props.openerDocument) {
mValueMax(props.valueMax) {
if (mDocument == nullptr) {
return;
}
@@ -216,10 +215,7 @@ void Overlay::dismiss() {
return;
}
mDismissed = true;
if (mOpenerDocument != nullptr) {
mOpenerDocument->Show();
}
hide();
pop_document();
}
void Overlay::reset_default() {
-2
View File
@@ -50,7 +50,6 @@ struct OverlayProps {
Rml::String helpText;
int valueMin = 0;
int valueMax = 0;
Rml::ElementDocument* openerDocument = nullptr;
};
class Overlay : public Document {
@@ -78,7 +77,6 @@ private:
GraphicsOption mOption;
int mValueMin = 0;
int mValueMax = 0;
Rml::ElementDocument* mOpenerDocument = nullptr;
std::vector<std::unique_ptr<Component> > mComponents;
bool mDismissed = false;
};
+1 -6
View File
@@ -214,17 +214,12 @@ protected:
private:
void open_overlay() {
auto* openerDocument = mRoot != nullptr ? mRoot->GetOwnerDocument() : nullptr;
if (openerDocument != nullptr) {
openerDocument->Hide();
}
auto& overlay = push_document(std::make_unique<Overlay>(OverlayProps{
push_document(std::make_unique<Overlay>(OverlayProps{
.option = mOption,
.title = mTitle,
.helpText = mHelpText,
.valueMin = mValueMin,
.valueMax = mValueMax,
.openerDocument = openerDocument,
}));
}