2023-02-14 09:34:15 +08:00
|
|
|
import QtQuick 2.0
|
|
|
|
import QtQuick.Layouts 1.12
|
2023-03-06 09:37:06 +08:00
|
|
|
import QtQuick.Controls 2.5
|
|
|
|
|
2023-03-31 16:08:10 +08:00
|
|
|
MouseArea {
|
|
|
|
id: control
|
|
|
|
hoverEnabled: true
|
2023-06-02 15:44:16 +08:00
|
|
|
ToolTip.text: comment
|
2023-03-06 09:37:06 +08:00
|
|
|
ToolTip.visible: control.containsMouse
|
2023-06-06 09:22:29 +08:00
|
|
|
ToolTip.delay: 500
|
2023-04-26 17:04:22 +08:00
|
|
|
states: State {
|
|
|
|
when: control.activeFocus
|
|
|
|
PropertyChanges {
|
|
|
|
target: controlBase
|
|
|
|
alpha: 0.55
|
|
|
|
}
|
|
|
|
}
|
2023-03-31 16:08:10 +08:00
|
|
|
StyleBackground {
|
2023-04-26 17:04:22 +08:00
|
|
|
id: controlBase
|
2023-02-14 09:34:15 +08:00
|
|
|
anchors.fill: parent
|
2023-03-31 16:08:10 +08:00
|
|
|
radius: 4
|
|
|
|
useStyleTransparent: false
|
|
|
|
alpha: control.containsPress ? 0.82 : control.containsMouse ? 0.55 : 0.00
|
2023-02-14 09:34:15 +08:00
|
|
|
|
2023-03-31 16:08:10 +08:00
|
|
|
RowLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
StyleText {
|
|
|
|
Layout.preferredHeight: parent.height
|
|
|
|
Layout.preferredWidth: contentWidth
|
|
|
|
Layout.leftMargin: 12
|
2023-02-14 09:34:15 +08:00
|
|
|
|
2023-03-31 16:08:10 +08:00
|
|
|
horizontalAlignment: Qt.AlignLeft
|
|
|
|
verticalAlignment: Qt.AlignVCenter
|
|
|
|
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"
|
|
|
|
}
|
2023-02-14 09:34:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|