From 63a939d43203b1fa3215e63feaf24104fceba059 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sun, 22 Sep 2019 19:32:59 -0400 Subject: [PATCH] Hide menu and scrollbars when fullscreen. --- CHANGELOG.md | 2 ++ src/app/RackScrollWidget.cpp | 15 ++++++++++++++- src/app/Scene.cpp | 5 ++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b9f3416..d56335db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ In this document, Mod is Ctrl on Windows/Linux and Cmd on Mac. - Swap order of tags and brands in Module Browser. - Disable smoothing for MIDI CC buttons in MIDI-Map. - Automatically unzip update on Mac. +- Stop worker threads when engine is paused to save CPU. +- Hide menu and scrollbars when fullscreen. - Core - Fix sustain pedal release bug when using polyphonic mode in MIDI-CV. - API diff --git a/src/app/RackScrollWidget.cpp b/src/app/RackScrollWidget.cpp index 0bd00cf0..da6e132a 100644 --- a/src/app/RackScrollWidget.cpp +++ b/src/app/RackScrollWidget.cpp @@ -77,8 +77,21 @@ void RackScrollWidget::step() { void RackScrollWidget::draw(const DrawArgs& args) { - // DEBUG("%f %f %f %f", RECT_ARGS(args.clipBox)); + // Hide scrollbars if full screen + bool fullscreen = APP->window->isFullScreen(); + bool horizontalVisible; + bool verticalVisible; + if (fullscreen) { + horizontalVisible = horizontalScrollBar->visible; + verticalVisible = verticalScrollBar->visible; + horizontalScrollBar->visible = false; + verticalScrollBar->visible = false; + } ScrollWidget::draw(args); + if (fullscreen) { + horizontalScrollBar->visible = horizontalVisible; + verticalScrollBar->visible = verticalVisible; + } } void RackScrollWidget::onHoverKey(const event::HoverKey& e) { diff --git a/src/app/Scene.cpp b/src/app/Scene.cpp index 72c25f3e..a6021074 100644 --- a/src/app/Scene.cpp +++ b/src/app/Scene.cpp @@ -23,7 +23,6 @@ Scene::Scene() { menuBar = createMenuBar(); addChild(menuBar); - rackScroll->box.pos.y = menuBar->box.size.y; moduleBrowser = moduleBrowserCreate(); moduleBrowser->hide(); @@ -34,6 +33,10 @@ Scene::~Scene() { } void Scene::step() { + bool fullscreen = APP->window->isFullScreen(); + menuBar->visible = !fullscreen; + rackScroll->box.pos.y = menuBar->visible ? menuBar->box.size.y : 0; + // Resize owned descendants menuBar->box.size.x = box.size.x; rackScroll->box.size = box.size.minus(rackScroll->box.pos);