gui update: put newly appearing windows on top
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user