mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 16:02:51 -05:00
top bar improvements
This commit is contained in:
@@ -80,43 +80,18 @@ DankPopout {
|
|||||||
property alias bluetoothCodecSelector: bluetoothCodecSelector
|
property alias bluetoothCodecSelector: bluetoothCodecSelector
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: controlContent
|
id: controlContent
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
implicitHeight: mainColumn.implicitHeight + Theme.spacingM
|
implicitHeight: mainColumn.implicitHeight + Theme.spacingM
|
||||||
|
|
||||||
color: Theme.popupBackground()
|
color: Theme.popupBackground()
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
||||||
Theme.outline.b, 0.08)
|
Theme.outline.b, 0.08)
|
||||||
border.width: 1
|
border.width: 1
|
||||||
antialiasing: true
|
antialiasing: true
|
||||||
smooth: true
|
smooth: true
|
||||||
focus: true
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (root.shouldBeVisible)
|
|
||||||
forceActiveFocus()
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onPressed: function (event) {
|
|
||||||
if (event.key === Qt.Key_Escape) {
|
|
||||||
root.close()
|
|
||||||
event.accepted = true
|
|
||||||
} else {
|
|
||||||
event.accepted = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onShouldBeVisibleChanged() {
|
|
||||||
if (root.shouldBeVisible)
|
|
||||||
Qt.callLater(function () {
|
|
||||||
controlContent.forceActiveFocus()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
target: root
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: mainColumn
|
id: mainColumn
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -137,32 +137,28 @@ PanelWindow {
|
|||||||
active: root.visible
|
active: root.visible
|
||||||
asynchronous: false
|
asynchronous: false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
FocusScope {
|
Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: shouldBeVisible
|
focus: true
|
||||||
focus: shouldBeVisible
|
|
||||||
|
|
||||||
Keys.onPressed: event => {
|
Keys.onPressed: event => {
|
||||||
if (event.key === Qt.Key_Escape) {
|
if (event.key === Qt.Key_Escape) {
|
||||||
close()
|
close()
|
||||||
event.accepted = true
|
event.accepted = true
|
||||||
} else {
|
} else {
|
||||||
// Forward all non-escape keys to content
|
event.accepted = false
|
||||||
event.accepted = false
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
onVisibleChanged: {
|
Component.onCompleted: {
|
||||||
if (visible) {
|
forceActiveFocus()
|
||||||
Qt.callLater(function () {
|
}
|
||||||
if (contentLoader.item) {
|
|
||||||
contentLoader.item.forceActiveFocus()
|
onVisibleChanged: {
|
||||||
} else {
|
if (visible) {
|
||||||
forceActiveFocus()
|
forceActiveFocus()
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user