From be1fdf59bb80f963a4f97bfab49f59aca8d73d70 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Wed, 6 Apr 2016 17:22:02 +0300 Subject: GUI: When dialogs gain focus, inform them of the current mouse position Previously, they only reacted to the mouse position once it was moved. This meant that if the cursor was on a button that just gained focus, it did not highlight. Fixes #7101. --- gui/dialog.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gui/dialog.cpp') diff --git a/gui/dialog.cpp b/gui/dialog.cpp index 315c24e9bf..075a3bb533 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -119,6 +119,8 @@ void Dialog::reflowLayout() { } void Dialog::lostFocus() { + _dragWidget = NULL; + if (_tickleWidget) { _tickleWidget->lostFocus(); } -- cgit v1.2.3 From c7ad2155fc9153b700d55aea08eafa03d7343fc8 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 1 Jun 2016 12:10:33 +0200 Subject: GUI: More object initialization cleanup --- gui/dialog.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gui/dialog.cpp') diff --git a/gui/dialog.cpp b/gui/dialog.cpp index 075a3bb533..50b7755bb3 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -51,6 +51,8 @@ Dialog::Dialog(int x, int y, int w, int h) // will for example crash after returning to the launcher when the user // started a 640x480 game with a non 1x scaler. g_gui.checkScreenChange(); + + _result = -1; } Dialog::Dialog(const Common::String &name) @@ -66,6 +68,8 @@ Dialog::Dialog(const Common::String &name) // Fixes bug #1590596: "HE: When 3x graphics are choosen, F5 crashes game" // and bug #1595627: "SCUMM: F5 crashes game (640x480)" g_gui.checkScreenChange(); + + _result = -1; } int Dialog::runModal() { -- cgit v1.2.3 From 24963ac97d85a3d78d5b36d63be6cea6f63d178d Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Thu, 23 Jun 2016 22:54:07 +0600 Subject: GUI: Fix Dialog's and TabWidget's reflowLayout() --- gui/dialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gui/dialog.cpp') diff --git a/gui/dialog.cpp b/gui/dialog.cpp index 50b7755bb3..523227a237 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -113,13 +113,13 @@ void Dialog::reflowLayout() { // changed, so any cached image may be invalid. The subsequent redraw // should be treated as the very first draw. + GuiObject::reflowLayout(); + Widget *w = _firstWidget; while (w) { w->reflowLayout(); w = w->_next; } - - GuiObject::reflowLayout(); } void Dialog::lostFocus() { -- cgit v1.2.3