Guest User

PlatformCard.qml

a guest
Jun 4th, 2019
110
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Pegasus Frontend
  2. // Copyright (C) 2017-2018 Mátyás Mustoha
  3. //
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  16.  
  17.  
  18. import QtQuick 2.0
  19.  
  20. Item {
  21. property alias platformShortName: label.text
  22. property bool isOnTop: false
  23.  
  24. clip: true
  25.  
  26. Rectangle {
  27. id: main
  28. width: parent.width * 0.8
  29. height: parent.height
  30. color: "#4035ff"
  31. }
  32.  
  33. Rectangle {
  34. width: main.height * 1.7
  35. height: width
  36. color: main.color
  37. rotation: -70
  38. anchors {
  39. verticalCenter: parent.top
  40. horizontalCenter: main.right
  41. horizontalCenterOffset: vpx(-27)
  42. }
  43.  
  44. Text {
  45. id: label
  46. width: 0
  47. text: ""
  48. color: "#eee"
  49. anchors {
  50. left: parent.left
  51. bottom: parent.bottom
  52. leftMargin: vpx(8)
  53. bottomMargin: vpx(4)
  54. }
  55. font {
  56. bold: true
  57. capitalization: Font.AllUppercase
  58. pixelSize: vpx(16)
  59. family: globalFonts.condensed
  60. }
  61. }
  62.  
  63. Rectangle {
  64. color: "#faa"
  65. width: parent.width
  66. height: vpx(2)
  67. anchors.top: parent.bottom
  68. anchors.left: parent.left
  69. antialiasing: true
  70. }
  71. }
  72.  
  73. Image {
  74. source: "../assets/logos/" + platformShortName + ".svg"
  75. sourceSize.height: 100
  76. fillMode: Image.PreserveAspectFit
  77.  
  78. asynchronous: true
  79. opacity: parent.isOnTop ? 1.0 : 0.3
  80.  
  81. width: parent.width * 0.6
  82. height: parent.height - 12
  83. anchors {
  84. bottom: parent.bottom
  85. bottomMargin: vpx(6)
  86. horizontalCenter: parent.horizontalCenter
  87. horizontalCenterOffset: vpx(-32)
  88. }
  89. }
  90. }
RAW Paste Data