Skip to content

Conversation

@kaustuvpokharel
Copy link
Contributor

@kaustuvpokharel kaustuvpokharel commented Oct 10, 2025

Case: Missing scrollbar for the desktop version for all the ListView components.

What has be been done:
Added slim scrollbar on the right side of the lists.
Scroll bar only activates for desktops; ex(macos, window, linux) and not any mobile builds
Scrollbar always visibile, but highlights on active more and passive on inactive.

Tested for mutiple page which uses ListView and the work of scrollbar

Screen.Recording.2025-10-23.at.12.18.39.PM.mov

@github-actions
Copy link

github-actions bot commented Oct 10, 2025

Pull Request Test Coverage Report for Build 18618721137

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 26 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.02%) to 19.633%

Files with Coverage Reduction New Missed Lines %
build-mm-db/core/mm_core_autogen/EWIEGA46WW/moc_merginapi.cpp 3 44.31%
mm/core/merginuserauth.cpp 9 68.24%
mm/core/merginapi.cpp 14 74.98%
Totals Coverage Status
Change from base Build 18284755654: -0.02%
Covered Lines: 13933
Relevant Lines: 70969

💛 - Coveralls

@kaustuvpokharel kaustuvpokharel marked this pull request as ready for review October 10, 2025 20:04
@kaustuvpokharel kaustuvpokharel linked an issue Oct 10, 2025 that may be closed by this pull request
anchors.right: listView.right
implicitHeight: listView.height
opacity: active ? 1.0 : 0.0
Behavior on opacity { NumberAnimation { duration: 150 } }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Behavior on opacity { NumberAnimation { duration: 150 } }

From the customers feedback I would not hide the scrollbar

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But usually every scrollbar on the internet has the hide, and it activate immediately with slight scroll.
Open to change it is we need to show scroll bar all the time!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is that the customer that raised this issue was not able to scroll and that's why they wanted the scrollbar. I would keep the scrollbar always visible and just have an effect to change colors when in use and when not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood, I would make the respective changes.

policy: isMobile ? ScrollBar.AlwaysOff : ScrollBar.AsNeeded
visible: !isMobile
interactive: !isMobile
anchors.right: listView.right
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't there API to set this in a clearer way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, I don't see a better way then this here, it does seem like micro-managed properties but it best here. We could use a singleton QObject to have the logic which is also not the best case, as it will be over kill for this tiny change.
If you had a better idea, I am open to change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you misunderstood me. What I meant is why do you use both visible and interactive? Isn't one enough? And also from the documentation it looks like attaching Scrollbar to Flickable should be enough to set it's position, there is no need for anchors.

Copy link
Contributor

@Withalion Withalion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought, it would make more sense to move the scrollbar directly into MMListView and/or MMScrollView as we want the scrollbar for all lists in the app as mentioned in #4127 . Right now it would be just for feature list.

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially MMFeatureListPage directly had the scrollbar which has Qt.platform.os so I had imported it, I took it to the ListView now.


policy: ScrollBar.AlwaysOn
visible: !isMobile && (root.contentHeight > root.height)
opacity: (pressed || root.moving) ? 0.7 : 0.4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't active be enough https://doc.qt.io/qt-6/qml-qtquick-controls-scrollbar.html#active-prop?

Suggested change
opacity: (pressed || root.moving) ? 0.7 : 0.4
opacity: active ? 0.7 : 0.4

}

ScrollBar.vertical.policy: ScrollBar.AlwaysOff
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the Qt docs-suggested way of disabling scrollbar https://doc.qt.io/qt-6/qml-qtquick-controls-scrollview.html#scroll-bars?

ScrollBar.vertical: ScrollBar {
id: verticalScrollBar

policy: ScrollBar.AsNeeded
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have a different value here compared to MMListView?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar comments apply here as in MMListView

@Withalion Withalion changed the base branch from dev/2025.8.0 to master November 11, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add scrollbar for desktop builds in lists

4 participants