Advertisement
Guest User

Untitled

a guest
Feb 17th, 2018
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 2.26 KB | None | 0 0
  1. import QtQuick 2.0
  2.  
  3. FocusScope {
  4.  
  5.     Rectangle {
  6.         id: xboxgrid
  7.  
  8.         color: "#272727"
  9.         anchors.left: parent.left
  10.         anchors.right: parent.right
  11.         anchors.top: parent.top
  12.         anchors.bottom: parent.bottom
  13.         clip: true
  14.  
  15.         Component {
  16.             id: xboxDelegate
  17.             Rectangle {
  18.                 width: grid.cellWidth; height: grid.cellHeight
  19.                 //width: vpx(145); height: vpx(216)
  20.                 color: "black"
  21.                 clip: true
  22.                 Column {
  23.                     anchors.fill: parent
  24.                     Image {
  25.                         id: cover
  26.                         anchors.right: parent.right
  27.                         anchors.left: parent.left
  28.                         height: vpx(216)
  29.  
  30.                         fillMode: Image.PreserveAspectCrop
  31.                         source: assets.banner || assets.steam || assets.boxFront
  32.                         sourceSize { width: 300; height: 300 }
  33.                         asynchronous: true
  34.                     }
  35.                     Text {
  36.                         text: modelData.title;
  37.                         font.family: "Segoe UI";
  38.                         font.bold: true;
  39.                         font.pointSize: 14;
  40.                         color:"white";
  41.                         wrapMode: Text.WordWrap;
  42.                         width: parent.width;
  43.                     }
  44.                 }
  45.             }
  46.         }
  47.  
  48.         GridView {
  49.             id: grid
  50.             anchors.fill: parent
  51.             //anchors.margins: vpx(70)
  52.             anchors.topMargin: vpx(15)
  53.             anchors.leftMargin: vpx(70)
  54.             cellWidth: vpx(150)
  55.             cellHeight: vpx(300)
  56.  
  57.             model: api.currentCollection.gameList.model
  58.             delegate: xboxDelegate
  59.  
  60.             currentIndex: api.collectionList.index
  61.             highlight:
  62.                 Rectangle {
  63.                 width: grid.cellWidth;
  64.                 height: grid.cellHeight
  65.                 color: "transparent"
  66.                 border.color: "white"
  67.                 border.width: vpx(3)
  68.                 scale: 1.01
  69.                 z: 2
  70.             }
  71.             highlightMoveDuration: 0
  72.             focus: true
  73.  
  74.         }
  75.     }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement