diff --git a/data/qml/QmlGridView.qml b/data/qml/QmlGridView.qml index cbef90a03..af95e8efc 100644 --- a/data/qml/QmlGridView.qml +++ b/data/qml/QmlGridView.qml @@ -15,6 +15,7 @@ Rectangle { GridView { id: gridView anchors.fill: parent + //anchors.rightMargin: scrollBar.width cellHeight: cellWidth cellWidth: calculateCoverSize(gridView.width - 3) @@ -51,4 +52,11 @@ Rectangle { } } } + + ScrollBar { + id: scrollBar + listView: gridView + orientation: Qt.Vertical + margin: -width + } } diff --git a/data/qml/tomahawkimports/FlexibleHeader.qml b/data/qml/tomahawkimports/FlexibleHeader.qml index 6f6dd5c38..e86f15f1b 100644 --- a/data/qml/tomahawkimports/FlexibleHeader.qml +++ b/data/qml/tomahawkimports/FlexibleHeader.qml @@ -60,6 +60,7 @@ Rectangle { height: parent.height * 0.8 width: height anchors.verticalCenter: parent.verticalCenter + smooth: true } Column { diff --git a/data/qml/tomahawkimports/ScrollBar.qml b/data/qml/tomahawkimports/ScrollBar.qml index f4c3b0282..351e37803 100644 --- a/data/qml/tomahawkimports/ScrollBar.qml +++ b/data/qml/tomahawkimports/ScrollBar.qml @@ -9,6 +9,8 @@ Item { // the orientation of the scrollbar property variant orientation : Qt.Vertical + property int margin: defaultFontHeight * 0.25 + states: [ State { name: "hidden"; when: !listView.moving @@ -34,9 +36,9 @@ Item { anchors { left: orientation == Qt.Vertical ? listView.right : listView.left - leftMargin: orientation == Qt.Vertical ? defaultFontHeight / 4 : 0 + leftMargin: orientation == Qt.Vertical ? scrollBar.margin : 0 top: orientation == Qt.Vertical ? listView.top : listView.bottom - topMargin: orientation == Qt.Vertical ? 0 : defaultFontHeight / 4 + topMargin: orientation == Qt.Vertical ? 0 : scrollBar.margin bottom: orientation == Qt.Vertical ? listView.bottom : undefined right: orientation == Qt.Vertical ? undefined : listView.right } @@ -48,19 +50,20 @@ Item { radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1) color: "white" opacity: 0.2 + clip: true + // Size the bar to the required size, depending upon the orientation. + Rectangle { + property real position: orientation == Qt.Vertical ? (listView.contentY / listView.contentHeight) : (listView.contentX / listView.contentWidth) + property real pageSize: orientation == Qt.Vertical ? (listView.height / listView.contentHeight) : (listView.width / listView.contentWidth) + + x: orientation == Qt.Vertical ? 1 : (position * (scrollBar.width-2) + 1) + y: orientation == Qt.Vertical ? (position * (scrollBar.height-2) + 1) : 1 + width: orientation == Qt.Vertical ? (parent.width-2) : (pageSize * (scrollBar.width-2)) + height: orientation == Qt.Vertical ? (pageSize * (scrollBar.height-2)) : (parent.height-2) + radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1) + color: "white" + opacity: 1 + } } - // Size the bar to the required size, depending upon the orientation. - Rectangle { - property real position: orientation == Qt.Vertical ? (listView.contentY / listView.contentHeight) : (listView.contentX / listView.contentWidth) - property real pageSize: orientation == Qt.Vertical ? (listView.height / listView.contentHeight) : (listView.width / listView.contentWidth) - - x: orientation == Qt.Vertical ? 1 : (position * (scrollBar.width-2) + 1) - y: orientation == Qt.Vertical ? (position * (scrollBar.height-2) + 1) : 1 - width: orientation == Qt.Vertical ? (parent.width-2) : (pageSize * (scrollBar.width-2)) - height: orientation == Qt.Vertical ? (pageSize * (scrollBar.height-2)) : (parent.height-2) - radius: orientation == Qt.Vertical ? (width/2 - 1) : (height/2 - 1) - color: "white" - opacity: 0.2 - } }