mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
Many more logo customization options
This commit is contained in:
@@ -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,47 +191,83 @@ Item {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
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
|
||||
Row {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: Theme.spacingM
|
||||
|
||||
DankIcon {
|
||||
visible: SettingsData.launcherLogoColorOverride === ""
|
||||
anchors.centerIn: parent
|
||||
name: "palette"
|
||||
size: 18
|
||||
color: "black"
|
||||
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")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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.pickerTitle = qsTr("Choose Launcher Logo Color")
|
||||
PopoutService.colorPickerModal.onColorSelectedCallback = function(selectedColor) {
|
||||
SettingsData.setLauncherLogoColorOverride(selectedColor)
|
||||
Rectangle {
|
||||
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.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 {
|
||||
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,85 +293,107 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
width: 120
|
||||
spacing: Theme.spacingS
|
||||
Item {
|
||||
width: parent.width
|
||||
height: customControlsFlow.height
|
||||
visible: {
|
||||
const override = SettingsData.launcherLogoColorOverride
|
||||
return override !== "" && override !== "primary" && override !== "surface"
|
||||
}
|
||||
opacity: visible ? 1 : 0
|
||||
|
||||
StyledText {
|
||||
text: qsTr("Brightness")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
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)
|
||||
}
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: Theme.mediumDuration
|
||||
easing.type: Theme.emphasizedEasing
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
width: 120
|
||||
Flow {
|
||||
id: customControlsFlow
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: Theme.spacingS
|
||||
|
||||
StyledText {
|
||||
text: qsTr("Contrast")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Medium
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
Column {
|
||||
width: 120
|
||||
spacing: Theme.spacingS
|
||||
|
||||
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)
|
||||
StyledText {
|
||||
text: qsTr("Brightness")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
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 {
|
||||
width: 120
|
||||
spacing: Theme.spacingS
|
||||
visible: SettingsData.launcherLogoColorOverride !== ""
|
||||
Column {
|
||||
width: 120
|
||||
spacing: Theme.spacingS
|
||||
|
||||
StyledText {
|
||||
text: qsTr("Invert on mode change")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Medium
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
StyledText {
|
||||
text: qsTr("Contrast")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Medium
|
||||
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 {
|
||||
width: 32
|
||||
height: 18
|
||||
checked: SettingsData.launcherLogoColorInvertOnMode
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
onToggled: checked => {
|
||||
SettingsData.setLauncherLogoColorInvertOnMode(checked)
|
||||
Column {
|
||||
width: 120
|
||||
spacing: Theme.spacingS
|
||||
|
||||
StyledText {
|
||||
text: qsTr("Invert on mode change")
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user