1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

Many more logo customization options

This commit is contained in:
bbedward
2025-10-08 14:51:38 -04:00
parent e327b1ca5b
commit ebd48e2556
4 changed files with 162 additions and 102 deletions

View File

@@ -717,6 +717,8 @@ Singleton {
if (typeof SettingsData === "undefined") return "" if (typeof SettingsData === "undefined") return ""
const colorOverride = SettingsData.launcherLogoColorOverride const colorOverride = SettingsData.launcherLogoColorOverride
if (!colorOverride || colorOverride === "") return "" if (!colorOverride || colorOverride === "") return ""
if (colorOverride === "primary") return Theme.primary
if (colorOverride === "surface") return Theme.surfaceText
return colorOverride return colorOverride
} }
@@ -726,15 +728,19 @@ Singleton {
const colorOverride = SettingsData.launcherLogoColorOverride const colorOverride = SettingsData.launcherLogoColorOverride
if (!colorOverride || colorOverride === "") return "" if (!colorOverride || colorOverride === "") return ""
let baseColor = colorOverride
if (colorOverride === "primary") baseColor = Theme.primary
if (colorOverride === "surface") baseColor = Theme.surfaceText
if (!SettingsData.launcherLogoColorInvertOnMode) { if (!SettingsData.launcherLogoColorInvertOnMode) {
return colorOverride return baseColor
} }
if (typeof SessionData !== "undefined" && SessionData.isLightMode) { if (typeof SessionData !== "undefined" && SessionData.isLightMode) {
return invertHex(baseLogoColor) return invertHex(baseColor)
} }
return baseLogoColor return baseColor
} }

View File

