2024-10-15 21:26:12 +02:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
2021-09-28 18:04:06 +03:00
|
|
|
|
2023-04-12 21:08:42 +02:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2021-09-28 18:04:06 +03:00
|
|
|
import utils 1.0
|
2021-10-28 00:27:49 +03:00
|
|
|
import shared.panels 1.0
|
2020-09-29 10:41:27 +02:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
2023-06-07 16:18:29 +03:00
|
|
|
|
2020-09-29 10:41:27 +02:00
|
|
|
property bool selected: false
|
|
|
|
property bool useIconInsteadOfImage: false
|
2024-10-15 21:26:12 +02:00
|
|
|
property url source: Theme.svg("history")
|
2020-09-29 10:41:27 +02:00
|
|
|
signal clicked
|
2023-06-07 16:18:29 +03:00
|
|
|
|
|
|
|
implicitHeight: 24
|
|
|
|
implicitWidth: 24
|
2020-09-29 10:41:27 +02:00
|
|
|
|
|
|
|
RoundedImage {
|
|
|
|
visible: !useIconInsteadOfImage
|
|
|
|
id: iconImage
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
|
|
|
source: root.source
|
|
|
|
onClicked: {
|
|
|
|
root.clicked()
|
|
|
|
}
|
|
|
|
}
|
2023-06-07 16:18:29 +03:00
|
|
|
|
2020-09-29 10:41:27 +02:00
|
|
|
RoundedIcon {
|
|
|
|
id: iconIcon
|
|
|
|
visible: useIconInsteadOfImage
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
|
|
|
iconWidth: 6
|
2024-10-15 21:26:12 +02:00
|
|
|
color: Theme.palette.darkGrey
|
2020-09-29 10:41:27 +02:00
|
|
|
source: root.source
|
|
|
|
onClicked: {
|
|
|
|
root.clicked()
|
|
|
|
}
|
|
|
|
}
|
2023-04-12 21:08:42 +02:00
|
|
|
|
2020-09-29 10:41:27 +02:00
|
|
|
Rectangle {
|
|
|
|
visible: root.selected
|
2023-04-12 21:08:42 +02:00
|
|
|
width: parent.width
|
2020-09-29 10:41:27 +02:00
|
|
|
height: 2
|
2023-04-12 21:08:42 +02:00
|
|
|
radius: 1
|
|
|
|
color: Theme.palette.primaryColor1
|
2020-09-29 10:41:27 +02:00
|
|
|
y: root.y + root.height + 6
|
|
|
|
}
|
|
|
|
}
|