[vlmc-devel] MainWorkflow: Make scaleChanged emit the original value

Yikai Lu git at videolan.org
Tue Jul 26 16:12:35 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Tue Jul 26 21:29:02 2016 +0900| [056c7da6ee8917cf39a8217920089d60ffb60dd0] | committer: Yikai Lu

MainWorkflow: Make scaleChanged emit the original value

> https://code.videolan.org/videolan/vlmc/commit/056c7da6ee8917cf39a8217920089d60ffb60dd0
---

 src/Gui/MainWindow.cpp    | 2 +-
 src/Gui/MainWindow.h      | 2 +-
 src/Gui/timeline/main.qml | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index caa6283..7f46fc6 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -414,7 +414,7 @@ MainWindow::createStatusBar()
              this, SLOT( zoomIn() ) );
     connect( m_zoomSlider, &QSlider::valueChanged, this, [this]( int val )
     {
-        emit scaleChanged( ( val + 1 ) / (double)( m_zoomSlider->maximum() + 1 ) );
+        emit scaleChanged( val );
     } );
 }
 
diff --git a/src/Gui/MainWindow.h b/src/Gui/MainWindow.h
index 3171b9b..93580af 100644
--- a/src/Gui/MainWindow.h
+++ b/src/Gui/MainWindow.h
@@ -166,7 +166,7 @@ private slots:
 
 signals:
     void                    toolChanged( ToolButtons );
-    void                    scaleChanged( double scaleLevel );
+    void                    scaleChanged( quint32 scaleLevel );
 };
 
 #endif // MAINWINDOW_H
diff --git a/src/Gui/timeline/main.qml b/src/Gui/timeline/main.qml
index c0c5150..5c835b3 100644
--- a/src/Gui/timeline/main.qml
+++ b/src/Gui/timeline/main.qml
@@ -559,11 +559,11 @@ Rectangle {
         target: mainwindow
         onScaleChanged: {
             // 10 levels
-            if ( scale < scaleLevel * 10 )
+            if ( scale < scaleLevel )
                 zoomIn( 0.5 );
-            else if ( scale > scaleLevel * 10 )
+            else if ( scale > scaleLevel )
                 zoomIn( 2 );
-            scale = scaleLevel * 10;
+            scale = scaleLevel;
         }
     }
 }



More information about the Vlmc-devel mailing list