Skip to content

Commit 0131b4e

Browse files
committed
Fix some editor window behaviors
1 parent 61630ee commit 0131b4e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/gui/preset_editor/PresetEditorGUI.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ bool PresetEditorGUI::Draw()
8585
ImGui::SetNextWindowSize(viewport->WorkSize);
8686
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, IM_COL32(0xd9, 0x1e, 0x18, 0xff));
8787

88-
if (ImGui::Begin("Preset Editor", &_visible, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBackground))
88+
if (ImGui::Begin("Preset Editor", &_visible, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBackground))
8989
{
9090
DrawLeftSideBar();
9191

@@ -109,7 +109,7 @@ bool PresetEditorGUI::Draw()
109109
_codeEditorWindow.reset();
110110
}
111111

112-
return true;
112+
return _visible;
113113
}
114114

115115
void PresetEditorGUI::UpdatePresetPreview()
@@ -131,19 +131,19 @@ void PresetEditorGUI::HandleGlobalEditorKeys()
131131
auto alt = io.ConfigMacOSXBehaviors ? io.KeyCtrl : io.KeyAlt;
132132

133133
// Reload edited preset - Alt+Enter or F5
134-
if ((io.KeysData[ImGuiKey_Enter - ImGuiKey_NamedKey_BEGIN].Down && alt) || io.KeysData[ImGuiKey_F5 - ImGuiKey_NamedKey_BEGIN].Down)
134+
if (ImGui::IsKeyPressed(ImGuiKey_F5, false) || alt && ImGui::IsKeyPressed(ImGuiKey_Enter, false))
135135
{
136136
UpdatePresetPreview();
137137
}
138138

139139
// Save preset - Ctrl+S
140-
if (io.KeysData[ImGuiKey_S - ImGuiKey_NamedKey_BEGIN].Down && ctrl)
140+
if (ctrl && ImGui::IsKeyPressed(ImGuiKey_S, false))
141141
{
142142

143143
}
144144

145145
// New preset - Ctrl+N
146-
if (io.KeysData[ImGuiKey_N - ImGuiKey_NamedKey_BEGIN].Down && ctrl)
146+
if (ctrl && ImGui::IsKeyPressed(ImGuiKey_N, false))
147147
{
148148
Show("");
149149
}

0 commit comments

Comments
 (0)