2020-09-29 08:41:27 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2023-04-12 19:08:42 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2021-09-28 15:04:06 +00:00
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared.panels 1.0
|
2020-09-29 08:41:27 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
property bool selected: false
|
|
|
|
property bool useIconInsteadOfImage: false
|
2022-04-01 20:53:57 +00:00
|
|
|
property url source: Style.svg("history")
|
2020-09-29 08:41:27 +00:00
|
|
|
signal clicked
|
|
|
|
height: 24
|
|
|
|
width: 24
|
|
|
|
|
|
|
|
RoundedImage {
|
|
|
|
visible: !useIconInsteadOfImage
|
|
|
|
id: iconImage
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
|
|
|
source: root.source
|
|
|
|
onClicked: {
|
|
|
|
root.clicked()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RoundedIcon {
|
|
|
|
id: iconIcon
|
|
|
|
visible: useIconInsteadOfImage
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
|
|
|
iconWidth: 6
|
|
|
|
color: Style.current.darkGrey
|
|
|
|
source: root.source
|
|
|
|
onClicked: {
|
|
|
|
root.clicked()
|
|
|
|
}
|
|
|
|
}
|
2023-04-12 19:08:42 +00:00
|
|
|
|
2020-09-29 08:41:27 +00:00
|
|
|
Rectangle {
|
|
|
|
visible: root.selected
|
2023-04-12 19:08:42 +00:00
|
|
|
width: parent.width
|
2020-09-29 08:41:27 +00:00
|
|
|
height: 2
|
2023-04-12 19:08:42 +00:00
|
|
|
radius: 1
|
|
|
|
color: Theme.palette.primaryColor1
|
2020-09-29 08:41:27 +00:00
|
|
|
y: root.y + root.height + 6
|
|
|
|
}
|
|
|
|
}
|