diff --git a/sample/about-bezos.md b/sample/about-bezos.md index 320a7ca..14d98fb 100644 --- a/sample/about-bezos.md +++ b/sample/about-bezos.md @@ -69,7 +69,7 @@ Bare content like this * You don't even need text --- { - "shader": "lightning", + "shader": "flame", "bg_color": [100, 30, 40, 255] } # Shaders diff --git a/src/control_ui.cpp b/src/control_ui.cpp index 21f96b5..df8d3af 100644 --- a/src/control_ui.cpp +++ b/src/control_ui.cpp @@ -19,8 +19,14 @@ ControlUI::ControlUI(sf::RenderWindow& presenter, sf::RenderWindow& controller) { $gui.position(0, 0, CONTROL_WIDTH, CONTROL_HEIGHT); $gui.layout( - "[status|*%(200,100)current|_]" - "[docs|*%(200,100)preview|_]" + "[status|*%(200,400)current|_]" + "[title0|_|_]" + "[title1|_|_]" + "[title2|_|_]" + "[title3|*%(200,400)preview|_]" + "[title4|_|_]" + "[title5|_|_]" + "[help|_|_]" ); } @@ -28,8 +34,10 @@ void ControlUI::init() { auto status_id = $gui.entity("status"); $gui.set(status_id, {L""}); - auto docs_id = $gui.entity("docs"); - $gui.set(docs_id, {L"F: fullscreen\nA: win left\nD: win right\nQ: quit"}); + auto docs_id = $gui.entity("help"); + $gui.set(docs_id, { + .content=L"F: fullscreen\nA: win left\nD: win right\nQ: quit", + .size=20}); auto current = $gui.entity("current"); $gui.set(current, {}); @@ -43,6 +51,11 @@ void ControlUI::init() { .color={180, 180, 180, 255} }); + for(int i = 0; i < 6; i++) { + auto id = $gui.entity("title", i); + $gui.set(id, {.color=guecs::THEME.TRANSPARENT}); + } + $gui.init(); // warning! must come after init so the thing is there @@ -72,6 +85,19 @@ void ControlUI::render(sf::RenderWindow& window, SlideDeck& deck) { render_slide("preview", deck.slide_at(preview)); } + +void ControlUI::full_screen(bool do_it) { + if(do_it) { + $presenter.setSize($window_size); + $presenter.setMouseCursorVisible(false); + } else { + $presenter.setSize({$window_size.x/2, $window_size.y/2}); + $presenter.setMouseCursorVisible(true); + } + + $full_screen = do_it; +} + void ControlUI::handle_events(std::shared_ptr slides, const sf::Event& event) { dbc::check($status != nullptr, "handle_events called before init?!"); @@ -97,15 +123,7 @@ void ControlUI::handle_events(std::shared_ptr slides, const sf::Event& $controller.close(); break; case KEY::F: - if($full_screen) { - $presenter.setSize({$window_size.x/2, $window_size.y/2}); - $presenter.setMouseCursorVisible(true); - } else { - $presenter.setSize($window_size); - $presenter.setMouseCursorVisible(false); - } - - $full_screen = !$full_screen; + full_screen(!$full_screen); break; default: slides->handle_events($controller, event); diff --git a/src/control_ui.hpp b/src/control_ui.hpp index 99878a0..31d358d 100644 --- a/src/control_ui.hpp +++ b/src/control_ui.hpp @@ -17,4 +17,5 @@ struct ControlUI { void render(sf::RenderWindow& window, SlideDeck& deck); void handle_events(std::shared_ptr slides, const sf::Event& event); void render_slide(const std::string& name, Slide& slide); + void full_screen(bool do_it); }; diff --git a/src/main.cpp b/src/main.cpp index 9bd0ea9..4d88e0f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -87,6 +87,7 @@ int main(int argc, char *argv[]) { ControlUI control_ui(presenter, controller); control_ui.init(); + control_ui.full_screen(false); dbc::check(control_ui.$status != nullptr, "bad ptr");