Advertisement
Dmitriiiiiqiq

GamesListDelegateBackground.qml

Nov 16th, 2022
1,757
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 1.98 KB | None | 0 0
  1. import QtQuick
  2. import QtQuick.Controls
  3. import QtQuick.Layouts
  4. import Qt5Compat.GraphicalEffects
  5. import "../../../../../../base_qml/common/components/effects"
  6.  
  7. Item {
  8.     id: backgroundItem
  9.  
  10.     property real backgroundRadius: 4
  11.     property string listElementName: "cash-tables"
  12.     property color listElementBackgroundColor: "#ff0000"
  13.  
  14.     implicitWidth: 302
  15.     implicitHeight: 84
  16.  
  17.     Rectangle {
  18.         id: backgroundShadow
  19.  
  20.         anchors.fill: parent
  21.  
  22.         layer.enabled: true
  23.         layer.effect: RectangularGlow {
  24.             anchors.fill: backgroundShadow
  25.             glowRadius: 8
  26.             color: Qt.rgba(0, 0, 0, 0.5)
  27.         }
  28.     }
  29.  
  30.     Rectangle {
  31.         id: backgroundImageContainer
  32.  
  33.         anchors.fill: parent
  34.  
  35.         radius: backgroundItem.backgroundRadius
  36.         color: listElementBackgroundColor
  37.  
  38.         SpriteSequence {
  39.             id: image
  40.  
  41.             width: parent.width
  42.             height: parent.height
  43.  
  44.  
  45.             Sprite {
  46.                 id: sprite
  47.  
  48.                 frameDuration: 300.0
  49.                 frameSync: false
  50.                 frameWidth: 600.0
  51.                 frameHeight: 166.0
  52.                 frameCount: 200.0
  53.  
  54.                 source: Qt.resolvedUrl( "../../../../../../qml/mobile/forms/lobby/home/gameslist/sprite/gameslist-" + listElementName + "-background.png" )
  55.             }
  56.         }
  57.  
  58.         clip: true
  59.  
  60.         layer.enabled: true
  61.         layer.effect: SEOpacityMaskEffect {
  62.             source: backgroundImageContainer
  63.             maskSource: Rectangle {
  64.                 width: backgroundImageContainer.width
  65.                 height: backgroundImageContainer.height
  66.                 radius: backgroundImageContainer.radius
  67.             }
  68.         }
  69.     }
  70.  
  71.     Rectangle {
  72.         id: backgroundBorder
  73.  
  74.         anchors.fill: parent
  75.  
  76.         radius: parent.backgroundRadius
  77.         border.width: 1
  78.         border.color: Qt.rgba(1.0, 1.0, 1.0, 0.3)
  79.         color: "transparent"
  80.     }
  81. }
  82.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement