mirror of
https://github.com/scummvm/scummvm.git
synced 2024-05-31 18:27:36 -04:00
Revert "GUI: Don't enforce full redraw upon closing tool tip"
Unfortunately, it is not that simple. Tooltip may be placed also outside
of the dialog. Current implementation leaves tooltip leftovers over
the dialog below the topmost one, so reverting until I find a correct
way to achieve the goal.
This reverts commit 19b7b2aa20
.
This commit is contained in:
parent
b8881955de
commit
915dce50ea
|
@ -97,19 +97,4 @@ 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,8 +43,6 @@ 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(bool redraw) {
|
||||
void GuiManager::closeTopDialog() {
|
||||
// Don't do anything if no dialog is open
|
||||
if (_dialogStack.empty())
|
||||
return;
|
||||
|
@ -627,12 +627,10 @@ void GuiManager::closeTopDialog(bool redraw) {
|
|||
giveFocusToDialog(dialog);
|
||||
}
|
||||
|
||||
if (redraw) {
|
||||
if (_redrawStatus != kRedrawFull)
|
||||
_redrawStatus = kRedrawCloseDialog;
|
||||
if (_redrawStatus != kRedrawFull)
|
||||
_redrawStatus = kRedrawCloseDialog;
|
||||
|
||||
this->redraw();
|
||||
}
|
||||
redraw();
|
||||
}
|
||||
|
||||
void GuiManager::setupCursor() {
|
||||
|
|
|
@ -71,7 +71,6 @@ 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;
|
||||
|
@ -212,7 +211,7 @@ protected:
|
|||
void restoreState();
|
||||
|
||||
void openDialog(Dialog *dialog);
|
||||
void closeTopDialog(bool redraw = true);
|
||||
void closeTopDialog();
|
||||
|
||||
void redraw();
|
||||
|
||||
|
|
Loading…
Reference in a new issue