mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 10:14:45 +00:00
panels: Port to plasma-framework changes
This commit is contained in:
parent
8a577f9a57
commit
25a513d829
5 changed files with 57 additions and 53 deletions
|
|
@ -19,7 +19,7 @@ ContainmentItem {
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
Halcyon.ApplicationListModel.loadApplications();
|
Halcyon.ApplicationListModel.loadApplications();
|
||||||
Halcyon.PinnedModel.applet = Plasmoid.nativeInterface;
|
Halcyon.PinnedModel.applet = root.plasmoid;
|
||||||
forceActiveFocus();
|
forceActiveFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,15 @@
|
||||||
/*
|
// SPDX-FileCopyrightText: 2021-2023 Devin Lin <devin@kde.org>
|
||||||
* SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
// SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
|
||||||
* SPDX-FileCopyrightText: 2015 Marco Martin <mart@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.3
|
import QtQuick.Layouts
|
||||||
import QtQuick.Window 2.15
|
import QtQuick.Window
|
||||||
import QtQml.Models 2.12
|
import QtQml.Models
|
||||||
|
|
||||||
import org.kde.kirigami 2.12 as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
|
|
||||||
import org.kde.plasma.plasmoid 2.0
|
import org.kde.plasma.plasmoid
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||||
|
|
||||||
|
|
@ -20,24 +17,20 @@ import org.kde.plasma.private.mobileshell as MobileShell
|
||||||
import org.kde.plasma.private.mobileshell.state as MobileShellState
|
import org.kde.plasma.private.mobileshell.state as MobileShellState
|
||||||
import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin
|
import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin
|
||||||
|
|
||||||
import org.kde.taskmanager 0.1 as TaskManager
|
import org.kde.taskmanager as TaskManager
|
||||||
import org.kde.notificationmanager 1.0 as NotificationManager
|
import org.kde.notificationmanager as NotificationManager
|
||||||
|
|
||||||
Item {
|
ContainmentItem {
|
||||||
id: root
|
id: root
|
||||||
|
Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground
|
||||||
|
|
||||||
// only opaque if there are no maximized windows on this screen
|
// only opaque if there are no maximized windows on this screen
|
||||||
readonly property bool showingApp: WindowPlugin.WindowMaximizedTracker.showingWindow
|
readonly property bool showingApp: WindowPlugin.WindowMaximizedTracker.showingWindow
|
||||||
readonly property color backgroundColor: topPanel.colorScopeColor
|
readonly property color backgroundColor: topPanel.colorScopeColor
|
||||||
|
|
||||||
Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground
|
|
||||||
|
|
||||||
width: 480
|
|
||||||
height: PlasmaCore.Units.gridUnit
|
|
||||||
|
|
||||||
// enforce thickness
|
// enforce thickness
|
||||||
Binding {
|
Binding {
|
||||||
target: plasmoid.Window.window // assumed to be plasma-workspace "PanelView" component
|
target: Plasmoid.Window.window // assumed to be plasma-workspace "PanelView" component
|
||||||
property: "thickness"
|
property: "thickness"
|
||||||
value: PlasmaCore.Units.gridUnit + PlasmaCore.Units.smallSpacing
|
value: PlasmaCore.Units.gridUnit + PlasmaCore.Units.smallSpacing
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ MobileShell.NavigationPanel {
|
||||||
iconSizeFactor: 0.75
|
iconSizeFactor: 0.75
|
||||||
|
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
plasmoid.nativeInterface.triggerTaskSwitcher();
|
Plasmoid.triggerTaskSwitcher();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
/*
|
// SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
|
||||||
* SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
|
// SPDX-FileCopyrightText: 2021-2023 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.4
|
import QtQuick 2.4
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts 1.1
|
||||||
|
|
@ -18,13 +15,10 @@ import org.kde.plasma.private.mobileshell as MobileShell
|
||||||
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
||||||
import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin
|
import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin
|
||||||
|
|
||||||
PlasmaCore.ColorScope {
|
ContainmentItem {
|
||||||
id: root
|
id: root
|
||||||
Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground
|
Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground
|
||||||
|
|
||||||
width: 480
|
|
||||||
height: PlasmaCore.Units.gridUnit * 2
|
|
||||||
|
|
||||||
// toggle visibility of navigation bar (show, or use gestures only)
|
// toggle visibility of navigation bar (show, or use gestures only)
|
||||||
Binding {
|
Binding {
|
||||||
target: plasmoid.Window.window // assumed to be plasma-workspace "PanelView" component
|
target: plasmoid.Window.window // assumed to be plasma-workspace "PanelView" component
|
||||||
|
|
@ -111,6 +105,9 @@ PlasmaCore.ColorScope {
|
||||||
// only opaque if there are no maximized windows on this screen
|
// only opaque if there are no maximized windows on this screen
|
||||||
readonly property bool opaqueBar: WindowPlugin.WindowMaximizedTracker.showingWindow
|
readonly property bool opaqueBar: WindowPlugin.WindowMaximizedTracker.showingWindow
|
||||||
|
|
||||||
|
PlasmaCore.ColorScope {
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
// contrasting colour
|
// contrasting colour
|
||||||
colorGroup: opaqueBar ? PlasmaCore.Theme.NormalColorGroup : PlasmaCore.Theme.ComplementaryColorGroup
|
colorGroup: opaqueBar ? PlasmaCore.Theme.NormalColorGroup : PlasmaCore.Theme.ComplementaryColorGroup
|
||||||
|
|
||||||
|
|
@ -123,4 +120,5 @@ PlasmaCore.ColorScope {
|
||||||
opaqueBar: root.opaqueBar
|
opaqueBar: root.opaqueBar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@
|
||||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
import org.kde.plasma.core as PlasmaCore
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
|
|
@ -15,13 +15,26 @@ Rectangle {
|
||||||
visible: false //adjust borders is run during setup. We want to avoid painting till completed
|
visible: false //adjust borders is run during setup. We want to avoid painting till completed
|
||||||
property Item containment
|
property Item containment
|
||||||
|
|
||||||
color: !containment || containment.backgroundHints == PlasmaCore.Types.NoBackground ? "transparent" : PlasmaCore.Theme.textColor
|
color: !containment || containment.plasmoid.backgroundHints == PlasmaCore.Types.NoBackground ? "transparent" : PlasmaCore.Theme.textColor
|
||||||
|
|
||||||
onContainmentChanged: {
|
onContainmentChanged: {
|
||||||
containment.parent = root;
|
containment.parent = root;
|
||||||
containment.visible = true;
|
containment.visible = true;
|
||||||
containment.anchors.fill = root;
|
containment.anchors.fill = root;
|
||||||
panel.backgroundHints = containment.backgroundHints;
|
}
|
||||||
|
|
||||||
|
Binding {
|
||||||
|
target: panel
|
||||||
|
property: "backgroundHints"
|
||||||
|
when: containment
|
||||||
|
value: {
|
||||||
|
if (!containment) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return containment.plasmoid.backgroundHints;
|
||||||
|
}
|
||||||
|
restoreMode: Binding.RestoreBinding
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue