Commit 5e87ac61 authored by Exc404's avatar Exc404

fix ScrollView

parent 3d2434b3
...@@ -92,6 +92,17 @@ C.Button { ...@@ -92,6 +92,17 @@ C.Button {
opacity: 1; opacity: 1;
} }
},
State {
name: "";
PropertyChanges {
target: game;
scale: 1;
}
PropertyChanges {
target: bgNameGrad;
opacity: 0;
}
} }
] ]
......
...@@ -15,6 +15,7 @@ ScrollView { ...@@ -15,6 +15,7 @@ ScrollView {
id: gamesScroller id: gamesScroller
anchors.fill: parent anchors.fill: parent
anchors.topMargin: topNavigation.height anchors.topMargin: topNavigation.height
ScrollBar.vertical: ScrollBar { ScrollBar.vertical: ScrollBar {
id: scrolV; id: scrolV;
height: parent.height height: parent.height
...@@ -50,11 +51,12 @@ ScrollView { ...@@ -50,11 +51,12 @@ ScrollView {
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
columns: 5 columns: 5
rows: Math.max(Math.ceil(children.length / columns), 1) rows: Math.max(Math.ceil(children.length / columns), 1)+1
anchors.rightMargin: rowSpacing * 2 anchors.rightMargin: rowSpacing * 2
anchors.leftMargin: rowSpacing * 2 anchors.leftMargin: rowSpacing * 2
anchors.bottomMargin : 90 anchors.bottomMargin : 90
anchors.topMargin: Math.floor( gamesScroller.width / 100 * 3) anchors.topMargin: Math.floor( gamesScroller.width / 100 * 3)
rowSpacing: Math.floor( gamesScroller.width / 100 * 3) rowSpacing: Math.floor( gamesScroller.width / 100 * 3)
columnSpacing: rowSpacing columnSpacing: rowSpacing
...@@ -71,7 +73,7 @@ ScrollView { ...@@ -71,7 +73,7 @@ ScrollView {
gameIcon: model.icon gameIcon: model.icon
Layout.bottomMargin : Layout.bottomMargin :
(index - index % gamesGrid.columns) / (index - index % gamesGrid.columns) /
gamesGrid.columns === gamesGrid.rows - 1 ? gamesGrid.rowSpacing * 2 : 0 gamesGrid.columns === gamesGrid.rows - 2 ? gamesGrid.rowSpacing * 2 : 0
onFocusChanged: if(focus) { onFocusChanged: if(focus) {
gamesScroller.scrollToY(y); gamesScroller.scrollToY(y);
} }
...@@ -106,6 +108,14 @@ ScrollView { ...@@ -106,6 +108,14 @@ ScrollView {
// Layout.topMargin: Layout.preferredHeight // Layout.topMargin: Layout.preferredHeight
} }
}
Rectangle{
Layout.preferredWidth: 1
Layout.preferredHeight: 1
color: "red"
opacity: 0
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment