mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-02 03:28:28 -04:00
theme: large consolidation of colors into Theme.qml, add
surfaceContainerLow/Lowest
This commit is contained in:
@@ -33,7 +33,7 @@ Rectangle {
|
||||
width: cellWidth - 1
|
||||
height: cellHeight - 1
|
||||
radius: Theme.cornerRadius
|
||||
color: currentIndex === index ? Theme.primaryPressed : mouseArea.containsMouse ? Theme.primaryPressed : "transparent"
|
||||
color: currentIndex === index ? Theme.primaryPressed : mouseArea.containsMouse ? Theme.primaryPressed : Theme.withAlpha(Theme.primaryPressed, 0)
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
|
||||
@@ -35,7 +35,7 @@ Rectangle {
|
||||
width: listView.width
|
||||
height: itemHeight
|
||||
radius: Theme.cornerRadius
|
||||
color: isCurrentItem ? Theme.primaryPressed : mouseArea.containsMouse ? Theme.primaryPressed : "transparent"
|
||||
color: isCurrentItem ? Theme.primaryPressed : mouseArea.containsMouse ? Theme.primaryPressed : Theme.withAlpha(Theme.primaryPressed, 0)
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -9,8 +9,8 @@ Item {
|
||||
|
||||
property string screenName: ""
|
||||
property bool isColorWallpaper: {
|
||||
var currentWallpaper = SessionData.getMonitorWallpaper(screenName)
|
||||
return currentWallpaper && currentWallpaper.startsWith("#")
|
||||
var currentWallpaper = SessionData.getMonitorWallpaper(screenName);
|
||||
return currentWallpaper && currentWallpaper.startsWith("#");
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
@@ -23,7 +23,7 @@ Item {
|
||||
y: -parent.height * 0.3
|
||||
width: parent.width * 0.8
|
||||
height: parent.height * 1.5
|
||||
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.15)
|
||||
color: Theme.primaryPressed
|
||||
rotation: 35
|
||||
visible: !isColorWallpaper
|
||||
}
|
||||
@@ -33,7 +33,7 @@ Item {
|
||||
y: -parent.height * 0.2
|
||||
width: parent.width * 0.4
|
||||
height: parent.height * 1.2
|
||||
color: Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.12)
|
||||
color: Theme.secondaryHover
|
||||
rotation: 35
|
||||
visible: !isColorWallpaper
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ Rectangle {
|
||||
}
|
||||
|
||||
radius: width / 2
|
||||
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1)
|
||||
color: Theme.primaryHover
|
||||
border.color: "transparent"
|
||||
border.width: 0
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ Item {
|
||||
property color ringColor: Theme.outline
|
||||
property real minPreviewAlpha: 0.4
|
||||
readonly property bool translucent: swatchColor.a > 0 && swatchColor.a < 1
|
||||
readonly property color displayColor: translucent ? Qt.rgba(swatchColor.r, swatchColor.g, swatchColor.b, Math.max(swatchColor.a, minPreviewAlpha)) : swatchColor
|
||||
readonly property color displayColor: translucent ? Theme.withAlpha(swatchColor, Math.max(swatchColor.a, minPreviewAlpha)) : swatchColor
|
||||
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -159,7 +159,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
radius: Theme.cornerRadius
|
||||
color: dropdownArea.containsMouse || dropdownMenu.visible ? Theme.surfaceContainerHigh : (root.usePopupTransparency ? Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency) : Theme.surfaceContainer)
|
||||
border.color: dropdownMenu.visible ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
||||
border.color: dropdownMenu.visible ? Theme.primary : Theme.outlineHeavy
|
||||
border.width: dropdownMenu.visible ? 2 : 1
|
||||
|
||||
MouseArea {
|
||||
@@ -350,7 +350,7 @@ Item {
|
||||
|
||||
LayoutMirroring.enabled: I18n.isRtl
|
||||
LayoutMirroring.childrenInherit: true
|
||||
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 1)
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, 1)
|
||||
border.color: Theme.primary
|
||||
border.width: 2
|
||||
radius: Theme.cornerRadius
|
||||
@@ -481,7 +481,7 @@ Item {
|
||||
width: ListView.view.width
|
||||
height: 32
|
||||
radius: Theme.cornerRadius
|
||||
color: isSelected ? Theme.primaryHover : optionArea.containsMouse ? Theme.primaryHoverLight : "transparent"
|
||||
color: isSelected ? Theme.primaryHover : optionArea.containsMouse ? Theme.primaryHoverLight : Theme.withAlpha(Theme.primaryHoverLight, 0)
|
||||
|
||||
Row {
|
||||
anchors.left: parent.left
|
||||
@@ -498,7 +498,7 @@ Item {
|
||||
height: 16
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: delegateRoot.swatchColor !== undefined
|
||||
swatchColor: visible ? delegateRoot.swatchColor : "transparent"
|
||||
swatchColor: visible ? delegateRoot.swatchColor : Theme.withAlpha(delegateRoot.swatchColor, 0)
|
||||
ringColor: delegateRoot.isCurrentValue ? Theme.primary : Theme.outline
|
||||
}
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ Rectangle {
|
||||
width: 24
|
||||
height: 24
|
||||
radius: 12
|
||||
color: closeMouseArea.containsMouse ? Theme.errorHover : "transparent"
|
||||
color: closeMouseArea.containsMouse ? Theme.errorHover : Theme.withAlpha(Theme.errorHover, 0)
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
anchors.topMargin: Theme.spacingS
|
||||
|
||||
@@ -210,7 +210,7 @@ Item {
|
||||
width: searchResultsList.width
|
||||
height: 36
|
||||
radius: Theme.cornerRadius
|
||||
color: resultMouseArea.containsMouse ? Theme.surfaceLight : "transparent"
|
||||
color: resultMouseArea.containsMouse ? Theme.surfaceLight : Theme.withAlpha(Theme.surfaceLight, 0)
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -1038,7 +1038,7 @@ Item {
|
||||
readonly property string connectedBarSide: barTop ? "top" : (barBottom ? "bottom" : (barLeft ? "left" : "right"))
|
||||
readonly property real surfaceRadius: root.usesConnectedSurfaceChrome ? Theme.connectedSurfaceRadius : Theme.cornerRadius
|
||||
readonly property color surfaceColor: root.usesConnectedSurfaceChrome ? Theme.connectedSurfaceColor : Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
readonly property color surfaceBorderColor: root.usesConnectedSurfaceChrome ? "transparent" : (BlurService.enabled ? BlurService.borderColor : Theme.outlineMedium)
|
||||
readonly property color surfaceBorderColor: root.usesConnectedSurfaceChrome ? Theme.withAlpha(Theme.outlineMedium, 0) : (BlurService.enabled ? BlurService.borderColor : Theme.outlineMedium)
|
||||
readonly property real surfaceBorderWidth: root.usesConnectedSurfaceChrome ? 0 : BlurService.borderWidth
|
||||
readonly property real surfaceTopLeftRadius: root.usesConnectedSurfaceChrome && (barTop || barLeft) ? 0 : surfaceRadius
|
||||
readonly property real surfaceTopRightRadius: root.usesConnectedSurfaceChrome && (barTop || barRight) ? 0 : surfaceRadius
|
||||
|
||||
@@ -142,7 +142,7 @@ Item {
|
||||
value: root.value
|
||||
actualValue: root.playerValue
|
||||
showActualPlaybackState: root.isSeeking
|
||||
actualProgressColor: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.45)
|
||||
actualProgressColor: Theme.onSurface_38
|
||||
isPlaying: activePlayer && activePlayer.playbackState === MprisPlaybackState.Playing
|
||||
|
||||
MouseArea {
|
||||
@@ -178,10 +178,10 @@ Item {
|
||||
|
||||
Item {
|
||||
property real lineWidth: 3
|
||||
property color trackColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.40)
|
||||
property color trackColor: Theme.withAlpha(Theme.surfaceVariant, 0.40)
|
||||
property color fillColor: Theme.primary
|
||||
property color playheadColor: Theme.primary
|
||||
property color actualProgressColor: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.45)
|
||||
property color actualProgressColor: Theme.onSurface_38
|
||||
readonly property real midY: height / 2
|
||||
|
||||
Rectangle {
|
||||
|
||||
@@ -187,7 +187,7 @@ PanelWindow {
|
||||
anchors.fill: parent
|
||||
color: contentRect.slideoutSurfaceColor
|
||||
radius: Theme.connectedSurfaceRadius
|
||||
border.color: Theme.isConnectedEffect ? "transparent" : (BlurService.enabled ? BlurService.borderColor : Theme.outlineMedium)
|
||||
border.color: Theme.isConnectedEffect ? Theme.withAlpha(Theme.outlineMedium, 0) : (BlurService.enabled ? BlurService.borderColor : Theme.outlineMedium)
|
||||
border.width: Theme.isConnectedEffect ? 0 : BlurService.borderWidth
|
||||
}
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ StyledRect {
|
||||
width: 20
|
||||
height: 20
|
||||
radius: 10
|
||||
color: passwordToggleArea.containsMouse ? Theme.outlineStrong : "transparent"
|
||||
color: passwordToggleArea.containsMouse ? Theme.outlineStrong : Theme.withAlpha(Theme.outlineStrong, 0)
|
||||
visible: showPasswordToggle
|
||||
|
||||
DankIcon {
|
||||
@@ -239,7 +239,7 @@ StyledRect {
|
||||
width: 20
|
||||
height: 20
|
||||
radius: 10
|
||||
color: clearArea.containsMouse ? Theme.outlineStrong : "transparent"
|
||||
color: clearArea.containsMouse ? Theme.outlineStrong : Theme.withAlpha(Theme.outlineStrong, 0)
|
||||
visible: showClearButton && text.length > 0
|
||||
|
||||
DankIcon {
|
||||
|
||||
@@ -99,11 +99,11 @@ Item {
|
||||
radius: Theme.cornerRadius
|
||||
|
||||
// Distinguish disabled checked vs unchecked so unchecked disabled switches don't look enabled
|
||||
color: !toggle.enabled ? (toggle.checked ? Qt.alpha(Theme.surfaceText, 0.12) : "transparent") : (toggle.checked ? Theme.primary : Theme.surfaceVariantAlpha)
|
||||
color: !toggle.enabled ? (toggle.checked ? Qt.alpha(Theme.surfaceText, 0.12) : Theme.withAlpha(Qt.alpha(Theme.surfaceText, 0.12), 0)) : (toggle.checked ? Theme.primary : Theme.surfaceVariantAlpha)
|
||||
opacity: toggle.toggling ? 0.6 : 1
|
||||
|
||||
// M3 disabled unchecked border: on surface 12% opacity
|
||||
border.color: toggle.checked ? "transparent" : (!toggle.enabled ? Qt.alpha(Theme.surfaceText, 0.12) : Theme.outline)
|
||||
border.color: toggle.checked ? Theme.withAlpha(Theme.outline, 0) : (!toggle.enabled ? Qt.alpha(Theme.surfaceText, 0.12) : Theme.outline)
|
||||
|
||||
readonly property int pad: Math.round((height - thumb.width) / 2)
|
||||
readonly property int edgeLeft: pad
|
||||
@@ -119,8 +119,8 @@ Item {
|
||||
|
||||
// M3 disabled thumb:
|
||||
// checked = solid surface | unchecked = outlined off-state thumb
|
||||
color: !toggle.enabled ? (toggle.checked ? Theme.surface : "transparent") : (toggle.checked ? Theme.surface : Theme.outline)
|
||||
border.color: !toggle.enabled ? (toggle.checked ? "transparent" : Qt.alpha(Theme.surfaceText, 0.38)) : Theme.outline
|
||||
color: !toggle.enabled ? (toggle.checked ? Theme.surface : Theme.withAlpha(Theme.surface, 0)) : (toggle.checked ? Theme.surface : Theme.outline)
|
||||
border.color: !toggle.enabled ? (toggle.checked ? Theme.withAlpha(Qt.alpha(Theme.surfaceText, 0.38), 0) : Qt.alpha(Theme.surfaceText, 0.38)) : Theme.outline
|
||||
border.width: (toggle.checked && toggle.enabled) ? 1 : 2
|
||||
|
||||
x: toggle.checked ? toggleTrack.edgeRight : toggleTrack.edgeLeft
|
||||
|
||||
@@ -79,7 +79,7 @@ PanelWindow {
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.width: BlurService.enabled ? BlurService.borderWidth : 1
|
||||
border.color: BlurService.enabled ? BlurService.borderColor : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.color: BlurService.enabled ? BlurService.borderColor : Theme.outlineMedium
|
||||
|
||||
StyledText {
|
||||
id: textContent
|
||||
|
||||
@@ -114,7 +114,7 @@ Item {
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.width: 1
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.color: Theme.outlineMedium
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
|
||||
@@ -304,7 +304,7 @@ Item {
|
||||
topLeftRadius: Theme.cornerRadius
|
||||
topRightRadius: Theme.cornerRadius
|
||||
color: root.hasOverride ? Theme.surfaceContainer : Theme.surfaceContainerHighest
|
||||
border.color: root.hasOverride ? Theme.outlineVariant : "transparent"
|
||||
border.color: root.hasOverride ? Theme.outlineVariant : Theme.withAlpha(Theme.outlineVariant, 0)
|
||||
border.width: root.hasOverride ? 1 : 0
|
||||
|
||||
RowLayout {
|
||||
@@ -337,7 +337,7 @@ Item {
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: parent.radius
|
||||
color: chipArea.pressed ? Theme.surfaceTextHover : (chipArea.containsMouse ? Theme.surfaceTextHover : "transparent")
|
||||
color: chipArea.pressed ? Theme.surfaceTextHover : (chipArea.containsMouse ? Theme.surfaceTextHover : Theme.withAlpha(Theme.surfaceTextHover, 0))
|
||||
}
|
||||
|
||||
StyledText {
|
||||
@@ -461,7 +461,7 @@ Item {
|
||||
width: parent ? parent.width : 0
|
||||
height: expandedContent.implicitHeight + Theme.spacingL * 2
|
||||
color: Theme.surfaceContainerHigh
|
||||
border.color: root.hasOverride ? Theme.outlineVariant : "transparent"
|
||||
border.color: root.hasOverride ? Theme.outlineVariant : Theme.withAlpha(Theme.outlineVariant, 0)
|
||||
border.width: root.hasOverride ? 1 : 0
|
||||
bottomLeftRadius: Theme.cornerRadius
|
||||
bottomRightRadius: Theme.cornerRadius
|
||||
@@ -564,7 +564,7 @@ Item {
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: parent.radius
|
||||
color: editKeyChipArea.pressed ? Theme.surfaceTextHover : (editKeyChipArea.containsMouse && !parent.isSelected ? Theme.surfaceTextHover : "transparent")
|
||||
color: editKeyChipArea.pressed ? Theme.surfaceTextHover : (editKeyChipArea.containsMouse && !parent.isSelected ? Theme.surfaceTextHover : Theme.withAlpha(Theme.surfaceTextHover, 0))
|
||||
}
|
||||
|
||||
StyledText {
|
||||
@@ -597,7 +597,7 @@ Item {
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: parent.radius
|
||||
color: addKeyArea.pressed ? Theme.surfaceTextHover : (addKeyArea.containsMouse && !root.addingNewKey ? Theme.surfaceTextHover : "transparent")
|
||||
color: addKeyArea.pressed ? Theme.surfaceTextHover : (addKeyArea.containsMouse && !root.addingNewKey ? Theme.surfaceTextHover : Theme.withAlpha(Theme.surfaceTextHover, 0))
|
||||
}
|
||||
|
||||
DankIcon {
|
||||
@@ -653,7 +653,7 @@ Item {
|
||||
anchors.fill: parent
|
||||
radius: Theme.cornerRadius
|
||||
color: root.recording ? Theme.primaryContainer : Theme.surfaceContainer
|
||||
border.color: root.recording ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.3)
|
||||
border.color: root.recording ? Theme.primary : Theme.outlineHeavy
|
||||
border.width: root.recording ? 2 : 1
|
||||
|
||||
Row {
|
||||
@@ -796,7 +796,7 @@ Item {
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: parent.radius
|
||||
color: singleAddKeyArea.pressed ? Theme.surfaceTextHover : (singleAddKeyArea.containsMouse && !root.addingNewKey ? Theme.surfaceTextHover : "transparent")
|
||||
color: singleAddKeyArea.pressed ? Theme.surfaceTextHover : (singleAddKeyArea.containsMouse && !root.addingNewKey ? Theme.surfaceTextHover : Theme.withAlpha(Theme.surfaceTextHover, 0))
|
||||
}
|
||||
|
||||
DankIcon {
|
||||
@@ -873,7 +873,7 @@ Item {
|
||||
Layout.preferredHeight: root._buttonHeight
|
||||
radius: Theme.cornerRadius
|
||||
color: root._actionType === modelData.id ? Theme.surfaceContainerHighest : Theme.surfaceContainer
|
||||
border.color: root._actionType === modelData.id ? Theme.outline : (typeArea.containsMouse ? Theme.outlineVariant : "transparent")
|
||||
border.color: root._actionType === modelData.id ? Theme.outline : (typeArea.containsMouse ? Theme.outlineVariant : Theme.withAlpha(Theme.outlineVariant, 0))
|
||||
border.width: 1
|
||||
clip: true
|
||||
|
||||
@@ -1216,7 +1216,7 @@ Item {
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: parent.radius
|
||||
color: customToggleArea.pressed ? Theme.surfaceTextHover : (customToggleArea.containsMouse ? Theme.surfaceTextHover : "transparent")
|
||||
color: customToggleArea.pressed ? Theme.surfaceTextHover : (customToggleArea.containsMouse ? Theme.surfaceTextHover : Theme.withAlpha(Theme.surfaceTextHover, 0))
|
||||
}
|
||||
|
||||
DankIcon {
|
||||
@@ -1464,7 +1464,7 @@ Item {
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: parent.radius
|
||||
color: presetToggleArea.pressed ? Theme.surfaceTextHover : (presetToggleArea.containsMouse ? Theme.surfaceTextHover : "transparent")
|
||||
color: presetToggleArea.pressed ? Theme.surfaceTextHover : (presetToggleArea.containsMouse ? Theme.surfaceTextHover : Theme.withAlpha(Theme.surfaceTextHover, 0))
|
||||
}
|
||||
|
||||
DankIcon {
|
||||
@@ -1816,7 +1816,7 @@ Item {
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 1
|
||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
|
||||
color: Theme.outlineStrong
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
||||
@@ -14,10 +14,10 @@ Item {
|
||||
property real phase: 0.0
|
||||
property bool isPlaying: false
|
||||
property real currentAmp: 1.6
|
||||
property color trackColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.40)
|
||||
property color trackColor: Theme.withAlpha(Theme.surfaceVariant, 0.40)
|
||||
property color fillColor: Theme.primary
|
||||
property color playheadColor: Theme.primary
|
||||
property color actualProgressColor: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.45)
|
||||
property color actualProgressColor: Theme.onSurface_38
|
||||
|
||||
property real dpr: (root.window ? root.window.devicePixelRatio : 1)
|
||||
function snap(v) {
|
||||
|
||||
@@ -27,7 +27,7 @@ MouseArea {
|
||||
id: stateRect
|
||||
anchors.fill: parent
|
||||
radius: root.cornerRadius
|
||||
color: Qt.rgba(stateColor.r, stateColor.g, stateColor.b, stateOpacity)
|
||||
color: Theme.withAlpha(stateColor, stateOpacity)
|
||||
|
||||
Behavior on color {
|
||||
enabled: Theme.currentAnimationSpeed !== SettingsData.AnimationSpeed.None
|
||||
|
||||
@@ -156,7 +156,7 @@ Rectangle {
|
||||
Rectangle {
|
||||
height: 1
|
||||
width: parent.width
|
||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
color: Theme.outlineStrong
|
||||
}
|
||||
|
||||
Item {
|
||||
|
||||
@@ -161,7 +161,7 @@ Rectangle {
|
||||
width: 28
|
||||
height: 28
|
||||
radius: 14
|
||||
color: expandBtn.containsMouse ? Theme.surfacePressed : "transparent"
|
||||
color: expandBtn.containsMouse ? Theme.surfacePressed : Theme.withAlpha(Theme.surfacePressed, 0)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: canExpand
|
||||
|
||||
@@ -185,7 +185,7 @@ Rectangle {
|
||||
width: 28
|
||||
height: 28
|
||||
radius: 14
|
||||
color: deleteBtn.containsMouse ? Theme.errorHover : "transparent"
|
||||
color: deleteBtn.containsMouse ? Theme.errorHover : Theme.withAlpha(Theme.errorHover, 0)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: canDelete
|
||||
|
||||
|
||||
Reference in New Issue
Block a user