25 lines
543 B
C++
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);
|
|
}
|
|
}
|