minimized ContextMenu redraws

fixed shading caused by ContextMenu
This commit is contained in:
thrust26 2020-11-12 14:37:50 +01:00
parent 090c480e1a
commit 3f6895126d
2 changed files with 16 additions and 3 deletions

View File

@ -346,8 +346,12 @@ int ContextMenu::findItem(int x, int y) const
void ContextMenu::drawCurrentSelection(int item)
{
// Change selection
_selectedOffset = item;
setDirty();
if(_selectedOffset != item)
{
_selectedOffset = item;
cerr << "ContextMenu" << endl;
setDirty();
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -240,7 +240,15 @@ void Dialog::render()
surface->render();
});
}
if(parent().myDialogStack.top() != this)
//cerr << "is ContextMenu "
// << (typeid(*parent().myDialogStack.top()) == typeid(ContextMenu)) << endl;
// Dialog is still on top if e.g a ContextMenu is opened
if(!(parent().myDialogStack.top() == this)
&& !((parent().myDialogStack.get(parent().myDialogStack.size() - 2) == this
//&& !(typeid(*parent().myDialogStack.top()) == typeid(ContextMenu)))
&& !parent().myDialogStack.top()->hasTitle())))
{
if(_shadeSurface == nullptr)
{
@ -432,6 +440,7 @@ void Dialog::drawDialog()
|| (parent().myDialogStack.get(parent().myDialogStack.size() - 2) == this
&& !parent().myDialogStack.top()->hasTitle());
cerr << "on top " << isOnTop() << endl;
if(clearsBackground())
{
// cerr << "Dialog::drawDialog(): w = " << _w << ", h = " << _h << " @ " << &s << endl << endl;