mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-02 03:28:28 -04:00
refactor(transparency): stop overwriting dms settings buttons/sliders by default
- Fixes #2692
This commit is contained in:
@@ -8,7 +8,6 @@ import qs.Widgets
|
||||
FloatingWindow {
|
||||
id: settingsModal
|
||||
|
||||
property bool disablePopupTransparency: true
|
||||
property var profileBrowser: profileBrowserLoader.item
|
||||
property var wallpaperBrowser: wallpaperBrowserLoader.item
|
||||
|
||||
@@ -173,6 +172,8 @@ FloatingWindow {
|
||||
FocusScope {
|
||||
id: contentFocusScope
|
||||
|
||||
property bool disablePopupTransparency: true
|
||||
|
||||
LayoutMirroring.enabled: I18n.isRtl
|
||||
LayoutMirroring.childrenInherit: true
|
||||
|
||||
|
||||
@@ -6,6 +6,16 @@ import qs.Widgets
|
||||
Row {
|
||||
id: root
|
||||
|
||||
function checkParentDisablesTransparency() {
|
||||
let p = parent;
|
||||
while (p) {
|
||||
if (p.disablePopupTransparency === true)
|
||||
return true;
|
||||
p = p.parent;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
property var model: []
|
||||
property int currentIndex: -1
|
||||
property string selectionMode: "single"
|
||||
@@ -20,6 +30,7 @@ Row {
|
||||
property int checkIconSize: size === "small" ? Theme.iconSizeSmall - 2 : Theme.iconSizeSmall
|
||||
property int textSize: size === "small" ? Theme.fontSizeSmall : Theme.fontSizeMedium
|
||||
property bool userInteracted: false
|
||||
property bool usePopupTransparency: !checkParentDisablesTransparency()
|
||||
|
||||
signal selectionChanged(int index, bool selected)
|
||||
signal animationCompleted
|
||||
@@ -90,7 +101,7 @@ Row {
|
||||
width: Math.max(contentItem.implicitWidth + root.buttonPadding * 2, root.minButtonWidth) + (selected ? 4 : 0)
|
||||
height: root.buttonHeight
|
||||
|
||||
color: selected ? Theme.buttonBg : Theme.withAlpha(Theme.surfaceVariant, Theme.popupTransparency)
|
||||
color: selected ? Theme.buttonBg : (root.usePopupTransparency ? Theme.withAlpha(Theme.surfaceVariant, Theme.popupTransparency) : Theme.surfaceVariant)
|
||||
border.color: "transparent"
|
||||
border.width: 0
|
||||
|
||||
|
||||
@@ -5,6 +5,16 @@ import qs.Widgets
|
||||
Item {
|
||||
id: slider
|
||||
|
||||
function checkParentDisablesTransparency() {
|
||||
let p = parent;
|
||||
while (p) {
|
||||
if (p.disablePopupTransparency === true)
|
||||
return true;
|
||||
p = p.parent;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
property int value: 50
|
||||
property int minimum: 0
|
||||
property int maximum: 100
|
||||
@@ -22,7 +32,8 @@ Item {
|
||||
|
||||
property color thumbOutlineColor: Theme.surfaceContainer
|
||||
property color trackColor: enabled ? Theme.outline : Theme.outline
|
||||
property real trackOpacity: Theme.popupTransparency
|
||||
property bool usePopupTransparency: !checkParentDisablesTransparency()
|
||||
property real trackOpacity: usePopupTransparency ? Theme.popupTransparency : 1.0
|
||||
|
||||
signal sliderValueChanged(int newValue)
|
||||
signal sliderDragFinished(int finalValue)
|
||||
|
||||
Reference in New Issue
Block a user