aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorEugene Sandulenko2006-04-18 00:37:04 +0000
committerEugene Sandulenko2006-04-18 00:37:04 +0000
commit5daa835cc724db34bcd47c9fddaf44317fa5b83e (patch)
treedc9376e3930e2ac9ed9bfecc43bd249e94a00e54 /gui
parent1c9c14011be6f8da8aa8298bdaca66f7b135a59d (diff)
downloadscummvm-rg350-5daa835cc724db34bcd47c9fddaf44317fa5b83e.tar.gz
scummvm-rg350-5daa835cc724db34bcd47c9fddaf44317fa5b83e.tar.bz2
scummvm-rg350-5daa835cc724db34bcd47c9fddaf44317fa5b83e.zip
- PopUpWidget (drop down list) does not shadow underlying dialog anymore
- Remove reduntant code in drawing pipeline. Topmost dialog was drawn up to 4 times svn-id: r21998
Diffstat (limited to 'gui')
-rw-r--r--gui/PopUpWidget.cpp2
-rw-r--r--gui/dialog.cpp10
-rw-r--r--gui/dialog.h8
-rw-r--r--gui/newgui.cpp22
4 files changed, 23 insertions, 19 deletions
diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp
index dd40c911be..09b68c882f 100644
--- a/gui/PopUpWidget.cpp
+++ b/gui/PopUpWidget.cpp
@@ -68,7 +68,7 @@ protected:
};
PopUpDialog::PopUpDialog(PopUpWidget *boss, int clickX, int clickY, WidgetSize ws)
- : Dialog(0, 0, 16, 16),
+ : Dialog(0, 0, 16, 16, false),
_popUpBoss(boss) {
// Copy the selection index
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 6514442c37..0f264c5d6a 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -39,15 +39,17 @@ namespace GUI {
* ...
*/
-Dialog::Dialog(int x, int y, int w, int h)
+Dialog::Dialog(int x, int y, int w, int h, bool dimsInactive_)
: GuiObject(x, y, w, h),
- _mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false), _drawingHints(0) {
+ _mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false), _drawingHints(0),
+ _dimsInactive(dimsInactive_) {
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
}
-Dialog::Dialog(Common::String name)
+Dialog::Dialog(Common::String name, bool dimsInactive_)
: GuiObject(name),
- _mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false), _drawingHints(0) {
+ _mouseWidget(0), _focusedWidget(0), _dragWidget(0), _visible(false), _drawingHints(0),
+ _dimsInactive(dimsInactive_) {
_drawingHints = THEME_HINT_FIRST_DRAW | THEME_HINT_SAVE_BACKGROUND;
}
diff --git a/gui/dialog.h b/gui/dialog.h
index dde9ec0976..794aaa2395 100644
--- a/gui/dialog.h
+++ b/gui/dialog.h
@@ -49,10 +49,11 @@ protected:
private:
int _result;
+ bool _dimsInactive;
public:
- Dialog(int x, int y, int w, int h);
- Dialog(Common::String name);
+ Dialog(int x, int y, int w, int h, bool dimsInactive = true);
+ Dialog(Common::String name, bool dimsInactive = true);
virtual ~Dialog();
virtual int runModal();
@@ -84,6 +85,9 @@ protected:
void setResult(int result) { _result = result; }
int getResult() const { return _result; }
+
+ // Whether dialog dims all underneath dialogs or not when active
+ bool dimsInactive() { return _dimsInactive; }
};
} // End of namespace GUI
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index 20d79e8ffc..fb3a0ff103 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -139,19 +139,8 @@ void NewGui::runLoop() {
didSaveState = true;
}
- // small 'HACK': complete gui redraw (needed for new theme inactive dialog color change possibilities)
- _theme->clearAll();
-
int i;
- for (i = 0; i < _dialogStack.size() - 1; ++i) {
- _theme->closeDialog();
- }
- for (i = 0; i < _dialogStack.size() - 1; i++) {
- _theme->openDialog(false);
- }
- _theme->openDialog(true);
-
while (!_dialogStack.empty() && activeDialog == _dialogStack.top()) {
activeDialog->handleTickle();
@@ -164,7 +153,16 @@ void NewGui::runLoop() {
_theme->closeDialog();
}
for (i = 0; i < _dialogStack.size(); i++) {
- _theme->openDialog(i == (_dialogStack.size() - 1));
+ // Special treatment when topmost dialog has dimsInactive() set to false
+ // This is the case for PopUpWidget which should not dim a dialog
+ // which it belongs to
+ if ((i == _dialogStack.size() - 2) && !_dialogStack[i + 1]->dimsInactive())
+ _theme->openDialog(true);
+ else if ((i != (_dialogStack.size() - 1)) || !_dialogStack[i]->dimsInactive())
+ _theme->openDialog(false);
+ else
+ _theme->openDialog(true);
+
_dialogStack[i]->drawDialog();
}
_needRedraw = false;