]> cloud.milkyroute.net Git - dolphin.git/commitdiff
DolphinView: Reset scrollbars before changing view mode
authorAmol Godbole <amolagodbole@gmail.com>
Sun, 3 Sep 2023 17:33:21 +0000 (12:33 -0500)
committerAmol Godbole <amolagodbole@gmail.com>
Tue, 5 Sep 2023 04:58:05 +0000 (04:58 +0000)
When view modes are changed, the scrollbars are not reset. This can
cause the scroll area to be moved out of view after changing the view
mode, making the view unusable. This commit resets the scrollbars.

BUG: 393152

src/views/dolphinview.cpp

index a91d76358aecf434704aaeb44ca0888f9ec75bf9..d0db814e4d404dee7bd3e36835e8bc6e8ac02db6 100644 (file)
@@ -279,6 +279,10 @@ bool DolphinView::isActive() const
 void DolphinView::setViewMode(Mode mode)
 {
     if (mode != m_mode) {
+        // Reset scrollbars before changing the view mode.
+        m_container->horizontalScrollBar()->setValue(0);
+        m_container->verticalScrollBar()->setValue(0);
+
         ViewProperties props(viewPropertiesUrl());
         props.setViewMode(mode);