mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 23:42:51 -05:00
fix binding loop
This commit is contained in:
@@ -141,6 +141,9 @@ PanelWindow {
|
|||||||
property bool autoHide: SettingsData.topBarAutoHide
|
property bool autoHide: SettingsData.topBarAutoHide
|
||||||
property bool reveal: SettingsData.topBarVisible && (!autoHide || topBarMouseArea.containsMouse || hasActivePopout)
|
property bool reveal: SettingsData.topBarVisible && (!autoHide || topBarMouseArea.containsMouse || hasActivePopout)
|
||||||
|
|
||||||
|
property var notepadInstance: null
|
||||||
|
property bool notepadInstanceVisible: notepadInstance?.notepadVisible ?? false
|
||||||
|
|
||||||
readonly property bool hasActivePopout: {
|
readonly property bool hasActivePopout: {
|
||||||
const loaders = [{
|
const loaders = [{
|
||||||
"loader": appDrawerLoader,
|
"loader": appDrawerLoader,
|
||||||
@@ -163,23 +166,22 @@ PanelWindow {
|
|||||||
}, {
|
}, {
|
||||||
"loader": controlCenterLoader,
|
"loader": controlCenterLoader,
|
||||||
"prop": "shouldBeVisible"
|
"prop": "shouldBeVisible"
|
||||||
}, {
|
|
||||||
"instance": root.getNotepadInstanceForScreen(),
|
|
||||||
"prop": "notepadVisible"
|
|
||||||
}, {
|
}, {
|
||||||
"loader": clipboardHistoryModalPopup,
|
"loader": clipboardHistoryModalPopup,
|
||||||
"prop": "visible"
|
"prop": "visible"
|
||||||
}]
|
}]
|
||||||
return loaders.some(item => {
|
return notepadInstanceVisible || loaders.some(item => {
|
||||||
if (item.loader) {
|
if (item.loader) {
|
||||||
return item.loader?.item?.[item.prop]
|
return item.loader?.item?.[item.prop]
|
||||||
} else if (item.instance) {
|
|
||||||
return item.instance?.[item.prop]
|
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
notepadInstance = root.getNotepadInstanceForScreen()
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
function onTopBarTransparencyChanged() {
|
function onTopBarTransparencyChanged() {
|
||||||
topBarCore.backgroundTransparency = SettingsData.topBarTransparency
|
topBarCore.backgroundTransparency = SettingsData.topBarTransparency
|
||||||
@@ -967,7 +969,7 @@ PanelWindow {
|
|||||||
id: notepadButtonComponent
|
id: notepadButtonComponent
|
||||||
|
|
||||||
NotepadButton {
|
NotepadButton {
|
||||||
property var notepadInstance: root.getNotepadInstanceForScreen()
|
property var notepadInstance: topBarCore.notepadInstance
|
||||||
isActive: notepadInstance ? notepadInstance.notepadVisible : false
|
isActive: notepadInstance ? notepadInstance.notepadVisible : false
|
||||||
widgetHeight: root.widgetHeight
|
widgetHeight: root.widgetHeight
|
||||||
barHeight: root.effectiveBarHeight
|
barHeight: root.effectiveBarHeight
|
||||||
|
|||||||
@@ -1,10 +1,27 @@
|
|||||||
layout {
|
layout {
|
||||||
|
focus-ring {
|
||||||
|
active-color "{{colors.primary.default.hex}}"
|
||||||
|
inactive-color "{{colors.outline.default.hex}}"
|
||||||
|
urgent-color "{{colors.error.default.hex}}"
|
||||||
|
}
|
||||||
|
|
||||||
border {
|
border {
|
||||||
active-color "{{colors.primary.default.hex}}"
|
active-color "{{colors.primary.default.hex}}"
|
||||||
inactive-color "{{colors.secondary.default.hex}}"
|
inactive-color "{{colors.outline.default.hex}}"
|
||||||
|
urgent-color "{{colors.error.default.hex}}"
|
||||||
}
|
}
|
||||||
focus-ring {
|
|
||||||
active-color "{{colors.inverse_primary.default.hex}}"
|
shadow {
|
||||||
|
color "{{colors.shadow.default.hex}}70"
|
||||||
|
}
|
||||||
|
|
||||||
|
tab-indicator {
|
||||||
|
active-color "{{colors.primary.default.hex}}"
|
||||||
|
inactive-color "{{colors.outline.default.hex}}"
|
||||||
|
urgent-color "{{colors.error.default.hex}}"
|
||||||
|
}
|
||||||
|
|
||||||
|
insert-hint {
|
||||||
|
color "{{colors.primary.default.hex}}80"
|
||||||
}
|
}
|
||||||
background-color "{{colors.background.default.hex}}"
|
|
||||||
}
|
}
|
||||||
@@ -395,7 +395,7 @@ ShellRoot {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNotepadInstanceForScreen(screenName) {
|
function getNotepadInstanceForScreen(screenName: string) {
|
||||||
if (!screenName || notepadSlideoutVariants.instances.length === 0) {
|
if (!screenName || notepadSlideoutVariants.instances.length === 0) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user