Skip to content

Commit

Permalink
browser/gui: Hide wip image handling behind a keybind
Browse files Browse the repository at this point in the history
  • Loading branch information
robinlinden committed Dec 27, 2024
1 parent af38747 commit 2dcbeca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 13 additions & 1 deletion browser/gui/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,16 @@ void App::step() {
spdlog::info("Switched canvas to {}", selected_canvas_ == Canvas::OpenGL ? "OpenGL" : "SFML");
break;
}
case sf::Keyboard::Key::F3: {
load_images_ = !load_images_;
if (load_images_) {
start_loading_images();
} else {
pending_loads_.clear();
}
spdlog::info("Load images: {}", load_images_);
break;
}
case sf::Keyboard::Key::F4: {
display_debug_gui_ = !display_debug_gui_;
spdlog::info("Display debug gui: {}", display_debug_gui_);
Expand Down Expand Up @@ -611,7 +621,9 @@ void App::on_page_loaded() {
break;
}

start_loading_images();
if (load_images_) {
start_loading_images();
}

on_layout_updated();
}
Expand Down
1 change: 1 addition & 0 deletions browser/gui/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class App final {

bool render_debug_{};
bool display_debug_gui_{};
bool load_images_{};

unsigned scale_{1};

Expand Down

0 comments on commit 2dcbeca

Please sign in to comment.