mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
- CC Color picker widget - Tooltips in more places - Attempt to improve niri screen transitiosn
54 lines
1.6 KiB
QML
54 lines
1.6 KiB
QML
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.iconSize - 6
|
|
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()
|
|
|
|
} |