minimized ContextMenu redraws

fixed shading caused by ContextMenu
This commit is contained in:
thrust26 2020-11-12 14:37:50 +01:00
parent 9819118b59
commit 907fc4edf3
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) void ContextMenu::drawCurrentSelection(int item)
{ {
// Change selection // Change selection
if(_selectedOffset != item)
{
_selectedOffset = item; _selectedOffset = item;
cerr << "ContextMenu" << endl;
setDirty(); setDirty();
}
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -240,7 +240,15 @@ void Dialog::render()
surface->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) if(_shadeSurface == nullptr)
{ {
@ -432,6 +440,7 @@ void Dialog::drawDialog()
|| (parent().myDialogStack.get(parent().myDialogStack.size() - 2) == this || (parent().myDialogStack.get(parent().myDialogStack.size() - 2) == this
&& !parent().myDialogStack.top()->hasTitle()); && !parent().myDialogStack.top()->hasTitle());
cerr << "on top " << isOnTop() << endl;
if(clearsBackground()) if(clearsBackground())
{ {
// cerr << "Dialog::drawDialog(): w = " << _w << ", h = " << _h << " @ " << &s << endl << endl; // cerr << "Dialog::drawDialog(): w = " << _w << ", h = " << _h << " @ " << &s << endl << endl;