1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -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 dankBarNoBackground: false
property bool dankBarGothCornersEnabled: false
property bool dankBarGothCornerRadiusOverride: false
property real dankBarGothCornerRadiusValue: 12
property bool dankBarBorderEnabled: false
property string dankBarBorderColor: "surfaceText"
property real dankBarBorderOpacity: 1.0
property real dankBarBorderThickness: 1
onDankBarGothCornerRadiusOverrideChanged: saveSettings()
onDankBarGothCornerRadiusValueChanged: saveSettings()
onDankBarBorderColorChanged: saveSettings()
onDankBarBorderOpacityChanged: saveSettings()
onDankBarBorderThicknessChanged: saveSettings()

View File

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

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 {

View File

@@ -500,25 +500,25 @@
{
"term": "Border",
"context": "Border",
"reference": "Modules/Settings/DankBarTab.qml:1351",
"reference": "Modules/Settings/DankBarTab.qml:1439",
"comment": ""
},
{
"term": "Border Color",
"context": "Border Color",
"reference": "Modules/Settings/DankBarTab.qml:1381",
"reference": "Modules/Settings/DankBarTab.qml:1469",
"comment": ""
},
{
"term": "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": ""
},
{
"term": "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": ""
},
{
@@ -530,7 +530,7 @@
{
"term": "Bottom Section",
"context": "Bottom Section",
"reference": "Modules/Settings/DankBarTab.qml:1964",
"reference": "Modules/Settings/DankBarTab.qml:2052",
"comment": ""
},
{
@@ -614,7 +614,7 @@
{
"term": "Center Section",
"context": "Center Section",
"reference": "Modules/Settings/DankBarTab.qml:1881",
"reference": "Modules/Settings/DankBarTab.qml:1969",
"comment": ""
},
{
@@ -638,7 +638,7 @@
{
"term": "Choose the border accent color",
"context": "Choose the border accent color",
"reference": "Modules/Settings/DankBarTab.qml:1388",
"reference": "Modules/Settings/DankBarTab.qml:1476",
"comment": ""
},
{
@@ -917,6 +917,12 @@
"reference": "Modules/Settings/ThemeColorsTab.qml:910",
"comment": ""
},
{
"term": "Corner Radius Override",
"context": "Corner Radius Override",
"reference": "Modules/Settings/DankBarTab.qml:1351",
"comment": ""
},
{
"term": "Cover Open",
"context": "Cover Open",
@@ -1052,7 +1058,7 @@
{
"term": "DankBar Font Scale",
"context": "DankBar Font Scale",
"reference": "Modules/Settings/DankBarTab.qml:1590",
"reference": "Modules/Settings/DankBarTab.qml:1678",
"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.",
"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": ""
},
{
@@ -1679,10 +1685,16 @@
"reference": "Modules/DankDash/WeatherTab.qml:502, Modules/Settings/TimeWeatherTab.qml:1329",
"comment": ""
},
{
"term": "Goth Corner Radius",
"context": "Goth Corner Radius",
"reference": "Modules/Settings/DankBarTab.qml:1370, Modules/Settings/DankBarTab.qml:1384",
"comment": ""
},
{
"term": "Goth Corners",
"context": "Goth Corners",
"reference": "Modules/Settings/DankBarTab.qml:1336",
"reference": "Modules/Settings/DankBarTab.qml:1340",
"comment": ""
},
{
@@ -1970,7 +1982,7 @@
{
"term": "Left Section",
"context": "Left Section",
"reference": "Modules/Settings/DankBarTab.qml:1798",
"reference": "Modules/Settings/DankBarTab.qml:1886",
"comment": ""
},
{
@@ -2948,7 +2960,7 @@
{
"term": "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": ""
},
{
@@ -2972,7 +2984,7 @@
{
"term": "Right Section",
"context": "Right Section",
"reference": "Modules/Settings/DankBarTab.qml:1964",
"reference": "Modules/Settings/DankBarTab.qml:2052",
"comment": ""
},
{
@@ -3020,7 +3032,7 @@
{
"term": "Scale DankBar font sizes independently",
"context": "Scale DankBar font sizes independently",
"reference": "Modules/Settings/DankBarTab.qml:1597",
"reference": "Modules/Settings/DankBarTab.qml:1685",
"comment": ""
},
{
@@ -3698,7 +3710,7 @@
{
"term": "Top Section",
"context": "Top Section",
"reference": "Modules/Settings/DankBarTab.qml:1798",
"reference": "Modules/Settings/DankBarTab.qml:1886",
"comment": ""
},
{
@@ -3992,7 +4004,7 @@
{
"term": "Widget Management",
"context": "Widget Management",
"reference": "Modules/Settings/DankBarTab.qml:1692",
"reference": "Modules/Settings/DankBarTab.qml:1780",
"comment": ""
},
{

View File

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

View File

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

View File

@@ -467,6 +467,9 @@
"Corner Radius (0 = square corners)": {
"Corner Radius (0 = square corners)": "Ângulo da quina (0 = quina quadrilátera)"
},
"Corner Radius Override": {
"Corner Radius Override": ""
},
"Cover Open": {
"Cover Open": ""
},
@@ -857,6 +860,9 @@
"Good": {
"Good": "Bom"
},
"Goth Corner Radius": {
"Goth Corner Radius": ""
},
"Goth Corners": {
"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."
},
"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.": "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)": "Köşe Yarıçapı (0 = kare köşeler)"
},
"Corner Radius Override": {
"Corner Radius Override": ""
},
"Cover Open": {
"Cover Open": "Kapak Açık"
},
@@ -857,6 +860,9 @@
"Good": {
"Good": "İyi"
},
"Goth Corner Radius": {
"Goth Corner Radius": ""
},
"Goth Corners": {
"Goth Corners": "Gotik Köşeler"
},
@@ -1275,7 +1281,7 @@
"Numbers": "Numaralar"
},
"OS Logo": {
"OS Logo": "OS Logosu"
"OS Logo": "OS Logo"
},
"Office": {
"Office": "Ofis"

View File

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

View File

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

View File

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