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

Popup transparency option

This commit is contained in:
bbedward
2025-07-14 15:00:58 -04:00
parent 0a4453ab3b
commit 3b16ae73c7
13 changed files with 132 additions and 38 deletions

View File

@@ -19,9 +19,25 @@ QtObject {
Colors.colorsUpdated.connect(root.onColorsUpdated)
}
// Initialize transparency values from Prefs
if (typeof Prefs !== "undefined") {
if (Prefs.popupTransparency !== undefined) {
root.popupTransparency = Prefs.popupTransparency
}
// Connect to transparency changes
if (Prefs.popupTransparencyChanged) {
Prefs.popupTransparencyChanged.connect(function() {
if (typeof Prefs !== "undefined" && Prefs.popupTransparency !== undefined) {
root.popupTransparency = Prefs.popupTransparency
}
})
}
}
console.log("Theme initialized, waiting for Prefs to load settings and apply theme")
}
// Handle successful color extraction
function onColorsUpdated() {
console.log("Colors updated successfully - switching to dynamic theme")
@@ -502,6 +518,37 @@ QtObject {
property real opacityHigh: 0.87
property real opacityFull: 1.0
// Transparency system - can be overridden by Prefs
property real panelTransparency: 0.85
property real popupTransparency: 0.92
// Smart transparency functions for content-aware backgrounds
function getPopupBackgroundAlpha() {
return popupTransparency
}
function getContentBackgroundAlpha() {
return popupTransparency
}
function getPopupBorderAlpha() {
// Borders can be more transparent than the main content
return popupTransparency * 0.6
}
// Convenience functions for themed backgrounds with transparency
function popupBackground() {
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, popupTransparency)
}
function contentBackground() {
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, popupTransparency)
}
function panelBackground() {
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, panelTransparency)
}
property string iconFont: "Material Symbols Rounded"
property string iconFontFilled: "Material Symbols Rounded"
property int iconFontWeight: Font.Normal