Browse Source

Allow left button to scroll ScrollWidget, so that the rack and other scroll containers can be scrolled with a touch screen.

tags/v2.0.0
Andrew Belt 5 years ago
parent
commit
d0098ae7cc
4 changed files with 11 additions and 4 deletions
  1. +6
    -1
      src/app/ModuleWidget.cpp
  2. +0
    -1
      src/app/RackScrollWidget.cpp
  3. +3
    -0
      src/engine/Engine.cpp
  4. +2
    -2
      src/ui/ScrollWidget.cpp

+ 6
- 1
src/app/ModuleWidget.cpp View File

@@ -355,7 +355,12 @@ void ModuleWidget::drawShadow(const DrawArgs& args) {
} }


void ModuleWidget::onButton(const event::Button& e) { void ModuleWidget::onButton(const event::Button& e) {
OpaqueWidget::onButton(e);
// Don't consume left button if `lockModules` is enabled.
if (settings::lockModules)
Widget::onButton(e);
else
OpaqueWidget::onButton(e);

if (e.isConsumed()) if (e.isConsumed())
return; return;




+ 0
- 1
src/app/RackScrollWidget.cpp View File

@@ -75,7 +75,6 @@ void RackScrollWidget::step() {
oldOffset = offset; oldOffset = offset;
} }



void RackScrollWidget::draw(const DrawArgs& args) { void RackScrollWidget::draw(const DrawArgs& args) {
// Hide scrollbars if full screen // Hide scrollbars if full screen
bool fullscreen = APP->window->isFullScreen(); bool fullscreen = APP->window->isFullScreen();


+ 3
- 0
src/engine/Engine.cpp View File

@@ -528,16 +528,19 @@ long Engine::getFrame() {




long Engine::getStepFrame() { long Engine::getStepFrame() {
// No lock, for performance
return internal->stepFrame; return internal->stepFrame;
} }




long Engine::getStepTime() { long Engine::getStepTime() {
// No lock, for performance
return internal->stepTime; return internal->stepTime;
} }




int Engine::getStepFrames() { int Engine::getStepFrames() {
// No lock, for performance
return internal->stepFrames; return internal->stepFrames;
} }




+ 2
- 2
src/ui/ScrollWidget.cpp View File

@@ -64,7 +64,7 @@ void ScrollWidget::step() {
} }


void ScrollWidget::onButton(const event::Button& e) { void ScrollWidget::onButton(const event::Button& e) {
Widget::onButton(e);
OpaqueWidget::onButton(e);
if (e.isConsumed()) if (e.isConsumed())
return; return;


@@ -78,7 +78,7 @@ void ScrollWidget::onButton(const event::Button& e) {
} }


void ScrollWidget::onDragStart(const event::DragStart& e) { void ScrollWidget::onDragStart(const event::DragStart& e) {
if (e.button == GLFW_MOUSE_BUTTON_MIDDLE) {
if (e.button == GLFW_MOUSE_BUTTON_LEFT || e.button == GLFW_MOUSE_BUTTON_MIDDLE) {
e.consume(this); e.consume(this);
} }
} }


Loading…
Cancel
Save