Fixed GUI resize

This commit is contained in:
Yousef Khadadeh 2026-04-07 20:33:48 +03:00
parent 3ee17cfd2b
commit a181a4d51d
6 changed files with 20 additions and 11 deletions

View file

@ -361,7 +361,18 @@ void MainProgram::input_key_callback(const InputManager::KeyCallbackArgs& key) {
}
case InputManager::KEY_FULLSCREEN: {
if(key.down && !key.repeat)
input.toggleFullscreen = true;
toggle_full_screen();
break;
}
case InputManager::KEY_SAVE: {
if(key.down && !key.repeat)
toolbar.save_func();
break;
}
case InputManager::KEY_SAVE_AS: {
if(key.down && !key.repeat)
toolbar.save_as_func();
break;
}
}
g.input_key_callback(key);
@ -451,6 +462,11 @@ void MainProgram::input_window_scale_callback(const InputManager::WindowScaleCal
post_callback();
}
void MainProgram::toggle_full_screen() {
window.fullscreen = !window.fullscreen;
SDL_SetWindowFullscreen(window.sdlWindow, window.fullscreen);
}
void MainProgram::close_set_to_close_tabs() {
if(!tabsToClose.empty()) {
std::erase_if(worlds, [&](auto& w) {