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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user