diff options
author | Eugene Sandulenko | 2006-05-27 05:46:04 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2006-05-27 05:46:04 +0000 |
commit | b56c7b88d7de665f92e1600f81dcec5c4af3a2aa (patch) | |
tree | 08f6922d09a77b9d4f93c3aa354436e0e4c5713e /engines/scumm | |
parent | 3d0aa0a4d9fa36de8b8697ed65d8c1f4a6356a07 (diff) | |
download | scummvm-rg350-b56c7b88d7de665f92e1600f81dcec5c4af3a2aa.tar.gz scummvm-rg350-b56c7b88d7de665f92e1600f81dcec5c4af3a2aa.tar.bz2 scummvm-rg350-b56c7b88d7de665f92e1600f81dcec5c4af3a2aa.zip |
Major GUI update:
- Implemented padding in console
- Update only current line in console instead of whole screen
- Fixed caret positioning in edit text widget
- Improved buttons drawing, now they look more realistic
- Added label spacing in popup widget
- Correct shadow in popup widget
- Fixed up with selected popup widget being drawn on wrong tab
- Added shading to list dialog
- Adjusted shading of inactive widgets
- Proper coloring of browset (add game) dialog
- Introduced Container widget
- Used Container widget in scumm save/load dialog. Now it looks properly
- Adjusted button colors even more. Now they match almost perfectly albeit with banding
- Made scrollbar appear only when it is really needed
svn-id: r22670
Diffstat (limited to 'engines/scumm')
-rw-r--r-- | engines/scumm/dialogs.cpp | 116 | ||||
-rw-r--r-- | engines/scumm/dialogs.h | 1 |
2 files changed, 30 insertions, 87 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 12c034d835..e552785fff 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -244,57 +244,21 @@ SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel, _list->setEditable(saveMode); _list->setNumberingMode(saveMode ? GUI::kListNumberingOne : GUI::kListNumberingZero); - if (g_gui.evaluator()->getVar("scummsaveload_extinfo.visible") == 1) { - int thumbX = g_gui.evaluator()->getVar("scummsaveload_thumbnail.x"); - int thumbY = g_gui.evaluator()->getVar("scummsaveload_thumbnail.y"); + _container = new GUI::ContainerWidget(this, 0, 0, 10, 10); + _container->setHints(GUI::THEME_HINT_USE_SHADOW); - // Add the thumbnail display - _gfxWidget = new GUI::GraphicsWidget(this, - thumbX, thumbY, - kThumbnailWidth + 8, - ((_vm->_system->getHeight() % 200 && _vm->_system->getHeight() != 350) ? kThumbnailHeight2 : kThumbnailHeight1) + 8); - _gfxWidget->setFlags(GUI::WIDGET_BORDER); + _gfxWidget = new GUI::GraphicsWidget(this, 0, 0, 10, 10); - int height = thumbY + ((_vm->_system->getHeight() % 200 && _vm->_system->getHeight() != 350) ? kThumbnailHeight2 : kThumbnailHeight1) + 8; - - _date = new StaticTextWidget(this, - thumbX, - height, - kThumbnailWidth + 8, - kLineHeight, - "No date saved", - kTextAlignCenter); - - height += kLineHeight; - - _time = new StaticTextWidget(this, - thumbX, - height, - kThumbnailWidth + 8, - kLineHeight, - "No time saved", - kTextAlignCenter); - - height += kLineHeight; - - _playtime = new StaticTextWidget(this, - thumbX, - height, - kThumbnailWidth + 8, - kLineHeight, - "No playtime saved", - kTextAlignCenter); - } else { - _gfxWidget = 0; - _date = 0; - _time = 0; - _playtime = 0; - } + _date = new StaticTextWidget(this, 0, 0, 10, 10, "No date saved", kTextAlignCenter); + _time = new StaticTextWidget(this, 0, 0, 10, 10, "No time saved", kTextAlignCenter); + _playtime = new StaticTextWidget(this, 0, 0, 10, 10, "No playtime saved", kTextAlignCenter); // Buttons new GUI::ButtonWidget(this, "scummsaveload_cancel", "Cancel", kCloseCmd, 0); _chooseButton = new GUI::ButtonWidget(this, "scummsaveload_choose", buttonLabel, kChooseCmd, 0); _chooseButton->setEnabled(false); + + handleScreenChanged(); } SaveLoadChooser::~SaveLoadChooser() { @@ -358,62 +322,40 @@ void SaveLoadChooser::handleScreenChanged() { if (g_gui.evaluator()->getVar("scummsaveload_extinfo.visible") == 1) { int thumbX = g_gui.evaluator()->getVar("scummsaveload_thumbnail.x"); int thumbY = g_gui.evaluator()->getVar("scummsaveload_thumbnail.y"); + int hPad = g_gui.evaluator()->getVar("scummsaveload_thumbnail.hPad"); + int vPad = g_gui.evaluator()->getVar("scummsaveload_thumbnail.vPad"); + int thumbH = ((_vm->_system->getHeight() % 200 && _vm->_system->getHeight() != 350) ? kThumbnailHeight2 : kThumbnailHeight1); + + _container->resize(thumbX - hPad, thumbY - vPad, kThumbnailWidth + hPad * 2, thumbH + vPad * 2 + kLineHeight * 4); // Add the thumbnail display - if (!_gfxWidget) { - _gfxWidget = new GUI::GraphicsWidget(this, 0, 0, 0, 0); - _gfxWidget->setFlags(GUI::WIDGET_BORDER); - } - _gfxWidget->resize(thumbX, thumbY, kThumbnailWidth + 8, - ((_vm->_system->getHeight() % 200 && _vm->_system->getHeight() != 350) ? kThumbnailHeight2 : kThumbnailHeight1) + 8); + _gfxWidget->resize(thumbX, thumbY, kThumbnailWidth, thumbH); - int height = thumbY + ((_vm->_system->getHeight() % 200 && _vm->_system->getHeight() != 350) ? kThumbnailHeight2 : kThumbnailHeight1) + 8; + int height = thumbY + thumbH + kLineHeight; - if (!_date) - _date = new StaticTextWidget(this, 0, 0, 0, 0, "", kTextAlignCenter); - _date->resize(thumbX, height, kThumbnailWidth + 8, kLineHeight); + _date->resize(thumbX, height, kThumbnailWidth, kLineHeight); height += kLineHeight; - if (!_time) - _time = new StaticTextWidget(this, 0, 0, 0, 0, "", kTextAlignCenter); - _time->resize(thumbX, height, kThumbnailWidth + 8, kLineHeight); + _time->resize(thumbX, height, kThumbnailWidth, kLineHeight); height += kLineHeight; - if (!_playtime) - _playtime = new StaticTextWidget(this, 0, 0, 0, 0, "", kTextAlignCenter); - _playtime->resize(thumbX, height, kThumbnailWidth + 8, kLineHeight); + _playtime->resize(thumbX, height, kThumbnailWidth, kLineHeight); + _container->clearFlags(GUI::WIDGET_INVISIBLE); + _gfxWidget->clearFlags(GUI::WIDGET_INVISIBLE); + _date->clearFlags(GUI::WIDGET_INVISIBLE); + _time->clearFlags(GUI::WIDGET_INVISIBLE); + _playtime->clearFlags(GUI::WIDGET_INVISIBLE); + updateInfos(); } else { - if (_gfxWidget) { - deleteWidget(_gfxWidget); - _gfxWidget->setNext(0); - delete _gfxWidget; - _gfxWidget = 0; - } - - if (_date) { - deleteWidget(_date); - _date->setNext(0); - delete _date; - _date = 0; - } - - if (_time) { - deleteWidget(_time); - _time->setNext(0); - delete _time; - _time = 0; - } - - if (_playtime) { - deleteWidget(_playtime); - _playtime->setNext(0); - delete _playtime; - _playtime = 0; - } + _container->setFlags(GUI::WIDGET_INVISIBLE); + _gfxWidget->setFlags(GUI::WIDGET_INVISIBLE); + _date->setFlags(GUI::WIDGET_INVISIBLE); + _time->setFlags(GUI::WIDGET_INVISIBLE); + _playtime->setFlags(GUI::WIDGET_INVISIBLE); } Dialog::handleScreenChanged(); diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h index dff5c64ecc..339b890558 100644 --- a/engines/scumm/dialogs.h +++ b/engines/scumm/dialogs.h @@ -61,6 +61,7 @@ protected: GUI::StaticTextWidget *_date; GUI::StaticTextWidget *_time; GUI::StaticTextWidget *_playtime; + GUI::ContainerWidget *_container; ScummEngine *_vm; void updateInfos(); |