mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-15 17:25:06 +00:00
GUI: add toggle full-screen keybind
This commit is contained in:
parent
0952d1b2f9
commit
4f59eb2602
5 changed files with 9 additions and 3 deletions
|
@ -136,6 +136,10 @@ void FurnaceGUI::doAction(int what) {
|
|||
case GUI_ACTION_FOLLOW_PATTERN:
|
||||
followPattern=!followPattern;
|
||||
break;
|
||||
case GUI_ACTION_FULLSCREEN:
|
||||
fullScreen=!fullScreen;
|
||||
SDL_SetWindowFullscreen(sdlWin,fullScreen?(SDL_WINDOW_FULLSCREEN|SDL_WINDOW_FULLSCREEN_DESKTOP):0);
|
||||
break;
|
||||
case GUI_ACTION_PANIC:
|
||||
e->syncReset();
|
||||
break;
|
||||
|
|
|
@ -2476,9 +2476,8 @@ bool FurnaceGUI::loop() {
|
|||
ImGui::EndMenu();
|
||||
}
|
||||
if (ImGui::BeginMenu("settings")) {
|
||||
if (ImGui::MenuItem("full screen",NULL,fullScreen)) {
|
||||
fullScreen=!fullScreen;
|
||||
SDL_SetWindowFullscreen(sdlWin,fullScreen?(SDL_WINDOW_FULLSCREEN|SDL_WINDOW_FULLSCREEN_DESKTOP):0);
|
||||
if (ImGui::MenuItem("full screen",BIND_FOR(GUI_ACTION_FULLSCREEN),fullScreen)) {
|
||||
doAction(GUI_ACTION_FULLSCREEN);
|
||||
}
|
||||
if (ImGui::MenuItem("lock layout",NULL,lockLayout)) {
|
||||
lockLayout=!lockLayout;
|
||||
|
|
|
@ -297,6 +297,7 @@ enum FurnaceGUIActions {
|
|||
GUI_ACTION_REPEAT_PATTERN,
|
||||
GUI_ACTION_FOLLOW_ORDERS,
|
||||
GUI_ACTION_FOLLOW_PATTERN,
|
||||
GUI_ACTION_FULLSCREEN,
|
||||
GUI_ACTION_PANIC,
|
||||
|
||||
GUI_ACTION_WINDOW_EDIT_CONTROLS,
|
||||
|
|
|
@ -167,6 +167,7 @@ const FurnaceGUIActionDef guiActions[GUI_ACTION_MAX]={
|
|||
D("REPEAT_PATTERN", "Toggle repeat pattern", 0),
|
||||
D("FOLLOW_ORDERS", "Follow orders", 0),
|
||||
D("FOLLOW_PATTERN", "Follow pattern", 0),
|
||||
D("FULLSCREEN", "Toggle full-screen", FURKMOD_ALT|SDLK_RETURN),
|
||||
D("PANIC", "Panic", SDLK_F12),
|
||||
|
||||
D("WINDOW_EDIT_CONTROLS", "Edit Controls", 0),
|
||||
|
|
|
@ -1249,6 +1249,7 @@ void FurnaceGUI::drawSettings() {
|
|||
UI_KEYBIND_CONFIG(GUI_ACTION_REPEAT_PATTERN);
|
||||
UI_KEYBIND_CONFIG(GUI_ACTION_FOLLOW_ORDERS);
|
||||
UI_KEYBIND_CONFIG(GUI_ACTION_FOLLOW_PATTERN);
|
||||
UI_KEYBIND_CONFIG(GUI_ACTION_FULLSCREEN);
|
||||
UI_KEYBIND_CONFIG(GUI_ACTION_PANIC);
|
||||
|
||||
KEYBIND_CONFIG_END;
|
||||
|
|
Loading…
Reference in a new issue