49 lines
1.3 KiB
QML
49 lines
1.3 KiB
QML
import QtQuick 2.0
|
|
import QtQuick.Layouts 1.12
|
|
import QtQuick.Controls 2.5
|
|
|
|
MouseArea {
|
|
id: control
|
|
hoverEnabled: true
|
|
ToolTip.text: qsTr("Open the label selection interface")
|
|
ToolTip.visible: control.containsMouse
|
|
states: State {
|
|
when: control.activeFocus
|
|
PropertyChanges {
|
|
target: controlBase
|
|
alpha: 0.55
|
|
}
|
|
}
|
|
StyleBackground {
|
|
id: controlBase
|
|
anchors.fill: parent
|
|
radius: 4
|
|
useStyleTransparent: false
|
|
alpha: control.containsPress ? 0.82 : control.containsMouse ? 0.55 : 0.00
|
|
|
|
RowLayout {
|
|
anchors.fill: parent
|
|
StyleText {
|
|
Layout.preferredHeight: parent.height
|
|
Layout.preferredWidth: contentWidth
|
|
Layout.leftMargin: 12
|
|
|
|
horizontalAlignment: Qt.AlignLeft
|
|
verticalAlignment: Qt.AlignVCenter
|
|
font.pixelSize: 14
|
|
font.bold: true
|
|
text: name
|
|
}
|
|
|
|
Image {
|
|
visible: control.containsMouse
|
|
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
|
Layout.preferredWidth: 24
|
|
Layout.preferredHeight: 24
|
|
Layout.rightMargin: 16
|
|
source: "image://appicon/open-menu-symbolic"
|
|
}
|
|
}
|
|
}
|
|
}
|