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

dankbar: allow overriding goth radius

fixes #648
This commit is contained in:
bbedward
2025-11-06 17:20:18 -05:00
parent 65c2077e30
commit 15983921b0
13 changed files with 197 additions and 27 deletions

View File

@@ -72,6 +72,12 @@ Item {
function onSurfaceContainerChanged() { root.requestRepaint() }
}
Connections {
target: SettingsData
function onDankBarGothCornerRadiusOverrideChanged() { root.requestRepaint() }
function onDankBarGothCornerRadiusValueChanged() { root.requestRepaint() }
}
onPaint: {
const ctx = getContext("2d")
const W = barWindow.isVertical ? correctHeight : correctWidth
@@ -171,6 +177,12 @@ Item {
function onSurfaceChanged() { root.requestRepaint() }
}
Connections {
target: SettingsData
function onDankBarGothCornerRadiusOverrideChanged() { root.requestRepaint() }
function onDankBarGothCornerRadiusValueChanged() { root.requestRepaint() }
}
onPaint: {
const ctx = getContext("2d")
const W = barWindow.isVertical ? correctHeight : correctWidth
@@ -278,6 +290,8 @@ Item {
function onDankBarSpacingChanged() { root.requestRepaint() }
function onDankBarSquareCornersChanged() { root.requestRepaint() }
function onDankBarTransparencyChanged() { root.requestRepaint() }
function onDankBarGothCornerRadiusOverrideChanged() { root.requestRepaint() }
function onDankBarGothCornerRadiusValueChanged() { root.requestRepaint() }
}
onPaint: {

View File

@@ -175,7 +175,7 @@ Item {
readonly property bool isVertical: axis.isVertical
property bool gothCornersEnabled: SettingsData.dankBarGothCornersEnabled
property real wingtipsRadius: Theme.cornerRadius
property real wingtipsRadius: SettingsData.dankBarGothCornerRadiusOverride ? SettingsData.dankBarGothCornerRadiusValue : Theme.cornerRadius
readonly property real _wingR: Math.max(0, wingtipsRadius)
readonly property color _surfaceContainer: Theme.surfaceContainer
readonly property real _backgroundAlpha: topBarCore?.backgroundTransparency ?? SettingsData.dankBarTransparency

View File

@@ -1331,15 +1331,103 @@ Item {
}
}
DankToggle {
Column {
width: parent.width
text: I18n.tr("Goth Corners")
description: "Add curved swooping tips at the bottom of the bar."
checked: SettingsData.dankBarGothCornersEnabled
onToggled: checked => {
SettingsData.set("dankBarGothCornersEnabled",
checked)
}
spacing: Theme.spacingM
DankToggle {
width: parent.width
text: I18n.tr("Goth Corners")
description: "Add curved swooping tips at the bottom of the bar."
checked: SettingsData.dankBarGothCornersEnabled
onToggled: checked => {
SettingsData.set("dankBarGothCornersEnabled",
checked)
}
}
DankToggle {
width: parent.width
text: I18n.tr("Corner Radius Override")
description: "Customize the goth corner radius independently."
checked: SettingsData.dankBarGothCornerRadiusOverride
visible: SettingsData.dankBarGothCornersEnabled
onToggled: checked => {
SettingsData.set("dankBarGothCornerRadiusOverride", checked)
}
}
Column {
width: parent.width
spacing: Theme.spacingS
visible: SettingsData.dankBarGothCornersEnabled && SettingsData.dankBarGothCornerRadiusOverride
Row {
width: parent.width
spacing: Theme.spacingS
StyledText {
text: I18n.tr("Goth Corner Radius")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
font.weight: Font.Medium
anchors.verticalCenter: parent.verticalCenter
}
Item {
width: parent.width - gothCornerRadiusText.implicitWidth - resetGothCornerRadiusBtn.width - Theme.spacingS - Theme.spacingM
height: 1
StyledText {
id: gothCornerRadiusText
visible: false
text: I18n.tr("Goth Corner Radius")
font.pixelSize: Theme.fontSizeSmall
}
}
DankActionButton {
id: resetGothCornerRadiusBtn
buttonSize: 20
iconName: "refresh"
iconSize: 12
backgroundColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
iconColor: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
onClicked: {
SettingsData.set("dankBarGothCornerRadiusValue", 12)
}
}
Item {
width: Theme.spacingS
height: 1
}
}
DankSlider {
id: gothCornerRadiusSlider
width: parent.width
height: 24
value: SettingsData.dankBarGothCornerRadiusValue
minimum: 0
maximum: 64
unit: ""
showValue: true
wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
onSliderValueChanged: newValue => {
SettingsData.set("dankBarGothCornerRadiusValue", newValue)
}
Binding {
target: gothCornerRadiusSlider
property: "value"
value: SettingsData.dankBarGothCornerRadiusValue
restoreMode: Binding.RestoreBinding
}
}
}
}
Column {