mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 07:52:50 -05:00
modals: more focus fixes
This commit is contained in:
@@ -52,11 +52,15 @@ PanelWindow {
|
|||||||
closeTimer.stop()
|
closeTimer.stop()
|
||||||
shouldBeVisible = true
|
shouldBeVisible = true
|
||||||
visible = true
|
visible = true
|
||||||
focusScope.forceActiveFocus()
|
shouldHaveFocus = false
|
||||||
|
Qt.callLater(() => {
|
||||||
|
shouldHaveFocus = Qt.binding(() => shouldBeVisible)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
shouldBeVisible = false
|
shouldBeVisible = false
|
||||||
|
shouldHaveFocus = false
|
||||||
closeTimer.restart()
|
closeTimer.restart()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,11 +80,6 @@ PanelWindow {
|
|||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (root.visible) {
|
if (root.visible) {
|
||||||
opened()
|
opened()
|
||||||
Qt.callLater(() => {
|
|
||||||
if (shouldHaveFocus) {
|
|
||||||
focusScope.forceActiveFocus()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
if (Qt.inputMethod) {
|
if (Qt.inputMethod) {
|
||||||
Qt.inputMethod.hide()
|
Qt.inputMethod.hide()
|
||||||
@@ -90,12 +89,6 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onShouldHaveFocusChanged: {
|
|
||||||
if (shouldHaveFocus && shouldBeVisible && visible) {
|
|
||||||
Qt.callLater(() => focusScope.forceActiveFocus())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
function onCloseAllModalsExcept(excludedModal) {
|
function onCloseAllModalsExcept(excludedModal) {
|
||||||
if (excludedModal !== root && !allowStacking && shouldBeVisible) {
|
if (excludedModal !== root && !allowStacking && shouldBeVisible) {
|
||||||
@@ -315,20 +308,5 @@ PanelWindow {
|
|||||||
event.accepted = true
|
event.accepted = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onVisibleChanged: {
|
|
||||||
if (visible && shouldHaveFocus) {
|
|
||||||
Qt.callLater(() => focusScope.forceActiveFocus())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onShouldHaveFocusChanged() {
|
|
||||||
if (shouldHaveFocus && shouldBeVisible) {
|
|
||||||
Qt.callLater(() => focusScope.forceActiveFocus())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
target: root
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,6 +122,17 @@ DankModal {
|
|||||||
refreshPlugins()
|
refreshPlugins()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: contentLoader
|
||||||
|
function onLoaded() {
|
||||||
|
Qt.callLater(() => {
|
||||||
|
if (contentLoader.item && contentLoader.item.searchField) {
|
||||||
|
contentLoader.item.searchField.forceActiveFocus()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onDialogClosed: () => {
|
onDialogClosed: () => {
|
||||||
allPlugins = []
|
allPlugins = []
|
||||||
searchQuery = ""
|
searchQuery = ""
|
||||||
@@ -143,6 +154,10 @@ DankModal {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
focus: true
|
focus: true
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
browserSearchField.forceActiveFocus()
|
||||||
|
}
|
||||||
|
|
||||||
Keys.onPressed: event => {
|
Keys.onPressed: event => {
|
||||||
if (event.key === Qt.Key_Escape) {
|
if (event.key === Qt.Key_Escape) {
|
||||||
root.close()
|
root.close()
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
{
|
{
|
||||||
"term": "3rd party",
|
"term": "3rd party",
|
||||||
"context": "3rd party",
|
"context": "3rd party",
|
||||||
"reference": "Modules/Settings/PluginBrowser.qml:413",
|
"reference": "Modules/Settings/PluginBrowser.qml:428",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -542,7 +542,7 @@
|
|||||||
{
|
{
|
||||||
"term": "Browse Plugins",
|
"term": "Browse Plugins",
|
||||||
"context": "Browse Plugins",
|
"context": "Browse Plugins",
|
||||||
"reference": "Modules/Settings/PluginBrowser.qml:182",
|
"reference": "Modules/Settings/PluginBrowser.qml:197",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -590,7 +590,7 @@
|
|||||||
{
|
{
|
||||||
"term": "Cancel",
|
"term": "Cancel",
|
||||||
"context": "Cancel",
|
"context": "Cancel",
|
||||||
"reference": "Modals/BluetoothPairingModal.qml:251, Modals/PolkitAuthModal.qml:291, Modals/WifiPasswordModal.qml:494, Modals/FileBrowser/FileBrowserOverwriteDialog.qml:83, Modules/Settings/PluginBrowser.qml:635",
|
"reference": "Modals/BluetoothPairingModal.qml:251, Modals/PolkitAuthModal.qml:291, Modals/WifiPasswordModal.qml:494, Modals/FileBrowser/FileBrowserOverwriteDialog.qml:83, Modules/Settings/PluginBrowser.qml:650",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1796,7 +1796,7 @@
|
|||||||
{
|
{
|
||||||
"term": "I Understand",
|
"term": "I Understand",
|
||||||
"context": "I Understand",
|
"context": "I Understand",
|
||||||
"reference": "Modules/Settings/PluginBrowser.qml:641",
|
"reference": "Modules/Settings/PluginBrowser.qml:656",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1880,7 +1880,7 @@
|
|||||||
{
|
{
|
||||||
"term": "Install plugins from the DMS plugin registry",
|
"term": "Install plugins from the DMS plugin registry",
|
||||||
"context": "Install plugins from the DMS plugin registry",
|
"context": "Install plugins from the DMS plugin registry",
|
||||||
"reference": "Modules/Settings/PluginBrowser.qml:236",
|
"reference": "Modules/Settings/PluginBrowser.qml:251",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -2036,7 +2036,7 @@
|
|||||||
{
|
{
|
||||||
"term": "Loading plugins...",
|
"term": "Loading plugins...",
|
||||||
"context": "Loading plugins...",
|
"context": "Loading plugins...",
|
||||||
"reference": "Modules/Settings/PluginBrowser.qml:304",
|
"reference": "Modules/Settings/PluginBrowser.qml:319",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -2450,7 +2450,7 @@
|
|||||||
{
|
{
|
||||||
"term": "No plugins found",
|
"term": "No plugins found",
|
||||||
"context": "No plugins found",
|
"context": "No plugins found",
|
||||||
"reference": "Modules/Settings/PluginBrowser.qml:538",
|
"reference": "Modules/Settings/PluginBrowser.qml:553",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -3146,7 +3146,7 @@
|
|||||||
{
|
{
|
||||||
"term": "Search plugins...",
|
"term": "Search plugins...",
|
||||||
"context": "Search plugins...",
|
"context": "Search plugins...",
|
||||||
"reference": "Modules/Settings/PluginBrowser.qml:260",
|
"reference": "Modules/Settings/PluginBrowser.qml:275",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -3686,13 +3686,13 @@
|
|||||||
{
|
{
|
||||||
"term": "Third-Party Plugin Warning",
|
"term": "Third-Party Plugin Warning",
|
||||||
"context": "Third-Party Plugin Warning",
|
"context": "Third-Party Plugin Warning",
|
||||||
"reference": "Modules/Settings/PluginBrowser.qml:586",
|
"reference": "Modules/Settings/PluginBrowser.qml:601",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"term": "Third-party plugins are created by the community and are not officially supported by DankMaterialShell.\\n\\nThese plugins may pose security and privacy risks - install at your own risk.",
|
"term": "Third-party plugins are created by the community and are not officially supported by DankMaterialShell.\\n\\nThese plugins may pose security and privacy risks - install at your own risk.",
|
||||||
"context": "Third-party plugins are created by the community and are not officially supported by DankMaterialShell.\\n\\nThese plugins may pose security and privacy risks - install at your own risk.",
|
"context": "Third-party plugins are created by the community and are not officially supported by DankMaterialShell.\\n\\nThese plugins may pose security and privacy risks - install at your own risk.",
|
||||||
"reference": "Modules/Settings/PluginBrowser.qml:596",
|
"reference": "Modules/Settings/PluginBrowser.qml:611",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -4178,7 +4178,7 @@
|
|||||||
{
|
{
|
||||||
"term": "official",
|
"term": "official",
|
||||||
"context": "official",
|
"context": "official",
|
||||||
"reference": "Modules/Settings/PluginBrowser.qml:393",
|
"reference": "Modules/Settings/PluginBrowser.qml:408",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -4190,7 +4190,7 @@
|
|||||||
{
|
{
|
||||||
"term": "• Install only from trusted sources",
|
"term": "• Install only from trusted sources",
|
||||||
"context": "• Install only from trusted sources",
|
"context": "• Install only from trusted sources",
|
||||||
"reference": "Modules/Settings/PluginBrowser.qml:619",
|
"reference": "Modules/Settings/PluginBrowser.qml:634",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -4220,13 +4220,13 @@
|
|||||||
{
|
{
|
||||||
"term": "• Plugins may contain bugs or security issues",
|
"term": "• Plugins may contain bugs or security issues",
|
||||||
"context": "• Plugins may contain bugs or security issues",
|
"context": "• Plugins may contain bugs or security issues",
|
||||||
"reference": "Modules/Settings/PluginBrowser.qml:607",
|
"reference": "Modules/Settings/PluginBrowser.qml:622",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"term": "• Review code before installation when possible",
|
"term": "• Review code before installation when possible",
|
||||||
"context": "• Review code before installation when possible",
|
"context": "• Review code before installation when possible",
|
||||||
"reference": "Modules/Settings/PluginBrowser.qml:613",
|
"reference": "Modules/Settings/PluginBrowser.qml:628",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user