gui update: put newly appearing windows on top

This commit is contained in:
turanszkij
2020-04-11 19:17:15 +01:00
parent 1c923ae22e
commit 2ba847cf58
5 changed files with 20 additions and 4 deletions
+1
View File
@@ -367,6 +367,7 @@ MaterialWindow::MaterialWindow(EditorComponent* editor) : GUI(&editor->GetGUI())
y = 0;
materialNameField = new wiTextInputField("MaterialName");
materialNameField->SetTooltip("Set a name for the material...");
materialNameField->SetPos(XMFLOAT2(10, y += step));
materialNameField->SetSize(XMFLOAT2(300, 25));
materialNameField->OnInputAccepted([&](wiEventArgs args) {
+7
View File
@@ -106,6 +106,12 @@ void wiGUI::Update(float dt)
{
focus = true;
}
if (widget->priority_change)
{
widget->priority_change = false;
priorityChangeQueue.push_back(widget);
}
}
for (auto& widget : priorityChangeQueue)
@@ -184,6 +190,7 @@ void wiGUI::ActivateWidget(wiWidget* widget)
{
if (std::find(widgets.begin(), widgets.end(), widget) != widgets.end())
{
widget->priority_change = false;
priorityChangeQueue.push_back(widget);
}
if (activeWidget == nullptr)
+1 -1
View File
@@ -9,7 +9,7 @@ namespace wiVersion
// minor features, major updates
const int minor = 39;
// minor bug fixes, alterations, refactors, updates
const int revision = 56;
const int revision = 57;
long GetVersion()
+10 -2
View File
@@ -188,7 +188,11 @@ wiWidget::WIDGETSTATE wiWidget::GetState() const
}
void wiWidget::SetEnabled(bool val)
{
enabled = val;
if (enabled != val)
{
priority_change |= val;
enabled = val;
}
}
bool wiWidget::IsEnabled() const
{
@@ -196,7 +200,11 @@ bool wiWidget::IsEnabled() const
}
void wiWidget::SetVisible(bool val)
{
visible = val;
if (visible != val)
{
priority_change |= val;
visible = val;
}
}
bool wiWidget::IsVisible() const
{
+1 -1
View File
@@ -47,7 +47,7 @@ protected:
std::string scriptTip;
bool enabled = true;
bool visible = true;
uint32_t foregroundPriority = 0;
bool priority_change = true;
WIDGETSTATE state = IDLE;
void Activate();