mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 23:42:51 -05:00
Fix keyboard navi in file browser
This commit is contained in:
@@ -712,7 +712,13 @@ Singleton {
|
|||||||
return `#${invR}${invG}${invB}`;
|
return `#${invR}${invG}${invB}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
property string baseLogoColor: ""
|
property string baseLogoColor: {
|
||||||
|
if (typeof SettingsData === "undefined") return ""
|
||||||
|
const colorOverride = SettingsData.launcherLogoColorOverride
|
||||||
|
if (!colorOverride || colorOverride === "") return ""
|
||||||
|
return colorOverride
|
||||||
|
}
|
||||||
|
|
||||||
property string effectiveLogoColor: {
|
property string effectiveLogoColor: {
|
||||||
if (typeof SettingsData === "undefined") return ""
|
if (typeof SettingsData === "undefined") return ""
|
||||||
|
|
||||||
@@ -723,10 +729,6 @@ Singleton {
|
|||||||
return colorOverride
|
return colorOverride
|
||||||
}
|
}
|
||||||
|
|
||||||
if (baseLogoColor === "") {
|
|
||||||
baseLogoColor = colorOverride
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof SessionData !== "undefined" && SessionData.isLightMode) {
|
if (typeof SessionData !== "undefined" && SessionData.isLightMode) {
|
||||||
return invertHex(baseLogoColor)
|
return invertHex(baseLogoColor)
|
||||||
}
|
}
|
||||||
@@ -734,18 +736,7 @@ Singleton {
|
|||||||
return baseLogoColor
|
return baseLogoColor
|
||||||
}
|
}
|
||||||
|
|
||||||
onIsLightModeChanged: {
|
|
||||||
if (typeof SettingsData !== "undefined" && SettingsData.launcherLogoColorInvertOnMode && baseLogoColor === "") {
|
|
||||||
baseLogoColor = SettingsData.launcherLogoColorOverride
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: typeof SettingsData !== "undefined" ? SettingsData : null
|
|
||||||
function onLauncherLogoColorOverrideChanged() {
|
|
||||||
baseLogoColor = SettingsData.launcherLogoColorOverride
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: matugenCheck
|
id: matugenCheck
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ DankModal {
|
|||||||
property bool weAvailable: false
|
property bool weAvailable: false
|
||||||
property string wePath: ""
|
property string wePath: ""
|
||||||
property bool weMode: false
|
property bool weMode: false
|
||||||
|
property var parentModal: null
|
||||||
|
|
||||||
signal fileSelected(string path)
|
signal fileSelected(string path)
|
||||||
|
|
||||||
@@ -131,6 +132,8 @@ DankModal {
|
|||||||
|
|
||||||
objectName: "fileBrowserModal"
|
objectName: "fileBrowserModal"
|
||||||
allowStacking: true
|
allowStacking: true
|
||||||
|
closeOnEscapeKey: false
|
||||||
|
shouldHaveFocus: shouldBeVisible
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
currentPath = getLastPath()
|
currentPath = getLastPath()
|
||||||
}
|
}
|
||||||
@@ -165,10 +168,23 @@ DankModal {
|
|||||||
visible: false
|
visible: false
|
||||||
onBackgroundClicked: close()
|
onBackgroundClicked: close()
|
||||||
onOpened: {
|
onOpened: {
|
||||||
modalFocusScope.forceActiveFocus()
|
if (parentModal) {
|
||||||
|
parentModal.shouldHaveFocus = false
|
||||||
|
parentModal.allowFocusOverride = true
|
||||||
|
}
|
||||||
|
Qt.callLater(() => {
|
||||||
|
if (contentLoader && contentLoader.item) {
|
||||||
|
contentLoader.item.forceActiveFocus()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
modalFocusScope.Keys.onPressed: function (event) {
|
onDialogClosed: {
|
||||||
keyboardController.handleKey(event)
|
if (parentModal) {
|
||||||
|
parentModal.allowFocusOverride = false
|
||||||
|
parentModal.shouldHaveFocus = Qt.binding(() => {
|
||||||
|
return parentModal.shouldBeVisible
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
@@ -455,6 +471,16 @@ DankModal {
|
|||||||
Item {
|
Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Keys.onPressed: event => {
|
||||||
|
keyboardController.handleKey(event)
|
||||||
|
}
|
||||||
|
|
||||||
|
onVisibleChanged: {
|
||||||
|
if (visible) {
|
||||||
|
forceActiveFocus()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Theme.spacingM
|
anchors.margins: Theme.spacingM
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ DankModal {
|
|||||||
id: profileBrowser
|
id: profileBrowser
|
||||||
|
|
||||||
allowStacking: true
|
allowStacking: true
|
||||||
|
parentModal: settingsModal
|
||||||
browserTitle: "Select Profile Image"
|
browserTitle: "Select Profile Image"
|
||||||
browserIcon: "person"
|
browserIcon: "person"
|
||||||
browserType: "profile"
|
browserType: "profile"
|
||||||
@@ -87,12 +88,6 @@ DankModal {
|
|||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
onDialogClosed: () => {
|
onDialogClosed: () => {
|
||||||
if (settingsModal) {
|
|
||||||
settingsModal.allowFocusOverride = false;
|
|
||||||
settingsModal.shouldHaveFocus = Qt.binding(() => {
|
|
||||||
return settingsModal.shouldBeVisible;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
allowStacking = true;
|
allowStacking = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,6 +96,7 @@ DankModal {
|
|||||||
id: wallpaperBrowser
|
id: wallpaperBrowser
|
||||||
|
|
||||||
allowStacking: true
|
allowStacking: true
|
||||||
|
parentModal: settingsModal
|
||||||
browserTitle: "Select Wallpaper"
|
browserTitle: "Select Wallpaper"
|
||||||
browserIcon: "wallpaper"
|
browserIcon: "wallpaper"
|
||||||
browserType: "wallpaper"
|
browserType: "wallpaper"
|
||||||
|
|||||||
@@ -233,10 +233,6 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (parentModal) {
|
|
||||||
parentModal.allowFocusOverride = true
|
|
||||||
parentModal.shouldHaveFocus = false
|
|
||||||
}
|
|
||||||
wallpaperBrowserLoader.active = true
|
wallpaperBrowserLoader.active = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1855,7 +1851,10 @@ Item {
|
|||||||
asynchronous: true
|
asynchronous: true
|
||||||
|
|
||||||
sourceComponent: FileBrowserModal {
|
sourceComponent: FileBrowserModal {
|
||||||
Component.onCompleted: open()
|
parentModal: personalizationTab.parentModal
|
||||||
|
Component.onCompleted: {
|
||||||
|
open()
|
||||||
|
}
|
||||||
browserTitle: "Select Wallpaper"
|
browserTitle: "Select Wallpaper"
|
||||||
browserIcon: "wallpaper"
|
browserIcon: "wallpaper"
|
||||||
browserType: "wallpaper"
|
browserType: "wallpaper"
|
||||||
@@ -1869,12 +1868,6 @@ Item {
|
|||||||
close()
|
close()
|
||||||
}
|
}
|
||||||
onDialogClosed: {
|
onDialogClosed: {
|
||||||
if (parentModal) {
|
|
||||||
parentModal.allowFocusOverride = false
|
|
||||||
parentModal.shouldHaveFocus = Qt.binding(() => {
|
|
||||||
return parentModal.shouldBeVisible
|
|
||||||
})
|
|
||||||
}
|
|
||||||
Qt.callLater(() => wallpaperBrowserLoader.active = false)
|
Qt.callLater(() => wallpaperBrowserLoader.active = false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user