Warning, /rolisteam/rolisteam/src/libraries/qml_views/CustomItems/PermissionSlider.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick 2.15
0002 import QtQuick.Controls 2.15
0003 import Customization 1.0
0004 
0005 Slider {
0006     id: control
0007     property QtObject style: Theme.styleSheet("PermissionSlider")
0008     enum Permission {
0009         NoPermission,
0010         ReadOnlyPermission,
0011         WritePermission
0012     }
0013 
0014     property int permission: control.value === 0  ? PermissionSlider.Permission.NoPermission :
0015                              control.value === 1 ? PermissionSlider.Permission.ReadOnlyPermission :
0016                                                    PermissionSlider.Permission.WritePermission
0017 
0018     from: control.style.startValue
0019     to: control.style.endValue
0020     stepSize: 1.0
0021     snapMode: Slider.SnapOnRelease
0022 
0023     background: Rectangle {
0024             x: control.leftPadding
0025             y: control.topPadding + control.availableHeight / 2 - height / 2
0026             implicitWidth: control.width
0027             implicitHeight: control.availableHeight / 4
0028             width: control.availableWidth
0029             height: implicitHeight
0030             radius: control.style.radiusSize
0031             color: control.style.backgroundColor
0032 
0033             Rectangle {
0034                 width: control.visualPosition * parent.width
0035                 height: parent.height
0036                 color: control.value == 1 ? control.style.readOnlyPermColor : control.style.writePermColor
0037                 radius: control.style.radiusSize
0038             }
0039         }
0040 
0041 }