Reverted previous commit.

svn-id: r36226
This commit is contained in:
Vicent Marti 2009-02-06 23:28:08 +00:00
parent 30189f09d9
commit 108d4cfbd0
6 changed files with 44 additions and 18 deletions

View file

@ -139,20 +139,29 @@ void GuiManager::redraw() {
if (_dialogStack.empty()) if (_dialogStack.empty())
return; return;
if (_dialogStack.size() > 1) { switch (_redrawStatus) {
case kRedrawCloseDialog:
case kRedrawFull:
case kRedrawTopDialog:
_theme->clearAll(); _theme->clearAll();
_theme->openDialog(true); _theme->openDialog(true);
for (i = 0; i < _dialogStack.size() - 1; i++) for (i = 0; i < _dialogStack.size() - 1; i++) {
_dialogStack[i]->drawDialog(); _dialogStack[i]->drawDialog();
_theme->finishBuffering();
_theme->updateScreen();
} }
_theme->finishBuffering();
case kRedrawOpenDialog:
_theme->updateScreen();
_theme->openDialog(true, (ThemeEngine::ShadingStyle)xmlEval()->getVar("Dialog." + _dialogStack.top()->_name + ".Shading", 0)); _theme->openDialog(true, (ThemeEngine::ShadingStyle)xmlEval()->getVar("Dialog." + _dialogStack.top()->_name + ".Shading", 0));
_dialogStack.top()->drawDialog(); _dialogStack.top()->drawDialog();
_theme->finishBuffering(); _theme->finishBuffering();
break;
default:
return;
}
_theme->updateScreen(); _theme->updateScreen();
_redrawStatus = kRedrawDisabled; _redrawStatus = kRedrawDisabled;
@ -238,6 +247,8 @@ void GuiManager::runLoop() {
if (_useStdCursor) if (_useStdCursor)
setupCursor(); setupCursor();
// _theme->refresh();
_themeChange = false; _themeChange = false;
_redrawStatus = kRedrawFull; _redrawStatus = kRedrawFull;
redraw(); redraw();
@ -336,7 +347,8 @@ void GuiManager::restoreState() {
void GuiManager::openDialog(Dialog *dialog) { void GuiManager::openDialog(Dialog *dialog) {
_dialogStack.push(dialog); _dialogStack.push(dialog);
_redrawStatus = kRedrawFull; if (_redrawStatus != kRedrawFull)
_redrawStatus = kRedrawOpenDialog;
// We reflow the dialog just before opening it. If the screen changed // We reflow the dialog just before opening it. If the screen changed
// since the last time we looked, also refresh the loaded theme, // since the last time we looked, also refresh the loaded theme,
@ -352,7 +364,8 @@ void GuiManager::closeTopDialog() {
// Remove the dialog from the stack // Remove the dialog from the stack
_dialogStack.pop(); _dialogStack.pop();
_redrawStatus = kRedrawFull; if (_redrawStatus != kRedrawFull)
_redrawStatus = kRedrawCloseDialog;
} }
void GuiManager::setupCursor() { void GuiManager::setupCursor() {

View file

@ -91,6 +91,9 @@ public:
protected: protected:
enum RedrawStatus { enum RedrawStatus {
kRedrawDisabled = 0, kRedrawDisabled = 0,
kRedrawOpenDialog,
kRedrawCloseDialog,
kRedrawTopDialog,
kRedrawFull kRedrawFull
}; };

View file

@ -43,7 +43,7 @@ enum {
*/ */
BrowserDialog::BrowserDialog(const char *title, bool dirBrowser) BrowserDialog::BrowserDialog(const char *title, bool dirBrowser)
: Dialog("Browser") { : Dialog("browser") {
_titleRef = CFStringCreateWithCString(0, title, CFStringGetSystemEncoding()); _titleRef = CFStringCreateWithCString(0, title, CFStringGetSystemEncoding());
_isDirBrowser = dirBrowser; _isDirBrowser = dirBrowser;
} }

View file

@ -131,7 +131,11 @@ void Dialog::releaseFocus() {
} }
void Dialog::draw() { void Dialog::draw() {
g_gui._redrawStatus = GUI::GuiManager::kRedrawFull; //TANOKU - FIXME when is this enabled? what does this do?
// Update: called on tab drawing, mainly...
// we can pass this as open a new dialog or something
// g_gui._needRedraw = true;
g_gui._redrawStatus = GUI::GuiManager::kRedrawTopDialog;
} }
void Dialog::drawDialog() { void Dialog::drawDialog() {

View file

@ -251,8 +251,6 @@ void OptionsDialog::open() {
_subMode = getSubtitleMode(ConfMan.getBool("subtitles", _domain), ConfMan.getBool("speech_mute", _domain)); _subMode = getSubtitleMode(ConfMan.getBool("subtitles", _domain), ConfMan.getBool("speech_mute", _domain));
_subToggleButton->setLabel(_subModeDesc[_subMode]); _subToggleButton->setLabel(_subModeDesc[_subMode]);
_subToggleButton->draw();
// Engines that reuse the subtitle speed widget set their own max value. // Engines that reuse the subtitle speed widget set their own max value.
// Scale the config value accordingly (see addSubtitleControls) // Scale the config value accordingly (see addSubtitleControls)

View file

@ -199,7 +199,15 @@ void StaticTextWidget::setValue(int value) {
void StaticTextWidget::setLabel(const Common::String &label) { void StaticTextWidget::setLabel(const Common::String &label) {
_label = label; _label = label;
this->draw();
// get parent's size
const uint16 w = _boss->getWidth();
const uint16 h = _boss->getHeight();
const int16 x = _boss->getAbsX();
const int16 y = _boss->getAbsY();
// restore the parent's background and redraw it again.
g_gui.theme()->restoreBackground(Common::Rect(x, y, x + w, y + h));
_boss->draw(); _boss->draw();
} }