@@ -15,6 +15,7 @@
#include <fmt/format.h>
#include <imgui-SFML.h>
#include <imgui.h>
#include <imgui_internal.h>
#include <imgui_stdlib.h>
#include <spdlog/spdlog.h>
@@ -196,6 +197,13 @@ int App::run() {
scroll(event.key.shift ? 20 : 5);
break;
}
case sf::Keyboard::Key::L: {
if (!event.key.control) {
break;
}
focus_url_input();
break;
}
case sf::Keyboard::Key::F1: {
render_debug_ = !render_debug_;
break;
@@ -445,6 +453,11 @@ void App::run_overlay() {
ImGui::SFML::Update(window_, clock_.restart());
}
void App::focus_url_input() {
auto *window = ImGui::FindWindowByName("Navigation");
ImGui::ActivateItemByID(window->GetID("Url"));
}
void App::run_nav_widget() {
im::window("Navigation", {0, 0}, {window_.getSize().x / 2.f, 0}, [this] {
if (ImGui::InputText("Url", &url_buf_, ImGuiInputTextFlags_EnterReturnsTrue)) {