# HG changeset patch # User displacer # Date 1218118123 0 # Node ID 40eeae82e70bf3ee85877389ad57e278293cdb7b # Parent a241f6eb48beb84becef34c4530681363726a24f correct restoring window size after fullscreen mode diff -r a241f6eb48be -r 40eeae82e70b QTfrontend/gameuiconfig.cpp --- a/QTfrontend/gameuiconfig.cpp Thu Aug 07 13:39:04 2008 +0000 +++ b/QTfrontend/gameuiconfig.cpp Thu Aug 07 14:08:43 2008 +0000 @@ -33,7 +33,8 @@ { Form = FormWidgets; - Form->resize(value("window/width", 640).toUInt(), value("window/height", 450).toUInt()); + //Form->resize(value("window/width", 640).toUInt(), value("window/height", 450).toUInt()); + resizeToConfigValues(); int t = Form->ui.pageOptions->CBResolution->findText(value("video/resolution").toString()); Form->ui.pageOptions->CBResolution->setCurrentIndex((t < 0) ? 0 : t); @@ -74,6 +75,11 @@ return cleanedList; } +void GameUIConfig::resizeToConfigValues() +{ + Form->resize(value("window/width", 640).toUInt(), value("window/height", 450).toUInt()); +} + void GameUIConfig::SaveOptions() { setValue("video/resolution", Form->ui.pageOptions->CBResolution->currentText()); @@ -81,6 +87,12 @@ bool ffscr=isFrontendFullscreen(); setValue("video/frontendfullscreen", ffscr); emit frontendFullscreen(ffscr); + if (!ffscr) { + setValue("window/width", Form->width()); + setValue("window/height", Form->height()); + } else { + resizeToConfigValues(); + } setValue("audio/sound", isSoundEnabled()); setValue("audio/music", isMusicEnabled()); @@ -95,9 +107,6 @@ setValue("fps/interval", Form->ui.pageOptions->fpsedit->value()); setValue("misc/altdamage", isAltDamageEnabled()); - - setValue("window/width", Form->width()); - setValue("window/height", Form->height()); } QRect GameUIConfig::vid_Resolution() diff -r a241f6eb48be -r 40eeae82e70b QTfrontend/gameuiconfig.h --- a/QTfrontend/gameuiconfig.h Thu Aug 07 13:39:04 2008 +0000 +++ b/QTfrontend/gameuiconfig.h Thu Aug 07 14:08:43 2008 +0000 @@ -43,6 +43,7 @@ quint8 bitDepth(); QString netNick(); bool isFrontendFullscreen() const; + void resizeToConfigValues(); signals: void frontendFullscreen(bool value); diff -r a241f6eb48be -r 40eeae82e70b QTfrontend/hwform.cpp --- a/QTfrontend/hwform.cpp Thu Aug 07 13:39:04 2008 +0000 +++ b/QTfrontend/hwform.cpp Thu Aug 07 14:08:43 2008 +0000 @@ -132,7 +132,6 @@ void HWForm::onFrontendFullscreen(bool value) { - qDebug() << "fullscreen = " << value; if (value) setWindowState(windowState() | Qt::WindowFullScreen); else {