mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Merge pull request #1887 from Adriankhl/fix_dropbox_left_click
Fix: close dropbox with left mouse click outside of the dropbox
This commit is contained in:
commit
d00fa5bf86
@ -394,6 +394,10 @@ void TemplatesDropBox::ListItem::clickLeft(tribool down, bool previousState)
|
||||
{
|
||||
dropBox.setTemplate(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
dropBox.clickLeft(true, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -449,8 +453,14 @@ void TemplatesDropBox::clickLeft(tribool down, bool previousState)
|
||||
{
|
||||
if(down && !hovered)
|
||||
{
|
||||
assert(GH.topInt().get() == this);
|
||||
GH.popInt(GH.topInt());
|
||||
auto w = widget<CSlider>("slider");
|
||||
|
||||
// pop the interface only if the mouse is not clicking on the slider
|
||||
if (!w || !w->mouseState(MouseButton::LEFT))
|
||||
{
|
||||
assert(GH.topInt().get() == this);
|
||||
GH.popInt(GH.topInt());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user