import QtQuick import qs.Common import qs.Widgets Rectangle { id: root property bool isVertical: axis?.isVertical ?? false property var axis: null property bool isActive: false property string section: "right" property var popupTarget: null property var parentScreen: null property real widgetThickness: 30 property real barThickness: 48 readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetThickness / 30)) signal clicked() width: isVertical ? widgetThickness : (colorPickerIcon.width + horizontalPadding * 2) height: isVertical ? (colorPickerIcon.height + horizontalPadding * 2) : widgetThickness radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius color: { if (SettingsData.dankBarNoBackground) { return "transparent"; } const baseColor = colorPickerArea.containsMouse ? Theme.widgetBaseHoverColor : Theme.widgetBaseBackgroundColor; return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency); } DankIcon { id: colorPickerIcon anchors.centerIn: parent name: "palette" size: Theme.barIconSize(barThickness, -4) color: colorPickerArea.containsMouse || root.isActive ? Theme.primary : Theme.surfaceText } MouseArea { id: colorPickerArea anchors.fill: parent hoverEnabled: true cursorShape: Qt.PointingHandCursor onPressed: { root.colorPickerRequested(); } } signal colorPickerRequested() }