mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 15:03:09 +00:00
taskswitcher: Account for shell panels in app preview
change
This commit is contained in:
parent
0e4b1da9a1
commit
4bdacff13c
5 changed files with 19 additions and 28 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
import org.kde.plasma.core as PlasmaCore
|
import org.kde.plasma.core as PlasmaCore
|
||||||
|
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
||||||
|
|
||||||
// NOTE: This is a singleton in the mobileshell library, so we need to be careful to
|
// NOTE: This is a singleton in the mobileshell library, so we need to be careful to
|
||||||
// make this load as fast as possible (since it may be loaded in other processes ex. lockscreen).
|
// make this load as fast as possible (since it may be loaded in other processes ex. lockscreen).
|
||||||
|
|
@ -12,4 +13,5 @@ pragma Singleton
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
readonly property real topPanelHeight: PlasmaCore.Units.gridUnit + PlasmaCore.Units.smallSpacing
|
readonly property real topPanelHeight: PlasmaCore.Units.gridUnit + PlasmaCore.Units.smallSpacing
|
||||||
|
readonly property real bottomPanelHeight: ShellSettings.Settings.navigationPanelEnabled ? PlasmaCore.Units.gridUnit * 2 : 0
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: 2021-2023 Devin Lin <devin@kde.org>
|
// SPDX-FileCopyrightText: 2021-2023 Devin Lin <devin@kde.org>
|
||||||
// SPDX-License-Identifier: LGPL-2.0-or-later
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
||||||
|
|
||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.15
|
|
||||||
|
|
||||||
import org.kde.taskmanager 0.1 as TaskManager
|
|
||||||
import org.kde.plasma.core 2.1 as PlasmaCore
|
|
||||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
|
||||||
|
|
||||||
Flickable {
|
Flickable {
|
||||||
id: root
|
id: root
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,11 @@
|
||||||
// SPDX-FileCopyrightText: 2021-2023 Devin Lin <devin@kde.org>
|
// SPDX-FileCopyrightText: 2021-2023 Devin Lin <devin@kde.org>
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.2
|
|
||||||
import QtQuick.Controls 2.2 as QQC2
|
|
||||||
import Qt5Compat.GraphicalEffects
|
import Qt5Compat.GraphicalEffects
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core as PlasmaCore
|
||||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||||
import org.kde.kwin 3.0 as KWinComponents
|
import org.kde.kwin 3.0 as KWinComponents
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
// SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
// SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
import QtQuick 2.12
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts
|
||||||
|
|
||||||
import org.kde.taskmanager 0.1 as TaskManager
|
import org.kde.plasma.core as PlasmaCore
|
||||||
import org.kde.plasma.core 2.1 as PlasmaCore
|
|
||||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||||
|
|
||||||
import org.kde.kwin 3.0 as KWinComponents
|
import org.kde.kwin 3.0 as KWinComponents
|
||||||
|
|
@ -28,7 +27,7 @@ Item {
|
||||||
|
|
||||||
let baseY = (taskSwitcher.height / 2) - (taskSwitcherState.taskHeight / 2) - (taskSwitcherState.taskHeaderHeight / 2)
|
let baseY = (taskSwitcher.height / 2) - (taskSwitcherState.taskHeight / 2) - (taskSwitcherState.taskHeaderHeight / 2)
|
||||||
|
|
||||||
return baseY + diff / 2;
|
return baseY + diff / 2 - shellTopMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeAll() {
|
function closeAll() {
|
||||||
|
|
|
||||||
|
|
@ -2,17 +2,14 @@
|
||||||
// SPDX-FileCopyrightText: 2021-2023 Devin Lin <devin@kde.org>
|
// SPDX-FileCopyrightText: 2021-2023 Devin Lin <devin@kde.org>
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
import QtQuick 2.15
|
import QtQuick
|
||||||
import QtQuick.Controls 2.15 as QQC2
|
import QtQuick.Layouts
|
||||||
import QtQuick.Layouts 1.1
|
|
||||||
import QtQuick.Window 2.15
|
|
||||||
import Qt5Compat.GraphicalEffects
|
import Qt5Compat.GraphicalEffects
|
||||||
|
|
||||||
import org.kde.taskmanager 0.1 as TaskManager
|
import org.kde.plasma.core as PlasmaCore
|
||||||
import org.kde.plasma.core 2.1 as PlasmaCore
|
|
||||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||||
import org.kde.kirigami 2.19 as Kirigami
|
import org.kde.plasma.extras as PlasmaExtras
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
import org.kde.plasma.private.mobileshell as MobileShell
|
||||||
|
|
||||||
import org.kde.kwin 3.0 as KWinComponents
|
import org.kde.kwin 3.0 as KWinComponents
|
||||||
import org.kde.kwin.private.effects 1.0
|
import org.kde.kwin.private.effects 1.0
|
||||||
|
|
@ -27,8 +24,8 @@ FocusScope {
|
||||||
readonly property QtObject effect: KWinComponents.SceneView.effect
|
readonly property QtObject effect: KWinComponents.SceneView.effect
|
||||||
readonly property QtObject targetScreen: KWinComponents.SceneView.screen
|
readonly property QtObject targetScreen: KWinComponents.SceneView.screen
|
||||||
|
|
||||||
readonly property real topMargin: 0
|
readonly property real topMargin: MobileShell.Constants.topPanelHeight
|
||||||
readonly property real bottomMargin: 0
|
readonly property real bottomMargin: MobileShell.Constants.bottomPanelHeight
|
||||||
readonly property real leftMargin: 0
|
readonly property real leftMargin: 0
|
||||||
readonly property real rightMargin: 0
|
readonly property real rightMargin: 0
|
||||||
|
|
||||||
|
|
@ -184,13 +181,13 @@ FocusScope {
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
Kirigami.Icon {
|
PlasmaCore.IconItem {
|
||||||
id: icon
|
id: icon
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
implicitWidth: PlasmaCore.Units.iconSizes.large
|
implicitWidth: PlasmaCore.Units.iconSizes.large
|
||||||
implicitHeight: PlasmaCore.Units.iconSizes.large
|
implicitHeight: PlasmaCore.Units.iconSizes.large
|
||||||
source: "window"
|
source: "window"
|
||||||
color: "white"
|
// color: "white"
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaExtras.Heading {
|
PlasmaExtras.Heading {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue