fix(shortcuts): wire repository menu accelerators

This commit is contained in:
2026-06-19 00:07:22 -05:00
parent eeb134c6ab
commit 79bd00d84d

View File

@@ -3156,6 +3156,10 @@ void draw_app() {
bool reopen_tab_requested = control_down && ImGui::GetIO().KeyShift &&
ImGui::IsKeyPressed(ImGuiKey_T, false);
bool close_tab_requested = control_down && ImGui::IsKeyPressed(ImGuiKey_W, false);
bool open_repository_requested = control_down && !ImGui::GetIO().KeyShift &&
ImGui::IsKeyPressed(ImGuiKey_O, false);
bool create_repository_requested = control_down && !ImGui::GetIO().KeyShift &&
ImGui::IsKeyPressed(ImGuiKey_N, false);
const bool refresh_requested = ImGui::IsKeyPressed(ImGuiKey_F5, false);
if (ImGui::BeginMenuBar()) {
if (ImGui::BeginMenu("File")) {
@@ -3165,8 +3169,8 @@ void draw_app() {
if (ImGui::MenuItem("Reopen closed tab", "Ctrl+Shift+T")) reopen_tab_requested = true;
ImGui::EndDisabled();
ImGui::Separator();
if (ImGui::MenuItem("Open repository...", "Ctrl+O")) pick_and_open_repository();
if (ImGui::MenuItem("Create repository...", "Ctrl+N")) g_init_popup = true;
if (ImGui::MenuItem("Open repository...", "Ctrl+O")) open_repository_requested = true;
if (ImGui::MenuItem("Create repository...", "Ctrl+N")) create_repository_requested = true;
ImGui::Separator();
if (ImGui::MenuItem("Exit") && g_window_manager) g_window_manager->requestClose();
ImGui::EndMenu();
@@ -3198,6 +3202,8 @@ void draw_app() {
}
}
if (create_tab_requested) create_new_tab();
if (open_repository_requested) pick_and_open_repository();
if (create_repository_requested) g_init_popup = true;
size_t tab_to_close = g_tabs.size();
size_t tab_move_from = g_tabs.size();