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 ""
const colorOverride = SettingsData.launcherLogoColorOverride
if (!colorOverride || colorOverride === "") return ""
if (colorOverride === "primary") return Theme.primary
if (colorOverride === "surface") return Theme.surfaceText
return colorOverride
}
@@ -726,15 +728,19 @@ Singleton {
const colorOverride = SettingsData.launcherLogoColorOverride
if (!colorOverride || colorOverride === "") return ""
let baseColor = colorOverride
if (colorOverride === "primary") baseColor = Theme.primary
if (colorOverride === "surface") baseColor = Theme.surfaceText
if (!SettingsData.launcherLogoColorInvertOnMode) {
return colorOverride
return baseColor
}
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
spacing: Theme.spacingL
visible: SettingsData.launcherLogoMode !== "apps"
@@ -180,8 +180,8 @@ Item {
}
Column {
width: 120
spacing: Theme.spacingS
width: parent.width
spacing: Theme.spacingM
StyledText {
text: qsTr("Color Override")
@@ -191,29 +191,63 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingM
DankButtonGroup {
id: colorModeGroup
model: [qsTr("Default"), qsTr("Primary"), qsTr("Surface"), qsTr("Custom")]
currentIndex: {
const override = SettingsData.launcherLogoColorOverride
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")
}
}
}
}
Rectangle {
width: 32
height: 32
radius: 16
color: SettingsData.launcherLogoColorOverride !== "" ? SettingsData.launcherLogoColorOverride : Qt.rgba(255, 255, 255, 0.9)
visible: {
const override = SettingsData.launcherLogoColorOverride
return override !== "" && override !== "primary" && override !== "surface"
}
width: 36
height: 36
radius: 18
color: {
const override = SettingsData.launcherLogoColorOverride
if (override !== "" && override !== "primary" && override !== "surface") {
return override
}
return "#ffffff"
}
border.color: Theme.outline
border.width: 1
anchors.horizontalCenter: parent.horizontalCenter
DankIcon {
visible: SettingsData.launcherLogoColorOverride === ""
anchors.centerIn: parent
name: "palette"
size: 18
color: "black"
}
anchors.verticalCenter: parent.verticalCenter
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
if (PopoutService.colorPickerModal) {
PopoutService.colorPickerModal.selectedColor = SettingsData.launcherLogoColorOverride !== "" ? SettingsData.launcherLogoColorOverride : Qt.rgba(0, 0, 0, 0)
PopoutService.colorPickerModal.selectedColor = SettingsData.launcherLogoColorOverride
PopoutService.colorPickerModal.pickerTitle = qsTr("Choose Launcher Logo Color")
PopoutService.colorPickerModal.onColorSelectedCallback = function(selectedColor) {
SettingsData.setLauncherLogoColorOverride(selectedColor)
@@ -224,14 +258,16 @@ Item {
}
}
}
}
Flow {
width: parent.width - 120 - Theme.spacingL
Column {
width: parent.width
spacing: Theme.spacingS
Column {
width: 120
spacing: Theme.spacingS
anchors.horizontalCenter: parent.horizontalCenter
StyledText {
text: qsTr("Size Offset")
@@ -257,6 +293,28 @@ Item {
}
}
}
}
Item {
width: parent.width
height: customControlsFlow.height
visible: {
const override = SettingsData.launcherLogoColorOverride
return override !== "" && override !== "primary" && override !== "surface"
}
opacity: visible ? 1 : 0
Behavior on opacity {
NumberAnimation {
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
}
Flow {
id: customControlsFlow
anchors.horizontalCenter: parent.horizontalCenter
spacing: Theme.spacingS
Column {
width: 120
@@ -319,7 +377,6 @@ Item {
Column {
width: 120
spacing: Theme.spacingS
visible: SettingsData.launcherLogoColorOverride !== ""
StyledText {
text: qsTr("Invert on mode change")
@@ -343,6 +400,7 @@ Item {
}
}
}
}
StyledRect {
width: parent.width

View File

@@ -32,13 +32,9 @@ Singleton {
Component.onCompleted: {
if (socketPath && socketPath.length > 0) {
checkSocket()
}
}
function checkSocket() {
testProcess.running = true
}
}
Process {
id: testProcess

View File

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