1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00

dankbar: simplify transparency binding

This commit is contained in:
bbedward
2025-11-29 22:55:14 -05:00
parent 202cf4bcc9
commit 261f55fea5
2 changed files with 8 additions and 16 deletions

View File

@@ -108,10 +108,13 @@ Item {
id: barRepeaterModel id: barRepeaterModel
values: { values: {
const configs = SettingsData.barConfigs; const configs = SettingsData.barConfigs;
return configs.map(c => ({ return configs
id: c.id, .map(c => ({ id: c.id, position: c.position }))
position: c.position .sort((a, b) => {
})); const aVertical = a.position === SettingsData.Position.Left || a.position === SettingsData.Position.Right;
const bVertical = b.position === SettingsData.Position.Left || b.position === SettingsData.Position.Right;
return aVertical - bVertical;
});
} }
} }

View File

@@ -140,7 +140,7 @@ PanelWindow {
property real wingtipsRadius: barConfig?.gothCornerRadiusOverride ? (barConfig?.gothCornerRadiusValue ?? 12) : Theme.cornerRadius property real wingtipsRadius: barConfig?.gothCornerRadiusOverride ? (barConfig?.gothCornerRadiusValue ?? 12) : 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 ?? (barConfig?.transparency ?? 1.0) readonly property real _backgroundAlpha: barConfig?.transparency ?? 1.0
readonly property color _bgColor: Theme.withAlpha(_surfaceContainer, _backgroundAlpha) readonly property color _bgColor: Theme.withAlpha(_surfaceContainer, _backgroundAlpha)
readonly property real _dpr: CompositorService.getScreenScale(barWindow.screen) readonly property real _dpr: CompositorService.getScreenScale(barWindow.screen)
@@ -419,7 +419,6 @@ PanelWindow {
anchors.fill: parent anchors.fill: parent
layer.enabled: true layer.enabled: true
property real backgroundTransparency: barConfig?.transparency ?? 1.0
property bool autoHide: barConfig?.autoHide ?? false property bool autoHide: barConfig?.autoHide ?? false
property bool revealSticky: false property bool revealSticky: false
@@ -471,7 +470,6 @@ PanelWindow {
Connections { Connections {
function onBarConfigChanged() { function onBarConfigChanged() {
topBarCore.backgroundTransparency = barConfig?.transparency ?? 1.0;
topBarCore.autoHide = barConfig?.autoHide ?? false; topBarCore.autoHide = barConfig?.autoHide ?? false;
revealHold.interval = barConfig?.autoHideDelay ?? 250; revealHold.interval = barConfig?.autoHideDelay ?? 250;
} }
@@ -479,15 +477,6 @@ PanelWindow {
target: rootWindow target: rootWindow
} }
Connections {
target: SettingsData
function onBarConfigsChanged() {
Qt.callLater(() => {
topBarCore.backgroundTransparency = barConfig?.transparency ?? 1.0;
});
}
}
function evaluateReveal() { function evaluateReveal() {
if (!autoHide) if (!autoHide)
return; return;