mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-29 07:27:46 +00:00
Prevent opening windows and external browsers on the Steam Deck
This commit is contained in:
parent
0a01e79875
commit
5e9fcfab78
3 changed files with 45 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>ui/Components/FormFileDelegate.qml</file>
|
<file>ui/Components/FormFileDelegate.qml</file>
|
||||||
<file>ui/Components/FormFolderDelegate.qml</file>
|
<file>ui/Components/FormFolderDelegate.qml</file>
|
||||||
|
<file>ui/Pages/BrowserPage.qml</file>
|
||||||
<file>ui/Pages/LoginPage.qml</file>
|
<file>ui/Pages/LoginPage.qml</file>
|
||||||
<file>ui/Pages/MainPage.qml</file>
|
<file>ui/Pages/MainPage.qml</file>
|
||||||
<file>ui/Pages/NewsPage.qml</file>
|
<file>ui/Pages/NewsPage.qml</file>
|
||||||
|
|
26
launcher/ui/Pages/BrowserPage.qml
Normal file
26
launcher/ui/Pages/BrowserPage.qml
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
import QtQuick 2.15
|
||||||
|
import QtQuick.Window 2.15
|
||||||
|
import org.kde.kirigami 2.20 as Kirigami
|
||||||
|
import QtQuick.Controls 2.15 as Controls
|
||||||
|
import QtQuick.Layouts 1.15
|
||||||
|
import QtWebEngine 1.10
|
||||||
|
import com.redstrate.astra 1.0
|
||||||
|
|
||||||
|
Kirigami.Page {
|
||||||
|
id: page
|
||||||
|
|
||||||
|
property var url
|
||||||
|
|
||||||
|
title: i18n("Web Browser")
|
||||||
|
|
||||||
|
padding: 0
|
||||||
|
|
||||||
|
WebEngineView {
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
url: page.url
|
||||||
|
}
|
||||||
|
}
|
|
@ -52,6 +52,24 @@ Kirigami.ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function pushDialogLayer(url) {
|
||||||
|
if (LauncherCore.isSteamDeck) {
|
||||||
|
pageStack.layers.push(url)
|
||||||
|
} else {
|
||||||
|
pageStack.pushDialogLayer(url)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function openUrl(url) {
|
||||||
|
if (LauncherCore.isSteamDeck) {
|
||||||
|
pageStack.layers.push('qrc:/ui/Pages/BrowserPage.qml', {
|
||||||
|
url: url
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
Qt.openUrlExternally(url)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: LauncherCore
|
target: LauncherCore
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue