diff --git a/main.cpp b/main.cpp index 965a921..dd19f59 100644 --- a/main.cpp +++ b/main.cpp @@ -324,38 +324,38 @@ int main(int, char**) // 1. Show the big demo window (Most of the sample code is in ImGui::ShowDemoWindow()! You can browse its code to learn more about Dear ImGui!). if (show_demo_window) ImGui::ShowDemoWindow(&show_demo_window); - if (ImGui::BeginMainMenuBar()) { - if (ImGui::BeginMenu(ICON_FK_FILE "File")) { - if (ImGui::MenuItem(ICON_FK_FOLDER_OPEN "Open")) { - fileDialog.Open(); - } - if (ImGui::MenuItem(ICON_FK_WINDOW_CLOSE "Quit")) { - done = true; - } - ImGui::EndMenu(); + if (ImGui::BeginMainMenuBar()) { + if (ImGui::BeginMenu(ICON_FK_FILE "File")) { + if (ImGui::MenuItem(ICON_FK_FOLDER_OPEN "Open")) { + fileDialog.Open(); } - if (ImGui::BeginMenu(ICON_FK_SCISSORS "Edit")) { - if (ImGui::MenuItem(ICON_FK_COG "Preferences...")) { - prefs_window = true; - } - ImGui::EndMenu(); + if (ImGui::MenuItem(ICON_FK_WINDOW_CLOSE "Quit")) { + done = true; } - #ifdef DEBUG - if (ImGui::BeginMenu(ICON_FK_COG "Debug")) { - if (ImGui::MenuItem("Show ImGui Demo Window", nullptr, show_demo_window)) { - show_demo_window = !show_demo_window; - } - ImGui::EndMenu(); - } - #endif - if (ImGui::BeginMenu(ICON_FK_INFO_CIRCLE "Help")) { - if (ImGui::MenuItem(ICON_FK_INFO "About", nullptr, about_window)) { - about_window = !about_window; - } - ImGui::EndMenu(); - } - ImGui::EndMainMenuBar(); + ImGui::EndMenu(); } + if (ImGui::BeginMenu(ICON_FK_SCISSORS "Edit")) { + if (ImGui::MenuItem(ICON_FK_COG "Preferences...")) { + prefs_window = true; + } + ImGui::EndMenu(); + } + #ifdef DEBUG + if (ImGui::BeginMenu(ICON_FK_COG "Debug")) { + if (ImGui::MenuItem("Show ImGui Demo Window", nullptr, show_demo_window)) { + show_demo_window = !show_demo_window; + } + ImGui::EndMenu(); + } + #endif + if (ImGui::BeginMenu(ICON_FK_INFO_CIRCLE "Help")) { + if (ImGui::MenuItem(ICON_FK_INFO "About", nullptr, about_window)) { + about_window = !about_window; + } + ImGui::EndMenu(); + } + ImGui::EndMainMenuBar(); + } ImGui::SetNextWindowDockID(dockid); ImGui::Begin(ICON_FK_PLAY "Player", nullptr, 0); { diff --git a/theme.cpp b/theme.cpp index 80a0e00..04debd1 100644 --- a/theme.cpp +++ b/theme.cpp @@ -277,7 +277,7 @@ bool Theme::ShowEditor(bool* open, Theme* &theme, ImGuiID dockid, int window_wid if (themePath.stem().string().starts_with(filter)) { const bool is_selected = strcmp(themePath.stem().generic_string().c_str(), selectedThemeName) == 0; if (ImGui::Selectable(themePath.stem().generic_string().c_str(), is_selected)) { - strncpy(selectedThemeName, themePath.stem().generic_string().c_str(), 1024); + strncpy(selectedThemeName, themePath.stem().generic_string().c_str(), 1023); } if (is_selected) { ImGui::SetItemDefaultFocus(); @@ -494,4 +494,4 @@ Theme::Theme(string path) : Theme() { } Theme::Theme(path path) : Theme(path.string()) { -} \ No newline at end of file +}