change setting "borderless" to "window border"

set window border on setting changes
disable window border checkbox in the launcher if fullscreen is enabled
This commit is contained in:
Sebastian Wick 2014-12-24 15:09:50 +01:00
parent ebd384455f
commit e85df00158
10 changed files with 23 additions and 15 deletions

View file

@ -159,8 +159,8 @@ bool Launcher::GraphicsPage::loadSettings()
if (mGraphicsSettings.value(QString("Video/fullscreen")) == QLatin1String("true")) if (mGraphicsSettings.value(QString("Video/fullscreen")) == QLatin1String("true"))
fullScreenCheckBox->setCheckState(Qt::Checked); fullScreenCheckBox->setCheckState(Qt::Checked);
if (mGraphicsSettings.value(QString("Video/borderless")) == QLatin1String("true")) if (mGraphicsSettings.value(QString("Video/window border")) == QLatin1String("true"))
borderlessCheckBox->setCheckState(Qt::Checked); windowBorderCheckBox->setCheckState(Qt::Checked);
int aaIndex = antiAliasingComboBox->findText(mGraphicsSettings.value(QString("Video/antialiasing"))); int aaIndex = antiAliasingComboBox->findText(mGraphicsSettings.value(QString("Video/antialiasing")));
if (aaIndex != -1) if (aaIndex != -1)
@ -196,8 +196,8 @@ void Launcher::GraphicsPage::saveSettings()
fullScreenCheckBox->checkState() ? mGraphicsSettings.setValue(QString("Video/fullscreen"), QString("true")) fullScreenCheckBox->checkState() ? mGraphicsSettings.setValue(QString("Video/fullscreen"), QString("true"))
: mGraphicsSettings.setValue(QString("Video/fullscreen"), QString("false")); : mGraphicsSettings.setValue(QString("Video/fullscreen"), QString("false"));
borderlessCheckBox->checkState() ? mGraphicsSettings.setValue(QString("Video/borderless"), QString("true")) windowBorderCheckBox->checkState() ? mGraphicsSettings.setValue(QString("Video/window border"), QString("true"))
: mGraphicsSettings.setValue(QString("Video/borderless"), QString("false")); : mGraphicsSettings.setValue(QString("Video/window border"), QString("false"));
mGraphicsSettings.setValue(QString("Video/antialiasing"), antiAliasingComboBox->currentText()); mGraphicsSettings.setValue(QString("Video/antialiasing"), antiAliasingComboBox->currentText());
mGraphicsSettings.setValue(QString("Video/render system"), rendererComboBox->currentText()); mGraphicsSettings.setValue(QString("Video/render system"), rendererComboBox->currentText());
@ -337,10 +337,12 @@ void Launcher::GraphicsPage::slotFullScreenChanged(int state)
customRadioButton->setEnabled(false); customRadioButton->setEnabled(false);
customWidthSpinBox->setEnabled(false); customWidthSpinBox->setEnabled(false);
customHeightSpinBox->setEnabled(false); customHeightSpinBox->setEnabled(false);
windowBorderCheckBox->setEnabled(false);
} else { } else {
customRadioButton->setEnabled(true); customRadioButton->setEnabled(true);
customWidthSpinBox->setEnabled(true); customWidthSpinBox->setEnabled(true);
customHeightSpinBox->setEnabled(true); customHeightSpinBox->setEnabled(true);
windowBorderCheckBox->setEnabled(true);
} }
} }

View file

@ -350,7 +350,7 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
OEngine::Render::WindowSettings windowSettings; OEngine::Render::WindowSettings windowSettings;
windowSettings.fullscreen = settings.getBool("fullscreen", "Video"); windowSettings.fullscreen = settings.getBool("fullscreen", "Video");
windowSettings.borderless = settings.getBool("borderless", "Video"); windowSettings.window_border = settings.getBool("window border", "Video");
windowSettings.window_x = settings.getInt("resolution x", "Video"); windowSettings.window_x = settings.getInt("resolution x", "Video");
windowSettings.window_y = settings.getInt("resolution y", "Video"); windowSettings.window_y = settings.getInt("resolution y", "Video");
windowSettings.screen = settings.getInt("screen", "Video"); windowSettings.screen = settings.getInt("screen", "Video");

View file

@ -166,7 +166,7 @@ namespace MWGui
getWidget(mResolutionList, "ResolutionList"); getWidget(mResolutionList, "ResolutionList");
getWidget(mFullscreenButton, "FullscreenButton"); getWidget(mFullscreenButton, "FullscreenButton");
getWidget(mVSyncButton, "VSyncButton"); getWidget(mVSyncButton, "VSyncButton");
getWidget(mBorderlessButton, "BorderlessButton"); getWidget(mWindowBorderButton, "WindowBorderButton");
getWidget(mFPSButton, "FPSButton"); getWidget(mFPSButton, "FPSButton");
getWidget(mFOVSlider, "FOVSlider"); getWidget(mFOVSlider, "FOVSlider");
getWidget(mAnisotropySlider, "AnisotropySlider"); getWidget(mAnisotropySlider, "AnisotropySlider");

View file

