Files
oak-editor/ui/scrollarea.cpp
T
2019-02-15 04:09:03 -08:00

25 lines
543 B
C++

#include "scrollarea.h"
#include <QWheelEvent>
#include <QDebug>
#include "io/config.h"
#include "panels/panels.h"
#include "panels/timeline.h"
ScrollArea::ScrollArea(QWidget* parent) : QScrollArea(parent) {}
void ScrollArea::wheelEvent(QWheelEvent *e) {
if (config.scroll_zooms) {
e->ignore();
if (e->angleDelta().y() > 0) {
panel_timeline->zoom_in();
} else if (e->angleDelta().y() < 0) {
panel_timeline->zoom_out();
}
} else {
QScrollArea::wheelEvent(e);
}
}