exit full screen before dialogs

This commit is contained in:
Christopher Mosher 2019-01-12 23:30:34 -05:00
parent 303f7b6a5e
commit c6c4eea94b
4 changed files with 9 additions and 0 deletions

View File

@ -270,6 +270,7 @@ void Config::tryParseLine(const std::string& line, Memory& ram, Memory& rom, Slo
std::getline(tok,fn_optional);
trim(fn_optional);
if (fn_optional.length() == 0) {
gui.exitFullScreen();
char const *ft[1] = { "*.woz" };
char const *fn = tinyfd_openFileDialog("Load floppy", "", 1, ft, "WOZ 2.0 disk images", 0);
if (fn) {

View File

@ -368,6 +368,7 @@ void Emulator::dispatchKeypress(const SDL_KeyboardEvent& keyEvent) {
return;
}// ...else exit the entire emulation
else if (sym == SDLK_F9) {
this->screenImage.exitFullScreen();
if (isSafeToQuit()) {
this->quit = true;
}

View File

@ -63,6 +63,12 @@ cassettename(32, ' ') {
createScreen();
}
void ScreenImage::exitFullScreen() {
if (this->fullscreen) {
toggleFullScreen();
}
}
void ScreenImage::toggleFullScreen() {
this->fullscreen = !this->fullscreen;
const int flags = this->fullscreen ? SDL_WINDOW_FULLSCREEN : 0;

View File

@ -51,6 +51,7 @@ public:
ScreenImage();
~ScreenImage();
void exitFullScreen();
void toggleFullScreen();
void drawPower(bool on);
void notifyObservers();