Add scrollbars to flickable and listviews

This commit is contained in:
miruka 2019-07-20 15:06:38 -04:00
parent 1ffca37021
commit d033ea84e8
8 changed files with 45 additions and 25 deletions

View File

@ -0,0 +1,28 @@
// Copyright 2019 miruka
// This file is part of harmonyqml, licensed under LGPLv3.
import QtQuick 2.12
import QtQuick.Controls 2.12
ListView {
add: Transition {
HNumberAnimation { properties: "x,y"; from: 100 }
}
move: Transition {
HNumberAnimation { properties: "x,y" }
}
displaced: Transition {
HNumberAnimation { properties: "x,y" }
}
remove: Transition {
ParallelAnimation {
HNumberAnimation { property: "opacity"; to: 0 }
HNumberAnimation { properties: "x,y"; to: 100 }
}
}
interactive: false
}

View File

@ -0,0 +1,10 @@
// Copyright 2019 miruka
// This file is part of harmonyqml, licensed under LGPLv3.
import QtQuick 2.12
import QtQuick.Controls 2.12
Flickable {
interactive: contentWidth > width || contentHeight > height
ScrollBar.vertical: ScrollBar {}
}

View File

@ -2,24 +2,9 @@
// This file is part of harmonyqml, licensed under LGPLv3.
import QtQuick 2.12
import QtQuick.Controls 2.12
ListView {
add: Transition {
HNumberAnimation { properties: "x,y"; from: 100 }
}
move: Transition {
HNumberAnimation { properties: "x,y" }
}
displaced: Transition {
HNumberAnimation { properties: "x,y" }
}
remove: Transition {
ParallelAnimation {
HNumberAnimation { property: "opacity"; to: 0 }
HNumberAnimation { properties: "x,y"; to: 100 }
}
}
HFixedListView {
interactive: true
ScrollBar.vertical: ScrollBar {}
}

View File

@ -72,13 +72,12 @@ SwipeView {
rightPadding: leftPadding
Behavior on leftPadding { HNumberAnimation {} }
Flickable {
HFlickable {
id: innerFlickable
anchors.fill: parent
clip: true
contentWidth: parent.width
contentHeight: contentColumn.childrenRect.height
interactive: contentWidth > width || contentHeight > height
HColumnLayout {
id: contentColumn

View File

@ -81,7 +81,6 @@ Column {
RoomCategoriesList {
id: roomCategoriesList
interactive: false // no scrolling
visible: height > 0
width: parent.width
height: childrenRect.height * (accountDelegate.expanded ? 1 : 0)

View File

@ -6,7 +6,7 @@ import QtQuick.Layouts 1.12
import SortFilterProxyModel 0.2
import "../Base"
HListView {
HFixedListView {
property string userId: ""
id: roomCategoriesList

View File

@ -41,7 +41,6 @@ Column {
RoomList {
id: roomList
interactive: false // no scrolling
visible: height > 0
width: roomCategoriesList.width - accountList.Layout.leftMargin
opacity: roomCategoryDelegate.expanded ? 1 : 0

View File

@ -7,7 +7,7 @@ import SortFilterProxyModel 0.2
import "../Base"
import "../utils.js" as Utils
HListView {
HFixedListView {
id: roomList
property string userId: ""