Add scroll bars to the computer grid and app grid

This commit is contained in:
Cameron Gutman 2018-07-08 23:05:36 -07:00
parent c4a1f74b02
commit c35d07c961
2 changed files with 24 additions and 0 deletions

View File

@ -9,6 +9,7 @@ GridView {
property int computerIndex property int computerIndex
property AppModel appModel : createModel() property AppModel appModel : createModel()
id: appGrid
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: (parent.width % (cellWidth + anchors.rightMargin)) / 2 anchors.leftMargin: (parent.width % (cellWidth + anchors.rightMargin)) / 2
anchors.topMargin: 5 anchors.topMargin: 5
@ -87,4 +88,15 @@ GridView {
} }
} }
} }
ScrollBar.vertical: ScrollBar {
parent: appGrid.parent
anchors {
top: appGrid.top
left: appGrid.right
bottom: appGrid.bottom
leftMargin: -10
}
}
} }

View File

@ -10,6 +10,7 @@ import ComputerManager 1.0
GridView { GridView {
property ComputerModel computerModel : createModel() property ComputerModel computerModel : createModel()
id: pcGrid
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 5 anchors.leftMargin: 5
anchors.topMargin: 5 anchors.topMargin: 5
@ -227,4 +228,15 @@ GridView {
} }
} }
} }
ScrollBar.vertical: ScrollBar {
parent: pcGrid.parent
anchors {
top: pcGrid.top
left: pcGrid.right
bottom: pcGrid.bottom
leftMargin: -10
}
}
} }