fixed toned down dialogs

This commit is contained in:
thrust26 2018-01-26 20:13:22 +01:00
parent 8c0b212207
commit a7308b4c0d
3 changed files with 10 additions and 1 deletions

View File

@ -44,6 +44,7 @@ class FixedStack
bool full() const { return _size >= CAPACITY; }
T top() const { return _stack[_size - 1]; }
T get(uInt32 pos) { return _stack[pos]; };
void push(const T& x) { _stack[_size++] = x; }
T pop() { return std::move(_stack[--_size]); }
uInt32 size() const { return _size; }

View File

@ -27,6 +27,10 @@
#include "Dialog.hxx"
#include "Widget.hxx"
#include "TabWidget.hxx"
#include "ContextMenu.hxx"
#include "PopUpWidget.hxx"
#include "Vec.hxx"
/*
@ -318,7 +322,10 @@ void Dialog::drawDialog()
if(_dirty)
{
bool onTop = parent().myDialogStack.top() == this;
// dialog is still on top if e.g a ContextMenu is opened
bool onTop = parent().myDialogStack.top() == this
|| parent().myDialogStack.get(parent().myDialogStack.size() - 2) == this
&& !parent().myDialogStack.top()->hasTitle();
if(_flags & WIDGET_CLEARBG)
{

View File

@ -87,6 +87,7 @@ class Dialog : public GuiObject
int getFlags() const { return _flags; }
void setTitle(const string& title);
bool hasTitle() { return !_title.empty(); }
protected:
virtual void draw() override { }