Skip to content

Commit

Permalink
Hide scrollbar when there is nothing to scroll
Browse files Browse the repository at this point in the history
Fixes #756.
  • Loading branch information
jpetrell committed Feb 19, 2024
1 parent 6dd8356 commit c382a49
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/controls/ScrollBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ CT.ScrollBar {
rightPadding: Theme.geometry_scrollBar_horizontalMargin
minimumSize: orientation == Qt.Horizontal ? height / width : width / height

// Hide the scrollbar when there is nothing to scroll.
// QTBUG-70470: Use ScrollBar.AsNeeded policy once it works
enabled: parent.contentHeight > parent.height
opacity: enabled ? 1.0 : 0.0
Behavior on opacity { OpacityAnimator { duration: Theme.animation_scrollbar_fade_duration; easing: Easing.InOutQuad } }

background: Item {
implicitWidth: Theme.geometry_scrollBar_bar_width
implicitHeight: 100
Expand Down
1 change: 1 addition & 0 deletions themes/animation/Animation.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"animation_briefPage_gaugeLabel_initialize_duration": 400,
"animation_controlCards_slide_duration": 150,
"animation_toastNotification_fade_duration": 250,
"animation_scrollbar_fade_duration": 250,
"animation_generator_starting_toastNotification_autoClose_duration": 5000,
"animation_generator_stopping_toastNotification_autoClose_duration": 3000,
"animation_generator_stopWhenAc1Available_toastNotification_autoClose_duration": 10000,
Expand Down

0 comments on commit c382a49

Please sign in to comment.