various: adding files missing in last commit

Oddly some files didn't commit previously. This commit adds those.
This commit is contained in:
itsmattkc
2020-05-27 03:24:37 +10:00
parent 3e3cacbc85
commit 14ac1ada6e
9 changed files with 49 additions and 41 deletions
+2 -2
View File
@@ -238,8 +238,8 @@ void CurveView::VerticalScaleChangedEvent(double scale)
void CurveView::wheelEvent(QWheelEvent *event)
{
if (WheelEventIsAZoomEvent(event)) {
if (event->delta() != 0) {
if (event->delta() > 0) {
if (!event->angleDelta().isNull()) {
if (event->angleDelta().x() + event->angleDelta().y() > 0) {
emit ScaleChanged(GetScale() * 1.1);
SetYScale(GetYScale() * 1.1);
} else {
+1 -1
View File
@@ -114,7 +114,7 @@ QLayoutItem *FlowLayout::takeAt(int index)
Qt::Orientations FlowLayout::expandingDirections() const
{
return 0;
return Qt::Horizontal | Qt::Vertical;
}
bool FlowLayout::hasHeightForWidth() const
+1 -1
View File
@@ -445,7 +445,7 @@ void NodeView::wheelEvent(QWheelEvent *event)
{
if (event->modifiers() & Qt::ControlModifier) {
// FIXME: Hardcoded divider (0.001)
qreal multiplier = 1.0 + (static_cast<qreal>(event->delta()) * 0.001);
qreal multiplier = 1.0 + (static_cast<qreal>(event->angleDelta().x() + event->angleDelta().y()) * 0.001);
scale(multiplier, multiplier);
} else {
+4 -4
View File
@@ -149,7 +149,7 @@ void SliderBase::SetMinimumInternal(const QVariant &v)
has_min_ = true;
// Limit value by this new minimum value
if (value_ < min_value_) {
if (value_.toDouble() < min_value_.toDouble()) {
SetValue(min_value_);
}
}
@@ -160,7 +160,7 @@ void SliderBase::SetMaximumInternal(const QVariant &v)
has_max_ = true;
// Limit value by this new maximum value
if (value_ > max_value_) {
if (value_.toDouble() > max_value_.toDouble()) {
SetValue(max_value_);
}
}
@@ -175,11 +175,11 @@ void SliderBase::changeEvent(QEvent *e)
const QVariant &SliderBase::ClampValue(const QVariant &v)
{
if (has_min_ && v < min_value_) {
if (has_min_ && v.toDouble() < min_value_.toDouble()) {
return min_value_;
}
if (has_max_ && v > max_value_) {
if (has_max_ && v.toDouble() > max_value_.toDouble()) {
return max_value_;
}
@@ -131,16 +131,24 @@ void TimelineView::wheelEvent(QWheelEvent *event)
{
if (HandleZoomFromScroll(event)) {
return;
} else if (Config::Current()["InvertTimelineScrollAxes"].toBool()) {
QWheelEvent e(event->pos(),
event->delta(),
} else {
QPoint angle_delta = event->angleDelta();
if (Config::Current()["InvertTimelineScrollAxes"].toBool()) {
angle_delta = QPoint(angle_delta.y(), angle_delta.x());
}
QWheelEvent e(event->position(),
event->globalPosition(),
event->pixelDelta(),
angle_delta,
event->buttons(),
event->modifiers(),
event->orientation() == Qt::Horizontal ? Qt::Vertical : Qt::Horizontal);
event->phase(),
event->inverted(),
event->source());
QGraphicsView::wheelEvent(&e);
} else {
QGraphicsView::wheelEvent(event);
}
}
@@ -203,8 +203,8 @@ bool TimelineViewBase::HandleZoomFromScroll(QWheelEvent *event)
{
if (WheelEventIsAZoomEvent(event)) {
// If CTRL is held (or a preference is set to swap CTRL behavior), we zoom instead of scrolling
if (event->delta() != 0) {
if (event->delta() > 0) {
if (!event->angleDelta().isNull()) {
if (event->angleDelta().x() + event->angleDelta().y() > 0) {
emit ScaleChanged(GetScale() * 1.1);
} else {
emit ScaleChanged(GetScale() * 0.9);
+3 -3
View File
@@ -441,9 +441,9 @@ void ViewerWidget::UpdateTextureFromNode(const rational& time)
// Check playback queue for a frame
if (IsPlaying()) {
while (!playback_queue_.isEmpty()) {
while (!playback_queue_.empty()) {
const ViewerPlaybackFrame& pf = playback_queue_.first();
const ViewerPlaybackFrame& pf = playback_queue_.front();
if (pf.timestamp == time) {
@@ -454,7 +454,7 @@ void ViewerWidget::UpdateTextureFromNode(const rational& time)
} else {
// Skip this frame
playback_queue_.removeFirst();
playback_queue_.pop_front();
RequestNextFrameForQueue();
}
+3 -3
View File
@@ -102,15 +102,15 @@ void ViewerWindow::UpdateFromQueue()
rational time = Timecode::timestamp_to_time(t, playback_timebase_);
while (!queue_.isEmpty()) {
const ViewerPlaybackFrame& pf = queue_.first();
while (!queue_.empty()) {
const ViewerPlaybackFrame& pf = queue_.front();
if (pf.timestamp == time) {
// Frame was in queue, no need to decode anything
display_widget_->SetImage(pf.frame);
return;
} else {
queue_.removeFirst();
queue_.pop_front();
}
}
}