mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-03 20:32:07 -04:00
Many more logo customization options
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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,29 +191,63 @@ Item {
|
|||||||
anchors.horizontalCenter: parent.horizontalCenter
|
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 {
|
Rectangle {
|
||||||
width: 32
|
visible: {
|
||||||
height: 32
|
const override = SettingsData.launcherLogoColorOverride
|
||||||
radius: 16
|
return override !== "" && override !== "primary" && override !== "surface"
|
||||||
color: SettingsData.launcherLogoColorOverride !== "" ? SettingsData.launcherLogoColorOverride : Qt.rgba(255, 255, 255, 0.9)
|
}
|
||||||
|
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.color: Theme.outline
|
||||||
border.width: 1
|
border.width: 1
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
visible: SettingsData.launcherLogoColorOverride === ""
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "palette"
|
|
||||||
size: 18
|
|
||||||
color: "black"
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (PopoutService.colorPickerModal) {
|
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.pickerTitle = qsTr("Choose Launcher Logo Color")
|
||||||
PopoutService.colorPickerModal.onColorSelectedCallback = function(selectedColor) {
|
PopoutService.colorPickerModal.onColorSelectedCallback = function(selectedColor) {
|
||||||
SettingsData.setLauncherLogoColorOverride(selectedColor)
|
SettingsData.setLauncherLogoColorOverride(selectedColor)
|
||||||
@@ -224,14 +258,16 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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,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 {
|
Column {
|
||||||
width: 120
|
width: 120
|
||||||
@@ -319,7 +377,6 @@ Item {
|
|||||||
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("Invert on mode change")
|
||||||
@@ -343,6 +400,7 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StyledRect {
|
StyledRect {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|||||||
@@ -32,13 +32,9 @@ Singleton {
|
|||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if (socketPath && socketPath.length > 0) {
|
if (socketPath && socketPath.length > 0) {
|
||||||
checkSocket()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkSocket() {
|
|
||||||
testProcess.running = true
|
testProcess.running = true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: testProcess
|
id: testProcess
|
||||||
|
|||||||
@@ -688,7 +688,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function connectToWifi(ssid, password = "") {
|
function connectToWifi(ssid, password = "", username = "") {
|
||||||
if (root.isConnecting) {
|
if (root.isConnecting) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user