status-desktop/ui/imports/shared/controls/FoldableHeader.qml
Noelia d5134fe864 feat(shared/controls): Moved foldable header and generic list view from wallet to shared
Renamed `ManageTokensListViewBase` to `EmptyShapeRectangleFooterListView` and moved `FoldableHeader` to shared/controls.

Updated related `ManageXXPanel` components.
2024-02-19 11:13:23 +01:00

65 lines
1.4 KiB
QML

import QtQuick 2.15
import QtQuick.Layouts 1.15
import StatusQ.Controls 0.1
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
Rectangle {
id: root
property bool folded: false
property alias title: label.text
property alias switchText: modeSwitch.text
property alias checked: modeSwitch.checked
signal toggleFolding
signal toggleSwitch
height: headerContent.height
z: 1
color: Theme.palette.statusListItem.backgroundColor
QtObject {
id: d
readonly property int sectionHeight: 64
}
RowLayout {
id: headerContent
width: parent.width
height: d.sectionHeight
StatusFlatButton {
checkable: true
size: StatusBaseButton.Size.Small
icon.name: checked ? "chevron-down" : "next"
textColor: Theme.palette.baseColor1
textHoverColor: Theme.palette.directColor1
checked: !root.folded
onToggled: root.toggleFolding()
}
StatusBaseText {
id: label
Layout.fillWidth: true
}
StatusSwitch {
id: modeSwitch
objectName: "switch"
visible: !!text
LayoutMirroring.enabled: true
LayoutMirroring.childrenInherit: true
textColor: Theme.palette.baseColor1
font.pixelSize: 13
onToggled: root.toggleSwitch()
}
}
}