mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-07 14:05:38 -05:00
Implement transparency background slider
This commit is contained in:
@@ -13,6 +13,19 @@ ScrollView {
|
||||
|
||||
// These should be bound from parent
|
||||
property bool nightModeEnabled: false
|
||||
property real topBarTransparency: Prefs.topBarTransparency // Default transparency value
|
||||
|
||||
Component.onCompleted: {
|
||||
// Sync with stored transparency value on startup
|
||||
topBarTransparency = Prefs.topBarTransparency
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: Prefs
|
||||
function onTopBarTransparencyChanged() {
|
||||
displayTab.topBarTransparency = Prefs.topBarTransparency
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
width: parent.width
|
||||
@@ -164,6 +177,47 @@ ScrollView {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Top Bar Transparency Control
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingM
|
||||
anchors.margins: Theme.spacingM
|
||||
|
||||
Text {
|
||||
text: "Top Bar Transparency"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Medium
|
||||
}
|
||||
|
||||
CustomSlider {
|
||||
width: parent.width - (Theme.spacingM * 2)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
value: Math.round(displayTab.topBarTransparency * 100)
|
||||
minimum: 0
|
||||
maximum: 100
|
||||
leftIcon: "opacity"
|
||||
rightIcon: "circle"
|
||||
unit: "%"
|
||||
showValue: true
|
||||
|
||||
onSliderValueChanged: (newValue) => {
|
||||
let transparencyValue = newValue / 100.0
|
||||
displayTab.topBarTransparency = transparencyValue
|
||||
Prefs.setTopBarTransparency(transparencyValue)
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
text: "Adjust the transparency of the top bar background"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
wrapMode: Text.WordWrap
|
||||
width: parent.width - (Theme.spacingM * 2)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
|
||||
// Theme Picker
|
||||
Column {
|
||||
|
||||
Reference in New Issue
Block a user