1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fixed UI updates on switching to/from fullscreen

This commit is contained in:
Ivan Savenko
2023-07-05 18:14:37 +03:00
parent 7e00a702c1
commit 2a634b2ec0
7 changed files with 31 additions and 21 deletions

View File

@@ -277,10 +277,18 @@ void GeneralOptionsTab::setGameResolution(int index)
gameRes["height"].Float() = resolution.y;
widget<CLabel>("resolutionLabel")->setText(resolutionToLabelString(resolution.x, resolution.y));
GH.dispatchMainThread([](){
boost::unique_lock<boost::recursive_mutex> lock(*CPlayerInterface::pim);
GH.onScreenResize();
});
}
void GeneralOptionsTab::setFullscreenMode(bool on, bool exclusive)
{
if (on == settings["video"]["fullscreen"].Bool() && exclusive == settings["video"]["realFullscreen"].Bool())
return;
setBoolSetting("video", "realFullscreen", exclusive);
setBoolSetting("video", "fullscreen", on);
@@ -288,12 +296,17 @@ void GeneralOptionsTab::setFullscreenMode(bool on, bool exclusive)
std::shared_ptr<CToggleButton> fullscreenBorderlessCheckbox = widget<CToggleButton>("fullscreenBorderlessCheckbox");
if (fullscreenBorderlessCheckbox)
fullscreenBorderlessCheckbox->setSelected(on && !exclusive);
fullscreenBorderlessCheckbox->setSelectedSilent(on && !exclusive);
if (fullscreenExclusiveCheckbox)
fullscreenExclusiveCheckbox->setSelected(on && exclusive);
fullscreenExclusiveCheckbox->setSelectedSilent(on && exclusive);
updateResolutionSelector();
GH.dispatchMainThread([](){
boost::unique_lock<boost::recursive_mutex> lock(*CPlayerInterface::pim);
GH.onScreenResize();
});
}
void GeneralOptionsTab::selectGameScaling()