]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Update the zoom slider if the previews setting is changed
authorFrank Reininghaus <frank78ac@googlemail.com>
Sun, 4 Dec 2011 13:10:20 +0000 (14:10 +0100)
committerFrank Reininghaus <frank78ac@googlemail.com>
Sun, 4 Dec 2011 16:44:59 +0000 (17:44 +0100)
This is important if the zoom levels are different with previews
enabled/disabled.

src/statusbar/dolphinstatusbar.cpp
src/statusbar/dolphinstatusbar.h

index 681fbf407a69682677a18780a04dd10243938b0e..c733ebe027bf8dd0915a79852de67ed362878adb 100644 (file)
@@ -74,6 +74,7 @@ DolphinStatusBar::DolphinStatusBar(QWidget* parent, DolphinView* view) :
     connect(m_zoomSlider, SIGNAL(valueChanged(int)), this, SLOT(setZoomLevel(int)));
     connect(m_zoomSlider, SIGNAL(sliderMoved(int)), this, SLOT(showZoomSliderToolTip(int)));
     connect(m_view, SIGNAL(zoomLevelChanged(int,int)), this, SLOT(slotZoomLevelChanged(int,int)));
     connect(m_zoomSlider, SIGNAL(valueChanged(int)), this, SLOT(setZoomLevel(int)));
     connect(m_zoomSlider, SIGNAL(sliderMoved(int)), this, SLOT(showZoomSliderToolTip(int)));
     connect(m_view, SIGNAL(zoomLevelChanged(int,int)), this, SLOT(slotZoomLevelChanged(int,int)));
+    connect(m_view, SIGNAL(previewsShownChanged(bool)), this, SLOT(slotPreviewsShownChanged(bool)));
 
     // Initialize space information
     m_spaceInfo = new StatusBarSpaceInfo(this);
 
     // Initialize space information
     m_spaceInfo = new StatusBarSpaceInfo(this);
@@ -328,6 +329,13 @@ void DolphinStatusBar::slotZoomLevelChanged(int current, int previous)
     m_zoomSlider->setValue(current);
 }
 
     m_zoomSlider->setValue(current);
 }
 
+void DolphinStatusBar::slotPreviewsShownChanged(bool shown)
+{
+    Q_UNUSED(shown);
+    // The zoom level might be different with/without previews -> update the zoom slider.
+    m_zoomSlider->setValue(m_view->zoomLevel());
+}
+
 void DolphinStatusBar::updateProgressInfo()
 {
     const bool isErrorShown = (m_messageLabel->type() == KonqStatusBarMessageLabel::Error);
 void DolphinStatusBar::updateProgressInfo()
 {
     const bool isErrorShown = (m_messageLabel->type() == KonqStatusBarMessageLabel::Error);
index 7d56746f638417efdb56a792a076fb72bde3f07a..32d603ac581b26c0ec48c5edde6f8a5edba09cea 100644 (file)
@@ -139,6 +139,7 @@ private slots:
 
     void showZoomSliderToolTip(int zoomLevel);
     void slotZoomLevelChanged(int current, int previous);
 
     void showZoomSliderToolTip(int zoomLevel);
     void slotZoomLevelChanged(int current, int previous);
+    void slotPreviewsShownChanged(bool shown);
 
     void updateProgressInfo();
 
 
     void updateProgressInfo();