1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-28 23: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

@@ -259,11 +259,15 @@ Singleton {
property bool dankBarSquareCorners: false property bool dankBarSquareCorners: false
property bool dankBarNoBackground: false property bool dankBarNoBackground: false
property bool dankBarGothCornersEnabled: false property bool dankBarGothCornersEnabled: false
property bool dankBarGothCornerRadiusOverride: false
property real dankBarGothCornerRadiusValue: 12
property bool dankBarBorderEnabled: false property bool dankBarBorderEnabled: false
property string dankBarBorderColor: "surfaceText" property string dankBarBorderColor: "surfaceText"
property real dankBarBorderOpacity: 1.0 property real dankBarBorderOpacity: 1.0
property real dankBarBorderThickness: 1 property real dankBarBorderThickness: 1
onDankBarGothCornerRadiusOverrideChanged: saveSettings()
onDankBarGothCornerRadiusValueChanged: saveSettings()
onDankBarBorderColorChanged: saveSettings() onDankBarBorderColorChanged: saveSettings()
onDankBarBorderOpacityChanged: saveSettings() onDankBarBorderOpacityChanged: saveSettings()
onDankBarBorderThicknessChanged: saveSettings() onDankBarBorderThicknessChanged: saveSettings()

View File

@@ -176,6 +176,8 @@ var SPEC = {
dankBarSquareCorners: { def: false, migrate: ["topBarSquareCorners"] }, dankBarSquareCorners: { def: false, migrate: ["topBarSquareCorners"] },
dankBarNoBackground: { def: false, migrate: ["topBarNoBackground"] }, dankBarNoBackground: { def: false, migrate: ["topBarNoBackground"] },
dankBarGothCornersEnabled: { def: false, migrate: ["topBarGothCornersEnabled"] }, dankBarGothCornersEnabled: { def: false, migrate: ["topBarGothCornersEnabled"] },
dankBarGothCornerRadiusOverride: { def: false },
dankBarGothCornerRadiusValue: { def: 12 },
dankBarBorderEnabled: { def: false }, dankBarBorderEnabled: { def: false },
dankBarBorderColor: { def: "surfaceText" }, dankBarBorderColor: { def: "surfaceText" },
dankBarBorderOpacity: { def: 1.0 }, dankBarBorderOpacity: { def: 1.0 },

View File

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

View File

@@ -175,7 +175,7 @@ Item {
readonly property bool isVertical: axis.isVertical readonly property bool isVertical: axis.isVertical
property bool gothCornersEnabled: SettingsData.dankBarGothCornersEnabled 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 real _wingR: Math.max(0, wingtipsRadius)
readonly property color _surfaceContainer: Theme.surfaceContainer readonly property color _surfaceContainer: Theme.surfaceContainer
readonly property real _backgroundAlpha: topBarCore?.backgroundTransparency ?? SettingsData.dankBarTransparency readonly property real _backgroundAlpha: topBarCore?.backgroundTransparency ?? SettingsData.dankBarTransparency

View File

@@ -1331,15 +1331,103 @@ Item {
} }
} }
DankToggle { Column {
width: parent.width width: parent.width
text: I18n.tr("Goth Corners") spacing: Theme.spacingM
description: "Add curved swooping tips at the bottom of the bar."
checked: SettingsData.dankBarGothCornersEnabled DankToggle {
onToggled: checked => { width: parent.width
SettingsData.set("dankBarGothCornersEnabled", text: I18n.tr("Goth Corners")
checked) 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 { Column {

View File

@@ -500,25 +500,25 @@
{ {
"term": "Border", "term": "Border",
"context": "Border", "context": "Border",
"reference": "Modules/Settings/DankBarTab.qml:1351", "reference": "Modules/Settings/DankBarTab.qml:1439",
"comment": "" "comment": ""
}, },
{ {
"term": "Border Color", "term": "Border Color",
"context": "Border Color", "context": "Border Color",
"reference": "Modules/Settings/DankBarTab.qml:1381", "reference": "Modules/Settings/DankBarTab.qml:1469",
"comment": "" "comment": ""
}, },
{ {
"term": "Border Opacity", "term": "Border Opacity",
"context": "Border Opacity", "context": "Border Opacity",
"reference": "Modules/Settings/DankBarTab.qml:1433, Modules/Settings/DankBarTab.qml:1447", "reference": "Modules/Settings/DankBarTab.qml:1521, Modules/Settings/DankBarTab.qml:1535",
"comment": "" "comment": ""
}, },
{ {
"term": "Border Thickness", "term": "Border Thickness",
"context": "Border Thickness", "context": "Border Thickness",
"reference": "Modules/Settings/DankBarTab.qml:1504, Modules/Settings/DankBarTab.qml:1518", "reference": "Modules/Settings/DankBarTab.qml:1592, Modules/Settings/DankBarTab.qml:1606",
"comment": "" "comment": ""
}, },
{ {
@@ -530,7 +530,7 @@
{ {
"term": "Bottom Section", "term": "Bottom Section",
"context": "Bottom Section", "context": "Bottom Section",
"reference": "Modules/Settings/DankBarTab.qml:1964", "reference": "Modules/Settings/DankBarTab.qml:2052",
"comment": "" "comment": ""
}, },
{ {
@@ -614,7 +614,7 @@
{ {
"term": "Center Section", "term": "Center Section",
"context": "Center Section", "context": "Center Section",
"reference": "Modules/Settings/DankBarTab.qml:1881", "reference": "Modules/Settings/DankBarTab.qml:1969",
"comment": "" "comment": ""
}, },
{ {
@@ -638,7 +638,7 @@
{ {
"term": "Choose the border accent color", "term": "Choose the border accent color",
"context": "Choose the border accent color", "context": "Choose the border accent color",
"reference": "Modules/Settings/DankBarTab.qml:1388", "reference": "Modules/Settings/DankBarTab.qml:1476",
"comment": "" "comment": ""
}, },
{ {
@@ -917,6 +917,12 @@
"reference": "Modules/Settings/ThemeColorsTab.qml:910", "reference": "Modules/Settings/ThemeColorsTab.qml:910",
"comment": "" "comment": ""
}, },
{
"term": "Corner Radius Override",
"context": "Corner Radius Override",
"reference": "Modules/Settings/DankBarTab.qml:1351",
"comment": ""
},
{ {
"term": "Cover Open", "term": "Cover Open",
"context": "Cover Open", "context": "Cover Open",
@@ -1052,7 +1058,7 @@
{ {
"term": "DankBar Font Scale", "term": "DankBar Font Scale",
"context": "DankBar Font Scale", "context": "DankBar Font Scale",
"reference": "Modules/Settings/DankBarTab.qml:1590", "reference": "Modules/Settings/DankBarTab.qml:1678",
"comment": "" "comment": ""
}, },
{ {
@@ -1262,7 +1268,7 @@
{ {
"term": "Drag widgets to reorder within sections. Use the eye icon to hide/show widgets (maintains spacing), or X to remove them completely.", "term": "Drag widgets to reorder within sections. Use the eye icon to hide/show widgets (maintains spacing), or X to remove them completely.",
"context": "Drag widgets to reorder within sections. Use the eye icon to hide/show widgets (maintains spacing), or X to remove them completely.", "context": "Drag widgets to reorder within sections. Use the eye icon to hide/show widgets (maintains spacing), or X to remove them completely.",
"reference": "Modules/Settings/DankBarTab.qml:1772", "reference": "Modules/Settings/DankBarTab.qml:1860",
"comment": "" "comment": ""
}, },
{ {
@@ -1679,10 +1685,16 @@
"reference": "Modules/DankDash/WeatherTab.qml:502, Modules/Settings/TimeWeatherTab.qml:1329", "reference": "Modules/DankDash/WeatherTab.qml:502, Modules/Settings/TimeWeatherTab.qml:1329",
"comment": "" "comment": ""
}, },
{
"term": "Goth Corner Radius",
"context": "Goth Corner Radius",
"reference": "Modules/Settings/DankBarTab.qml:1370, Modules/Settings/DankBarTab.qml:1384",
"comment": ""
},
{ {
"term": "Goth Corners", "term": "Goth Corners",
"context": "Goth Corners", "context": "Goth Corners",
"reference": "Modules/Settings/DankBarTab.qml:1336", "reference": "Modules/Settings/DankBarTab.qml:1340",
"comment": "" "comment": ""
}, },
{ {
@@ -1970,7 +1982,7 @@
{ {
"term": "Left Section", "term": "Left Section",
"context": "Left Section", "context": "Left Section",
"reference": "Modules/Settings/DankBarTab.qml:1798", "reference": "Modules/Settings/DankBarTab.qml:1886",
"comment": "" "comment": ""
}, },
{ {
@@ -2948,7 +2960,7 @@
{ {
"term": "Reset", "term": "Reset",
"context": "Reset", "context": "Reset",
"reference": "Modules/Settings/DankBarTab.qml:1730, Modules/ControlCenter/Components/EditControls.qml:227", "reference": "Modules/Settings/DankBarTab.qml:1818, Modules/ControlCenter/Components/EditControls.qml:227",
"comment": "" "comment": ""
}, },
{ {
@@ -2972,7 +2984,7 @@
{ {
"term": "Right Section", "term": "Right Section",
"context": "Right Section", "context": "Right Section",
"reference": "Modules/Settings/DankBarTab.qml:1964", "reference": "Modules/Settings/DankBarTab.qml:2052",
"comment": "" "comment": ""
}, },
{ {
@@ -3020,7 +3032,7 @@
{ {
"term": "Scale DankBar font sizes independently", "term": "Scale DankBar font sizes independently",
"context": "Scale DankBar font sizes independently", "context": "Scale DankBar font sizes independently",
"reference": "Modules/Settings/DankBarTab.qml:1597", "reference": "Modules/Settings/DankBarTab.qml:1685",
"comment": "" "comment": ""
}, },
{ {
@@ -3698,7 +3710,7 @@
{ {
"term": "Top Section", "term": "Top Section",
"context": "Top Section", "context": "Top Section",
"reference": "Modules/Settings/DankBarTab.qml:1798", "reference": "Modules/Settings/DankBarTab.qml:1886",
"comment": "" "comment": ""
}, },
{ {
@@ -3992,7 +4004,7 @@
{ {
"term": "Widget Management", "term": "Widget Management",
"context": "Widget Management", "context": "Widget Management",
"reference": "Modules/Settings/DankBarTab.qml:1692", "reference": "Modules/Settings/DankBarTab.qml:1780",
"comment": "" "comment": ""
}, },
{ {

View File

@@ -467,6 +467,9 @@
"Corner Radius (0 = square corners)": { "Corner Radius (0 = square corners)": {
"Corner Radius (0 = square corners)": "Raggio Angoli (0 = angoli squadrati)" "Corner Radius (0 = square corners)": "Raggio Angoli (0 = angoli squadrati)"
}, },
"Corner Radius Override": {
"Corner Radius Override": ""
},
"Cover Open": { "Cover Open": {
"Cover Open": "" "Cover Open": ""
}, },
@@ -857,6 +860,9 @@
"Good": { "Good": {
"Good": "Buona" "Good": "Buona"
}, },
"Goth Corner Radius": {
"Goth Corner Radius": ""
},
"Goth Corners": { "Goth Corners": {
"Goth Corners": "Angoli Gotici" "Goth Corners": "Angoli Gotici"
}, },

View File

@@ -467,6 +467,9 @@
"Corner Radius (0 = square corners)": { "Corner Radius (0 = square corners)": {
"Corner Radius (0 = square corners)": "コーナー半径0 = 角丸なし)" "Corner Radius (0 = square corners)": "コーナー半径0 = 角丸なし)"
}, },
"Corner Radius Override": {
"Corner Radius Override": ""
},
"Cover Open": { "Cover Open": {
"Cover Open": "カバーオープン" "Cover Open": "カバーオープン"
}, },
@@ -857,6 +860,9 @@
"Good": { "Good": {
"Good": "良い" "Good": "良い"
}, },
"Goth Corner Radius": {
"Goth Corner Radius": ""
},
"Goth Corners": { "Goth Corners": {
"Goth Corners": "ゴスコーナーズ" "Goth Corners": "ゴスコーナーズ"
}, },

View File

@@ -467,6 +467,9 @@
"Corner Radius (0 = square corners)": { "Corner Radius (0 = square corners)": {
"Corner Radius (0 = square corners)": "Ângulo da quina (0 = quina quadrilátera)" "Corner Radius (0 = square corners)": "Ângulo da quina (0 = quina quadrilátera)"
}, },
"Corner Radius Override": {
"Corner Radius Override": ""
},
"Cover Open": { "Cover Open": {
"Cover Open": "" "Cover Open": ""
}, },
@@ -857,6 +860,9 @@
"Good": { "Good": {
"Good": "Bom" "Good": "Bom"
}, },
"Goth Corner Radius": {
"Goth Corner Radius": ""
},
"Goth Corners": { "Goth Corners": {
"Goth Corners": "Cantos Gotícos" "Goth Corners": "Cantos Gotícos"
}, },

View File

@@ -102,7 +102,7 @@
"Apply warm color temperature to reduce eye strain. Use automation settings below to control when it activates.": "Göz yorgunluğunu azaltmak için sıcak renk sıcaklığı uygulayın. Etkinleştirme zamanını kontrol etmek için aşağıdaki otomasyon ayarlarını kullanın." "Apply warm color temperature to reduce eye strain. Use automation settings below to control when it activates.": "Göz yorgunluğunu azaltmak için sıcak renk sıcaklığı uygulayın. Etkinleştirme zamanını kontrol etmek için aşağıdaki otomasyon ayarlarını kullanın."
}, },
"Apps Icon": { "Apps Icon": {
"Apps Icon": "Uygulamalar Simgesi" "Apps Icon": "Uygulamalar İkonu"
}, },
"Apps are ordered by usage frequency, then last used, then alphabetically.": { "Apps are ordered by usage frequency, then last used, then alphabetically.": {
"Apps are ordered by usage frequency, then last used, then alphabetically.": "Uygulamalar önce kullanım sıklığına göre, daha sonra son kullanılana göre ve en son alfabetik olarak sıralanır." "Apps are ordered by usage frequency, then last used, then alphabetically.": "Uygulamalar önce kullanım sıklığına göre, daha sonra son kullanılana göre ve en son alfabetik olarak sıralanır."
@@ -467,6 +467,9 @@
"Corner Radius (0 = square corners)": { "Corner Radius (0 = square corners)": {
"Corner Radius (0 = square corners)": "Köşe Yarıçapı (0 = kare köşeler)" "Corner Radius (0 = square corners)": "Köşe Yarıçapı (0 = kare köşeler)"
}, },
"Corner Radius Override": {
"Corner Radius Override": ""
},
"Cover Open": { "Cover Open": {
"Cover Open": "Kapak Açık" "Cover Open": "Kapak Açık"
}, },
@@ -857,6 +860,9 @@
"Good": { "Good": {
"Good": "İyi" "Good": "İyi"
}, },
"Goth Corner Radius": {
"Goth Corner Radius": ""
},
"Goth Corners": { "Goth Corners": {
"Goth Corners": "Gotik Köşeler" "Goth Corners": "Gotik Köşeler"
}, },
@@ -1275,7 +1281,7 @@
"Numbers": "Numaralar" "Numbers": "Numaralar"
}, },
"OS Logo": { "OS Logo": {
"OS Logo": "OS Logosu" "OS Logo": "OS Logo"
}, },
"Office": { "Office": {
"Office": "Ofis" "Office": "Ofis"

View File

@@ -467,6 +467,9 @@
"Corner Radius (0 = square corners)": { "Corner Radius (0 = square corners)": {
"Corner Radius (0 = square corners)": "圆角半径0 = 直角)" "Corner Radius (0 = square corners)": "圆角半径0 = 直角)"
}, },
"Corner Radius Override": {
"Corner Radius Override": ""
},
"Cover Open": { "Cover Open": {
"Cover Open": "打印机盖已打开" "Cover Open": "打印机盖已打开"
}, },
@@ -857,6 +860,9 @@
"Good": { "Good": {
"Good": "良好" "Good": "良好"
}, },
"Goth Corner Radius": {
"Goth Corner Radius": ""
},
"Goth Corners": { "Goth Corners": {
"Goth Corners": "哥特风格圆角" "Goth Corners": "哥特风格圆角"
}, },

View File

@@ -467,6 +467,9 @@
"Corner Radius (0 = square corners)": { "Corner Radius (0 = square corners)": {
"Corner Radius (0 = square corners)": "圓角半徑 (0 = 方角)" "Corner Radius (0 = square corners)": "圓角半徑 (0 = 方角)"
}, },
"Corner Radius Override": {
"Corner Radius Override": ""
},
"Cover Open": { "Cover Open": {
"Cover Open": "" "Cover Open": ""
}, },
@@ -857,6 +860,9 @@
"Good": { "Good": {
"Good": "好" "Good": "好"
}, },
"Goth Corner Radius": {
"Goth Corner Radius": ""
},
"Goth Corners": { "Goth Corners": {
"Goth Corners": "圓角介面融合" "Goth Corners": "圓角介面融合"
}, },

View File

@@ -1070,6 +1070,13 @@
"reference": "", "reference": "",
"comment": "" "comment": ""
}, },
{
"term": "Corner Radius Override",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{ {
"term": "Cover Open", "term": "Cover Open",
"translation": "", "translation": "",
@@ -1959,6 +1966,13 @@
"reference": "", "reference": "",
"comment": "" "comment": ""
}, },
{
"term": "Goth Corner Radius",
"translation": "",
"context": "",
"reference": "",
"comment": ""
},
{ {
"term": "Goth Corners", "term": "Goth Corners",
"translation": "", "translation": "",