mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-24 19:45:07 +00:00
GUI: Don't enforce full redraw upon closing tool tip
This commit is contained in:
parent
751c79e6ff
commit
19b7b2aa20
@ -97,4 +97,19 @@ void Tooltip::drawDialog(DrawLayer layerToDraw) {
|
||||
}
|
||||
}
|
||||
|
||||
void Tooltip::close() {
|
||||
// copy&paste from Dialog::close()
|
||||
_visible = false;
|
||||
|
||||
if (_mouseWidget) {
|
||||
_mouseWidget->handleMouseLeft(0);
|
||||
_mouseWidget = nullptr;
|
||||
}
|
||||
releaseFocus();
|
||||
g_gui.closeTopDialog(false);
|
||||
|
||||
// instead of kRedrawCloseDialog schedule kRedrawTopDialog of the parent
|
||||
g_gui.scheduleTopDialogRedraw();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -43,6 +43,8 @@ public:
|
||||
|
||||
void receivedFocus(int x = -1, int y = -1) override {}
|
||||
protected:
|
||||
void close() override;
|
||||
|
||||
void handleMouseDown(int x, int y, int button, int clickCount) override {
|
||||
close();
|
||||
_parent->handleMouseDown(x + (getAbsX() - _parent->getAbsX()), y + (getAbsY() - _parent->getAbsY()), button, clickCount);
|
||||
|
@ -614,7 +614,7 @@ void GuiManager::openDialog(Dialog *dialog) {
|
||||
dialog->reflowLayout();
|
||||
}
|
||||
|
||||
void GuiManager::closeTopDialog() {
|
||||
void GuiManager::closeTopDialog(bool redraw) {
|
||||
// Don't do anything if no dialog is open
|
||||
if (_dialogStack.empty())
|
||||
return;
|
||||
@ -627,10 +627,12 @@ void GuiManager::closeTopDialog() {
|
||||
giveFocusToDialog(dialog);
|
||||
}
|
||||
|
||||
if (_redrawStatus != kRedrawFull)
|
||||
_redrawStatus = kRedrawCloseDialog;
|
||||
if (redraw) {
|
||||
if (_redrawStatus != kRedrawFull)
|
||||
_redrawStatus = kRedrawCloseDialog;
|
||||
|
||||
redraw();
|
||||
this->redraw();
|
||||
}
|
||||
}
|
||||
|
||||
void GuiManager::setupCursor() {
|
||||
|
@ -71,6 +71,7 @@ typedef Common::FixedStack<Dialog *> DialogStack;
|
||||
*/
|
||||
class GuiManager : public Common::Singleton<GuiManager>, public CommandSender {
|
||||
friend class Dialog;
|
||||
friend class Tooltip;
|
||||
friend class Common::Singleton<SingletonBaseType>;
|
||||
GuiManager();
|
||||
~GuiManager() override;
|
||||
@ -211,7 +212,7 @@ protected:
|
||||
void restoreState();
|
||||
|
||||
void openDialog(Dialog *dialog);
|
||||
void closeTopDialog();
|
||||
void closeTopDialog(bool redraw = true);
|
||||
|
||||
void redraw();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user