change setting "borderless" to "window border"

set window border on setting changes
disable window border checkbox in the launcher if fullscreen is enabled
pull/410/head
Sebastian Wick 10 years ago
parent ebd384455f
commit e85df00158

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

@ -350,7 +350,7 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
OEngine::Render::WindowSettings windowSettings;
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_y = settings.getInt("resolution y", "Video");
windowSettings.screen = settings.getInt("screen", "Video");

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

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

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

@ -240,13 +240,13 @@
</Widget>
</Widget>
<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="SettingName" value="borderless"/>
<UserString key="SettingName" value="window border"/>
<UserString key="SettingType" value="CheckButton"/>
</Widget>
<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 type="HBox" skin="" position="182 94 300 24">

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

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

@ -130,7 +130,7 @@ void OgreRenderer::createWindow(const std::string &title, const WindowSettings&
SDL_WINDOW_SHOWN
| SDL_WINDOW_RESIZABLE
| (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);

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

Loading…
Cancel
Save