@@ -166,7 +166,7 @@ Item {
} }
} }
Row { Column {
width: parent.width width: parent.width
spacing: Theme.spacingL spacing: Theme.spacingL
visible: SettingsData.launcherLogoMode !== "apps" visible: SettingsData.launcherLogoMode !== "apps"
@@ -180,8 +180,8 @@ Item {
} }
Column { Column {
width: 120 width: parent.width
spacing: Theme.spacingS spacing: Theme.spacingM
StyledText { StyledText {
text: qsTr("Color Override") text: qsTr("Color Override")
@@ -191,47 +191,83 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
Rectangle { Row {
width: 32
height: 32
radius: 16
color: SettingsData.launcherLogoColorOverride !== "" ? SettingsData.launcherLogoColorOverride : Qt.rgba(255, 255, 255, 0.9)
border.color: Theme.outline
border.width: 1
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingM
DankIcon { DankButtonGroup {
visible: SettingsData.launcherLogoColorOverride === "" id: colorModeGroup
anchors.centerIn: parent model: [qsTr("Default"), qsTr("Primary"), qsTr("Surface"), qsTr("Custom")]
name: "palette" currentIndex: {
size: 18 const override = SettingsData.launcherLogoColorOverride
color: "black" if (override === "") return 0
if (override === "primary") return 1
if (override === "surface") return 2
return 3
}
onSelectionChanged: (index, selected) => {
if (!selected) return
if (index === 0) {
SettingsData.setLauncherLogoColorOverride("")
} else if (index === 1) {
SettingsData.setLauncherLogoColorOverride("primary")
} else if (index === 2) {
SettingsData.setLauncherLogoColorOverride("surface")
} else if (index === 3) {
const currentOverride = SettingsData.launcherLogoColorOverride
const isPreset = currentOverride === "" || currentOverride === "primary" || currentOverride === "surface"
if (isPreset) {
SettingsData.setLauncherLogoColorOverride("#ffffff")
}
}
}
} }
MouseArea { Rectangle {
anchors.fill: parent visible: {
cursorShape: Qt.PointingHandCursor const override = SettingsData.launcherLogoColorOverride
onClicked: { return override !== "" && override !== "primary" && override !== "surface"
if (PopoutService.colorPickerModal) { }
PopoutService.colorPickerModal.selectedColor = SettingsData.launcherLogoColorOverride !== "" ? SettingsData.launcherLogoColorOverride : Qt.rgba(0, 0, 0, 0) width: 36
PopoutService.colorPickerModal.pickerTitle = qsTr("Choose Launcher Logo Color") height: 36
PopoutService.colorPickerModal.onColorSelectedCallback = function(selectedColor) { radius: 18
SettingsData.setLauncherLogoColorOverride(selectedColor) color: {
const override = SettingsData.launcherLogoColorOverride
if (override !== "" && override !== "primary" && override !== "surface") {
return override
}
return "#ffffff"
}
border.color: Theme.outline
border.width: 1
anchors.verticalCenter: parent.verticalCenter
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
if (PopoutService.colorPickerModal) {
PopoutService.colorPickerModal.selectedColor = SettingsData.launcherLogoColorOverride
PopoutService.colorPickerModal.pickerTitle = qsTr("Choose Launcher Logo Color")
PopoutService.colorPickerModal.onColorSelectedCallback = function(selectedColor) {
SettingsData.setLauncherLogoColorOverride(selectedColor)
}
PopoutService.colorPickerModal.show()
} }
PopoutService.colorPickerModal.show()
} }
} }
} }
} }
} }
Flow { Column {
width: parent.width - 120 - Theme.spacingL width: parent.width
spacing: Theme.spacingS spacing: Theme.spacingS
Column { Column {
width: 120 width: 120
spacing: Theme.spacingS spacing: Theme.spacingS
anchors.horizontalCenter: parent.horizontalCenter
StyledText { StyledText {
text: qsTr("Size Offset") text: qsTr("Size Offset")
@@ -257,85 +293,107 @@ Item {
} }
} }
} }
}
Column { Item {
width: 120 width: parent.width
spacing: Theme.spacingS height: customControlsFlow.height
visible: {
const override = SettingsData.launcherLogoColorOverride
return override !== "" && override !== "primary" && override !== "surface"
}
opacity: visible ? 1 : 0
StyledText { Behavior on opacity {
text: qsTr("Brightness") NumberAnimation {
font.pixelSize: Theme.fontSizeSmall duration: Theme.mediumDuration
color: Theme.surfaceText easing.type: Theme.emphasizedEasing
font.weight: Font.Medium
anchors.horizontalCenter: parent.horizontalCenter
}
DankSlider {
width: 100
height: 20
minimum: 0
maximum: 100
value: Math.round(SettingsData.launcherLogoBrightness * 100)
unit: "%"
showValue: true
wheelEnabled: false
thumbOutlineColor: Theme.surfaceContainerHigh
anchors.horizontalCenter: parent.horizontalCenter
onSliderValueChanged: newValue => {
SettingsData.setLauncherLogoBrightness(newValue / 100)
}
} }
} }
Column { Flow {
width: 120 id: customControlsFlow
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingS spacing: Theme.spacingS
StyledText { Column {
text: qsTr("Contrast") width: 120
font.pixelSize: Theme.fontSizeSmall spacing: Theme.spacingS
color: Theme.surfaceText
font.weight: Font.Medium
anchors.horizontalCenter: parent.horizontalCenter
}
DankSlider { StyledText {
width: 100 text: qsTr("Brightness")
height: 20 font.pixelSize: Theme.fontSizeSmall
minimum: 0 color: Theme.surfaceText
maximum: 200 font.weight: Font.Medium
value: Math.round(SettingsData.launcherLogoContrast * 100) anchors.horizontalCenter: parent.horizontalCenter
unit: "%" }
showValue: true
wheelEnabled: false DankSlider {
thumbOutlineColor: Theme.surfaceContainerHigh width: 100
anchors.horizontalCenter: parent.horizontalCenter height: 20
onSliderValueChanged: newValue => { minimum: 0
SettingsData.setLauncherLogoContrast(newValue / 100) maximum: 100
value: Math.round(SettingsData.launcherLogoBrightness * 100)
unit: "%"
showValue: true
wheelEnabled: false
thumbOutlineColor: Theme.surfaceContainerHigh
anchors.horizontalCenter: parent.horizontalCenter
onSliderValueChanged: newValue => {
SettingsData.setLauncherLogoBrightness(newValue / 100)
}
} }
} }
}
Column { Column {
width: 120 width: 120
spacing: Theme.spacingS spacing: Theme.spacingS
visible: SettingsData.launcherLogoColorOverride !== ""
StyledText { StyledText {
text: qsTr("Invert on mode change") text: qsTr("Contrast")
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText color: Theme.surfaceText
font.weight: Font.Medium font.weight: Font.Medium
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
}
DankSlider {
width: 100
height: 20
minimum: 0
maximum: 200
value: Math.round(SettingsData.launcherLogoContrast * 100)
unit: "%"
showValue: true
wheelEnabled: false
thumbOutlineColor: Theme.surfaceContainerHigh
anchors.horizontalCenter: parent.horizontalCenter
onSliderValueChanged: newValue => {
SettingsData.setLauncherLogoContrast(newValue / 100)
}
}
} }
DankToggle { Column {
width: 32 width: 120
height: 18 spacing: Theme.spacingS
checked: SettingsData.launcherLogoColorInvertOnMode
anchors.horizontalCenter: parent.horizontalCenter StyledText {
onToggled: checked => { text: qsTr("Invert on mode change")
SettingsData.setLauncherLogoColorInvertOnMode(checked) font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
font.weight: Font.Medium
anchors.horizontalCenter: parent.horizontalCenter
}
DankToggle {
width: 32
height: 18
checked: SettingsData.launcherLogoColorInvertOnMode
anchors.horizontalCenter: parent.horizontalCenter
onToggled: checked => {
SettingsData.setLauncherLogoColorInvertOnMode(checked)
}
} }
} }
} }

View File

@@ -32,14 +32,10 @@ Singleton {
Component.onCompleted: { Component.onCompleted: {
if (socketPath && socketPath.length > 0) { if (socketPath && socketPath.length > 0) {
checkSocket() testProcess.running = true
} }
} }
function checkSocket() {
testProcess.running = true
}
Process { Process {
id: testProcess id: testProcess
command: ["test", "-S", root.socketPath] command: ["test", "-S", root.socketPath]

View File

@@ -688,7 +688,7 @@ Singleton {
} }
} }
function connectToWifi(ssid, password = "") { function connectToWifi(ssid, password = "", username = "") {
if (root.isConnecting) { if (root.isConnecting) {
return return
} }