Initial experimental work for screenshots

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-02-09 17:38:25 +00:00
parent 39540b7dc8
commit fff4d6f61d
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
5 changed files with 132 additions and 10 deletions

View file

@ -185,11 +185,20 @@ math::Vec Scene::getMousePos() {
void Scene::step() {
if (APP->window->isFullScreen()) {
// Expand RackScrollWidget to cover entire screen if fullscreen
rackScroll->box.pos.y = 0;
}
else {
// Always show MenuBar if not fullscreen
menuBar->show();
rackScroll->box.pos.y = menuBar->box.size.y;
}
internal->resizeHandle->box.pos = box.size.minus(internal->resizeHandle->box.size);
// Resize owned descendants
menuBar->box.size.x = box.size.x;
rackScroll->box.pos.y = menuBar->box.size.y;
rackScroll->box.size = box.size.minus(rackScroll->box.pos);
// Scroll RackScrollWidget with arrow keys
@ -334,6 +343,10 @@ void Scene::onHoverKey(const HoverKeyEvent& e) {
patchUtils::deployToRemote();
e.consume(this);
}
if (e.key == GLFW_KEY_F9 && (e.mods & RACK_MOD_MASK) == 0) {
window::generateScreenshot();
e.consume(this);
}
// Module selections
if (e.keyName == "a" && (e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) {