Skip to content

Commit ec2aeff

Browse files
committed
Use ### IDs for all ImGui windows.
Makes it easier to change the window title later without "forgetting" the window position.
1 parent c431ee5 commit ec2aeff

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/gui/AboutWindow.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void AboutWindow::Draw()
3030
}
3131

3232
ImGui::SetNextWindowSize(ImVec2(750, 600), ImGuiCond_FirstUseEver);
33-
if (ImGui::Begin("About the projectM SDL Frontend", &_visible, ImGuiWindowFlags_NoCollapse))
33+
if (ImGui::Begin("About the projectM SDL Frontend###About", &_visible, ImGuiWindowFlags_NoCollapse))
3434
{
3535
_gui.PushToastFont();
3636
ImGui::TextUnformatted("projectM SDL Frontend");

src/gui/FileChooser.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,12 @@ bool FileChooser::Draw()
9494
ChangeDirectory(Poco::Path::home());
9595
}
9696

97-
ImGui::OpenPopup(_title.c_str());
97+
std::string dialogTileAndId = _title + "###File Chooser";
98+
99+
ImGui::OpenPopup(dialogTileAndId.c_str());
98100

99101
ImGui::SetNextWindowSize(ImVec2(800, 600), ImGuiCond_FirstUseEver);
100-
if (ImGui::BeginPopupModal(_title.c_str(), &_visible, ImGuiWindowFlags_NoCollapse))
102+
if (ImGui::BeginPopupModal(dialogTileAndId.c_str(), &_visible, ImGuiWindowFlags_NoCollapse))
101103
{
102104
DrawNavButtons();
103105

src/gui/HelpWindow.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void HelpWindow::Draw()
3232
constexpr ImGuiTableFlags tableFlags = ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg;
3333

3434
ImGui::SetNextWindowSize(ImVec2(1000, 600), ImGuiCond_FirstUseEver);
35-
if (ImGui::Begin("Help", &_visible, windowFlags))
35+
if (ImGui::Begin("Quick Help###Help", &_visible, windowFlags))
3636
{
3737
if (ImGui::BeginTabBar("Help Topics", tabBarFlags))
3838
{

0 commit comments

Comments
 (0)