@ -28,7 +28,7 @@ namespace MWGui
MyGUI::ListBox* mResolutionList; MyGUI::ListBox* mResolutionList;
MyGUI::Button* mFullscreenButton; MyGUI::Button* mFullscreenButton;
MyGUI::Button* mVSyncButton; MyGUI::Button* mVSyncButton;
MyGUI::Button* mBorderlessButton; MyGUI::Button* mWindowBorderButton;
MyGUI::Button* mFPSButton; MyGUI::Button* mFPSButton;
MyGUI::ScrollBar* mFOVSlider; MyGUI::ScrollBar* mFOVSlider;
MyGUI::ScrollBar* mDifficultySlider; MyGUI::ScrollBar* mDifficultySlider;

View file

@ -753,6 +753,8 @@ void RenderingManager::processChangedSettings(const Settings::CategorySettingVec
|| it->second == "resolution y" || it->second == "resolution y"
|| it->second == "fullscreen")) || it->second == "fullscreen"))
changeRes = true; changeRes = true;
else if (it->first == "Video" && it->second == "window border")
changeRes = true;
else if (it->second == "field of view" && it->first == "General") else if (it->second == "field of view" && it->first == "General")
mRendering.setFov(Settings::Manager::getFloat("field of view", "General")); mRendering.setFov(Settings::Manager::getFloat("field of view", "General"));
else if ((it->second == "texture filtering" && it->first == "General") else if ((it->second == "texture filtering" && it->first == "General")
@ -810,6 +812,7 @@ void RenderingManager::processChangedSettings(const Settings::CategorySettingVec
unsigned int x = Settings::Manager::getInt("resolution x", "Video"); unsigned int x = Settings::Manager::getInt("resolution x", "Video");
unsigned int y = Settings::Manager::getInt("resolution y", "Video"); unsigned int y = Settings::Manager::getInt("resolution y", "Video");
bool fullscreen = Settings::Manager::getBool("fullscreen", "Video"); bool fullscreen = Settings::Manager::getBool("fullscreen", "Video");
bool windowBorder = Settings::Manager::getBool("window border", "Video");
SDL_Window* window = mRendering.getSDLWindow(); SDL_Window* window = mRendering.getSDLWindow();
@ -828,7 +831,10 @@ void RenderingManager::processChangedSettings(const Settings::CategorySettingVec
SDL_SetWindowFullscreen(window, fullscreen); SDL_SetWindowFullscreen(window, fullscreen);
} }
else else
{
SDL_SetWindowSize(window, x, y); SDL_SetWindowSize(window, x, y);
SDL_SetWindowBordered(window, windowBorder ? SDL_TRUE : SDL_FALSE);
}
} }
mWater->processChangedSettings(settings); mWater->processChangedSettings(settings);

View file

@ -240,13 +240,13 @@
</Widget> </Widget>
</Widget> </Widget>
<Widget type="HBox" skin="" position="182 64 300 24"> <Widget type="HBox" skin="" position="182 64 300 24">
<Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Top" name="BorderlessButton"> <Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Top" name="WindowBorderButton">
<UserString key="SettingCategory" value="Video"/> <UserString key="SettingCategory" value="Video"/>
<UserString key="SettingName" value="borderless"/> <UserString key="SettingName" value="window border"/>
<UserString key="SettingType" value="CheckButton"/> <UserString key="SettingType" value="CheckButton"/>
</Widget> </Widget>
<Widget type="AutoSizedTextBox" skin="SandText" position="28 4 48 16" align="Left Top"> <Widget type="AutoSizedTextBox" skin="SandText" position="28 4 48 16" align="Left Top">
<Property key="Caption" value="Borderless"/> <Property key="Caption" value="Window border"/>
</Widget> </Widget>
</Widget> </Widget>
<Widget type="HBox" skin="" position="182 94 300 24"> <Widget type="HBox" skin="" position="182 94 300 24">

View file

@ -6,7 +6,7 @@ resolution x = 800
resolution y = 600 resolution y = 600
fullscreen = false fullscreen = false
borderless = false window border = true
screen = 0 screen = 0
# Minimize the window if it loses key focus? # Minimize the window if it loses key focus?

View file

@ -51,9 +51,9 @@
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QCheckBox" name="borderlessCheckBox"> <widget class="QCheckBox" name="windowBorderCheckBox">
<property name="text"> <property name="text">
<string>Borderless</string> <string>Window border</string>
</property> </property>
</widget> </widget>
</item> </item>

View file

@ -130,7 +130,7 @@ void OgreRenderer::createWindow(const std::string &title, const WindowSettings&
SDL_WINDOW_SHOWN SDL_WINDOW_SHOWN
| SDL_WINDOW_RESIZABLE | SDL_WINDOW_RESIZABLE
| (settings.fullscreen ? SDL_WINDOW_FULLSCREEN : 0) | (settings.fullscreen ? SDL_WINDOW_FULLSCREEN : 0)
| (settings.borderless ? SDL_WINDOW_BORDERLESS : 0) | (settings.window_border ? 0 : SDL_WINDOW_BORDERLESS)
); );
SFO::SDLWindowHelper helper(mSDLWindow, settings.window_x, settings.window_y, title, settings.fullscreen, params); SFO::SDLWindowHelper helper(mSDLWindow, settings.window_x, settings.window_y, title, settings.fullscreen, params);

View file

@ -37,7 +37,7 @@ namespace OEngine
{ {
bool vsync; bool vsync;
bool fullscreen; bool fullscreen;
bool borderless; bool window_border;
int window_x, window_y; int window_x, window_y;
int screen; int screen;
std::string fsaa; std::string fsaa;