mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-06 21:48:30 -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 {
|
FloatingWindow {
|
||||||
id: settingsModal
|
id: settingsModal
|
||||||
|
|
||||||
property bool disablePopupTransparency: true
|
|
||||||
property var profileBrowser: profileBrowserLoader.item
|
property var profileBrowser: profileBrowserLoader.item
|
||||||
property var wallpaperBrowser: wallpaperBrowserLoader.item
|
property var wallpaperBrowser: wallpaperBrowserLoader.item
|
||||||
|
|
||||||
@@ -173,6 +172,8 @@ FloatingWindow {
|
|||||||
FocusScope {
|
FocusScope {
|
||||||
id: contentFocusScope
|
id: contentFocusScope
|
||||||
|
|
||||||
|
property bool disablePopupTransparency: true
|
||||||
|
|
||||||
LayoutMirroring.enabled: I18n.isRtl
|
LayoutMirroring.enabled: I18n.isRtl
|
||||||
LayoutMirroring.childrenInherit: true
|
LayoutMirroring.childrenInherit: true
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,16 @@ import qs.Widgets
|
|||||||
Row {
|
Row {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
function checkParentDisablesTransparency() {
|
||||||
|
let p = parent;
|
||||||
|
while (p) {
|
||||||
|
if (p.disablePopupTransparency === true)
|
||||||
|
return true;
|
||||||
|
p = p.parent;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
property var model: []
|
property var model: []
|
||||||
property int currentIndex: -1
|
property int currentIndex: -1
|
||||||
property string selectionMode: "single"
|
property string selectionMode: "single"
|
||||||
@@ -20,6 +30,7 @@ Row {
|
|||||||
property int checkIconSize: size === "small" ? Theme.iconSizeSmall - 2 : Theme.iconSizeSmall
|
property int checkIconSize: size === "small" ? Theme.iconSizeSmall - 2 : Theme.iconSizeSmall
|
||||||
property int textSize: size === "small" ? Theme.fontSizeSmall : Theme.fontSizeMedium
|
property int textSize: size === "small" ? Theme.fontSizeSmall : Theme.fontSizeMedium
|
||||||
property bool userInteracted: false
|
property bool userInteracted: false
|
||||||
|
property bool usePopupTransparency: !checkParentDisablesTransparency()
|
||||||
|
|
||||||
signal selectionChanged(int index, bool selected)
|
signal selectionChanged(int index, bool selected)
|
||||||
signal animationCompleted
|
signal animationCompleted
|
||||||
@@ -90,7 +101,7 @@ Row {
|
|||||||
width: Math.max(contentItem.implicitWidth + root.buttonPadding * 2, root.minButtonWidth) + (selected ? 4 : 0)
|
width: Math.max(contentItem.implicitWidth + root.buttonPadding * 2, root.minButtonWidth) + (selected ? 4 : 0)
|
||||||
height: root.buttonHeight
|
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.color: "transparent"
|
||||||
border.width: 0
|
border.width: 0
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,16 @@ import qs.Widgets
|
|||||||
Item {
|
Item {
|
||||||
id: slider
|
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 value: 50
|
||||||
property int minimum: 0
|
property int minimum: 0
|
||||||
property int maximum: 100
|
property int maximum: 100
|
||||||
@@ -22,7 +32,8 @@ Item {
|
|||||||
|
|
||||||
property color thumbOutlineColor: Theme.surfaceContainer
|
property color thumbOutlineColor: Theme.surfaceContainer
|
||||||
property color trackColor: enabled ? Theme.outline : Theme.outline
|
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 sliderValueChanged(int newValue)
|
||||||
signal sliderDragFinished(int finalValue)
|
signal sliderDragFinished(int finalValue)
|
||||||
|
|||||||
Reference in New Issue
Block a user