1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 21:53:51 +00:00

fix custom resolution maximum

This commit is contained in:
Sebastian Wick 2013-06-22 19:15:13 +02:00
parent 4c8a04d9cb
commit 0e29286856
2 changed files with 17 additions and 1 deletions

View file

@ -35,7 +35,7 @@ GraphicsPage::GraphicsPage(Files::ConfigurationManager &cfg, GraphicsSettings &g
setupUi(this); setupUi(this);
// Set the maximum res we can set in windowed mode // Set the maximum res we can set in windowed mode
QRect res = QApplication::desktop()->screenGeometry(); QRect res = getMaximumResolution();
customWidthSpinBox->setMaximum(res.width()); customWidthSpinBox->setMaximum(res.width());
customHeightSpinBox->setMaximum(res.height()); customHeightSpinBox->setMaximum(res.height());
@ -289,6 +289,21 @@ QStringList GraphicsPage::getAvailableResolutions(Ogre::RenderSystem *renderer)
return result; return result;
} }
QRect GraphicsPage::getMaximumResolution()
{
QRect max, res;
int i, screens = QApplication::desktop()->screenCount();
for (i = 0; i < screens; i++)
{
res = QApplication::desktop()->screenGeometry(i);
if (res.width() > max.width())
max.setWidth(res.width());
if (res.height() > max.height())
max.setHeight(res.height());
}
return max;
}
void GraphicsPage::rendererChanged(const QString &renderer) void GraphicsPage::rendererChanged(const QString &renderer)
{ {
mSelectedRenderSystem = mOgre->getRenderSystemByName(renderer.toStdString()); mSelectedRenderSystem = mOgre->getRenderSystemByName(renderer.toStdString());

View file

@ -56,6 +56,7 @@ private:
QStringList getAvailableOptions(const QString &key, Ogre::RenderSystem *renderer); QStringList getAvailableOptions(const QString &key, Ogre::RenderSystem *renderer);
QStringList getAvailableResolutions(Ogre::RenderSystem *renderer); QStringList getAvailableResolutions(Ogre::RenderSystem *renderer);
QRect getMaximumResolution();
void loadSettings(); void loadSettings();