Skip to content

Commit 71b68fa

Browse files
committed
Fix brace placement in FileChooser.
1 parent 94926ad commit 71b68fa

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

src/gui/FileChooser.cpp

+25-26
Original file line numberDiff line numberDiff line change
@@ -137,45 +137,44 @@ bool FileChooser::Draw()
137137
}
138138

139139
ImGui::EndListBox();
140+
}
140141

141-
ImGui::PushStyleColor(ImGuiCol_Button, 0xFF000080);
142-
if (ImGui::Button("Cancel"))
142+
ImGui::PushStyleColor(ImGuiCol_Button, 0xFF000080);
143+
if (ImGui::Button("Cancel"))
144+
{
145+
_selectedFiles.clear();
146+
fileSelected = true;
147+
Close();
148+
}
149+
ImGui::PopStyleColor();
150+
ImGui::SameLine();
151+
if (ImGui::Button("Select"))
152+
{
153+
for (auto index : _selectedFileIndices)
143154
{
144-
_selectedFiles.clear();
145-
fileSelected = true;
146-
Close();
155+
_selectedFiles.emplace_back(_currentFileList.at(index));
147156
}
148-
ImGui::PopStyleColor();
149-
ImGui::SameLine();
150-
if (ImGui::Button("Select"))
151-
{
152-
for (auto index : _selectedFileIndices)
153-
{
154-
_selectedFiles.emplace_back(_currentFileList.at(index));
155-
}
156157

157-
if (_selectedFileIndices.empty() && _mode == Mode::Directory)
158-
{
159-
_selectedFiles.emplace_back(Poco::Path(_currentDir).makeDirectory());
160-
}
161-
else
162-
{
163-
// ToDo: Display "Select at least one entry from the list"
164-
}
165-
166-
fileSelected = true;
167-
Close();
158+
if (_selectedFileIndices.empty() && _mode == Mode::Directory)
159+
{
160+
_selectedFiles.emplace_back(Poco::Path(_currentDir).makeDirectory());
161+
}
162+
else
163+
{
164+
// ToDo: Display "Select at least one entry from the list"
168165
}
169166

170-
ImGui::EndPopup();
167+
fileSelected = true;
168+
Close();
171169
}
170+
171+
ImGui::EndPopup();
172172
}
173173
else
174174
{
175175
Close();
176176
}
177177

178-
179178
return fileSelected;
180179
}
181180

0 commit comments

Comments
 (0)