2021-10-31 04:11:10 +00:00
|
|
|
/*
|
|
|
|
|
* SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
|
|
|
|
|
* SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
*/
|
|
|
|
|
|
2023-05-13 02:07:48 +00:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import QtQuick.Window
|
|
|
|
|
import QtQuick.Effects
|
2026-04-08 17:07:37 +00:00
|
|
|
import QtQuick.Controls as Controls
|
2021-10-31 04:11:10 +00:00
|
|
|
|
2026-03-07 03:08:07 +00:00
|
|
|
import org.kde.kirigami as Kirigami
|
2021-10-31 04:11:10 +00:00
|
|
|
import org.kde.taskmanager 0.1 as TaskManager
|
|
|
|
|
import org.kde.kquickcontrolsaddons 2.0
|
2023-11-02 11:08:17 +00:00
|
|
|
import org.kde.plasma.private.mobileshell.state as MobileShellState
|
2023-03-17 02:44:36 +00:00
|
|
|
|
2021-10-31 04:11:10 +00:00
|
|
|
Item {
|
|
|
|
|
id: root
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2022-02-13 04:23:57 +00:00
|
|
|
property bool shadow: false
|
2021-10-31 04:11:10 +00:00
|
|
|
property color backgroundColor
|
|
|
|
|
property var foregroundColorGroup
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2021-10-31 04:11:10 +00:00
|
|
|
property NavigationPanelAction leftAction
|
|
|
|
|
property NavigationPanelAction middleAction
|
|
|
|
|
property NavigationPanelAction rightAction
|
2024-07-27 03:47:44 +00:00
|
|
|
|
2022-09-10 02:32:04 +00:00
|
|
|
property NavigationPanelAction leftCornerAction
|
|
|
|
|
property NavigationPanelAction rightCornerAction
|
2023-05-13 02:07:48 +00:00
|
|
|
|
panels: Add support for defining device specific panel tweaks
This adds support for specifying options needed to deal with phone
display panel pecularities (ex. screen curves, notches, punch holes)
This is implemented as settings in ~/.config/plasmamobilerc, which can
set panel heights, paddings, and center spacings to duck display
cutouts. The pixel values are scaling independent, and so are not
affected when the display scaling is changed.
This is then exposed over DBus, so that components from outside of
plasmashell (ex. KWin) can access it easily without needing to connect to
kscreen themselves. Each screen is exposed as a single object.
Currently support is only added in the status bar and the navigation
panel.
Currently all screens have the settings applied. In the future, we may
want to limit this just to the internal screen (?)
---
This also adds a "devices" folder (in `devices/configs`) where per-device configs can be set.
This is installed to `/usr/share/plasma-mobile-device-configs`.
In `plasmamobilerc` (installed to `/etc/xdg/plasmamobilerc`, or
`~/.config/plasmamobilerc`), envmanager will read:
```toml
[Device]
device=oneplus-enchilada
```
for the device config to use and write its settings to
`~/.config/plasma-mobile/plasmamobilerc`.
2025-10-05 23:06:52 +00:00
|
|
|
property real leftPadding: 0
|
|
|
|
|
property real rightPadding: 0
|
|
|
|
|
|
2023-11-23 04:48:22 +00:00
|
|
|
property bool isVertical: false
|
|
|
|
|
|
2026-04-08 17:07:37 +00:00
|
|
|
// Convergence mode: show running-app task strip
|
|
|
|
|
property bool convergenceMode: false
|
|
|
|
|
property var taskModel: null
|
2026-04-08 18:12:38 +00:00
|
|
|
property var virtualDesktopInfo: null
|
2026-04-08 17:07:37 +00:00
|
|
|
|
2023-05-13 02:07:48 +00:00
|
|
|
// drop shadow for icons
|
|
|
|
|
MultiEffect {
|
panels: Add support for defining device specific panel tweaks
This adds support for specifying options needed to deal with phone
display panel pecularities (ex. screen curves, notches, punch holes)
This is implemented as settings in ~/.config/plasmamobilerc, which can
set panel heights, paddings, and center spacings to duck display
cutouts. The pixel values are scaling independent, and so are not
affected when the display scaling is changed.
This is then exposed over DBus, so that components from outside of
plasmashell (ex. KWin) can access it easily without needing to connect to
kscreen themselves. Each screen is exposed as a single object.
Currently support is only added in the status bar and the navigation
panel.
Currently all screens have the settings applied. In the future, we may
want to limit this just to the internal screen (?)
---
This also adds a "devices" folder (in `devices/configs`) where per-device configs can be set.
This is installed to `/usr/share/plasma-mobile-device-configs`.
In `plasmamobilerc` (installed to `/etc/xdg/plasmamobilerc`, or
`~/.config/plasmamobilerc`), envmanager will read:
```toml
[Device]
device=oneplus-enchilada
```
for the device config to use and write its settings to
`~/.config/plasma-mobile/plasmamobilerc`.
2025-10-05 23:06:52 +00:00
|
|
|
anchors.fill: icons
|
2022-02-13 04:23:57 +00:00
|
|
|
visible: shadow
|
2021-10-31 04:11:10 +00:00
|
|
|
source: icons
|
2023-05-13 02:07:48 +00:00
|
|
|
blurMax: 16
|
|
|
|
|
shadowEnabled: true
|
|
|
|
|
shadowVerticalOffset: 1
|
|
|
|
|
shadowOpacity: 0.8
|
2021-10-31 04:11:10 +00:00
|
|
|
}
|
2024-07-27 03:47:44 +00:00
|
|
|
|
panels: Add support for defining device specific panel tweaks
This adds support for specifying options needed to deal with phone
display panel pecularities (ex. screen curves, notches, punch holes)
This is implemented as settings in ~/.config/plasmamobilerc, which can
set panel heights, paddings, and center spacings to duck display
cutouts. The pixel values are scaling independent, and so are not
affected when the display scaling is changed.
This is then exposed over DBus, so that components from outside of
plasmashell (ex. KWin) can access it easily without needing to connect to
kscreen themselves. Each screen is exposed as a single object.
Currently support is only added in the status bar and the navigation
panel.
Currently all screens have the settings applied. In the future, we may
want to limit this just to the internal screen (?)
---
This also adds a "devices" folder (in `devices/configs`) where per-device configs can be set.
This is installed to `/usr/share/plasma-mobile-device-configs`.
In `plasmamobilerc` (installed to `/etc/xdg/plasmamobilerc`, or
`~/.config/plasmamobilerc`), envmanager will read:
```toml
[Device]
device=oneplus-enchilada
```
for the device config to use and write its settings to
`~/.config/plasma-mobile/plasmamobilerc`.
2025-10-05 23:06:52 +00:00
|
|
|
// background colour
|
|
|
|
|
Rectangle {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
color: root.backgroundColor
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-18 07:02:01 +00:00
|
|
|
Item {
|
|
|
|
|
id: icons
|
|
|
|
|
anchors.fill: parent
|
2021-10-31 04:11:10 +00:00
|
|
|
|
2023-03-18 07:02:01 +00:00
|
|
|
property real buttonLength: 0
|
2021-10-31 04:11:10 +00:00
|
|
|
|
2024-11-08 07:52:45 +00:00
|
|
|
NavigationPanelButton {
|
|
|
|
|
id: leftCornerButton
|
|
|
|
|
visible: root.leftCornerAction.visible
|
|
|
|
|
Kirigami.Theme.colorSet: root.foregroundColorGroup
|
|
|
|
|
Kirigami.Theme.inherit: false
|
|
|
|
|
enabled: root.leftCornerAction.enabled
|
panels: Add support for defining device specific panel tweaks
This adds support for specifying options needed to deal with phone
display panel pecularities (ex. screen curves, notches, punch holes)
This is implemented as settings in ~/.config/plasmamobilerc, which can
set panel heights, paddings, and center spacings to duck display
cutouts. The pixel values are scaling independent, and so are not
affected when the display scaling is changed.
This is then exposed over DBus, so that components from outside of
plasmashell (ex. KWin) can access it easily without needing to connect to
kscreen themselves. Each screen is exposed as a single object.
Currently support is only added in the status bar and the navigation
panel.
Currently all screens have the settings applied. In the future, we may
want to limit this just to the internal screen (?)
---
This also adds a "devices" folder (in `devices/configs`) where per-device configs can be set.
This is installed to `/usr/share/plasma-mobile-device-configs`.
In `plasmamobilerc` (installed to `/etc/xdg/plasmamobilerc`, or
`~/.config/plasmamobilerc`), envmanager will read:
```toml
[Device]
device=oneplus-enchilada
```
for the device config to use and write its settings to
`~/.config/plasma-mobile/plasmamobilerc`.
2025-10-05 23:06:52 +00:00
|
|
|
shrinkSize: root.leftCornerAction.shrinkSize
|
2024-11-08 07:52:45 +00:00
|
|
|
iconSource: root.leftCornerAction.iconSource
|
|
|
|
|
onClicked: {
|
|
|
|
|
if (enabled) {
|
|
|
|
|
root.leftCornerAction.triggered();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-18 07:02:01 +00:00
|
|
|
// button row (anchors provided by state)
|
|
|
|
|
NavigationPanelButton {
|
|
|
|
|
id: leftButton
|
|
|
|
|
visible: root.leftAction.visible
|
2023-09-05 16:18:47 +00:00
|
|
|
Kirigami.Theme.colorSet: root.foregroundColorGroup
|
|
|
|
|
Kirigami.Theme.inherit: false
|
2023-03-18 07:02:01 +00:00
|
|
|
enabled: root.leftAction.enabled
|
panels: Add support for defining device specific panel tweaks
This adds support for specifying options needed to deal with phone
display panel pecularities (ex. screen curves, notches, punch holes)
This is implemented as settings in ~/.config/plasmamobilerc, which can
set panel heights, paddings, and center spacings to duck display
cutouts. The pixel values are scaling independent, and so are not
affected when the display scaling is changed.
This is then exposed over DBus, so that components from outside of
plasmashell (ex. KWin) can access it easily without needing to connect to
kscreen themselves. Each screen is exposed as a single object.
Currently support is only added in the status bar and the navigation
panel.
Currently all screens have the settings applied. In the future, we may
want to limit this just to the internal screen (?)
---
This also adds a "devices" folder (in `devices/configs`) where per-device configs can be set.
This is installed to `/usr/share/plasma-mobile-device-configs`.
In `plasmamobilerc` (installed to `/etc/xdg/plasmamobilerc`, or
`~/.config/plasmamobilerc`), envmanager will read:
```toml
[Device]
device=oneplus-enchilada
```
for the device config to use and write its settings to
`~/.config/plasma-mobile/plasmamobilerc`.
2025-10-05 23:06:52 +00:00
|
|
|
shrinkSize: root.leftAction.shrinkSize
|
2023-03-18 07:02:01 +00:00
|
|
|
iconSource: root.leftAction.iconSource
|
|
|
|
|
onClicked: {
|
|
|
|
|
if (enabled) {
|
|
|
|
|
root.leftAction.triggered();
|
2021-10-31 04:11:10 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-18 07:02:01 +00:00
|
|
|
NavigationPanelButton {
|
|
|
|
|
id: middleButton
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
visible: root.middleAction.visible
|
2023-09-05 16:18:47 +00:00
|
|
|
Kirigami.Theme.colorSet: root.foregroundColorGroup
|
|
|
|
|
Kirigami.Theme.inherit: false
|
2023-03-18 07:02:01 +00:00
|
|
|
enabled: root.middleAction.enabled
|
panels: Add support for defining device specific panel tweaks
This adds support for specifying options needed to deal with phone
display panel pecularities (ex. screen curves, notches, punch holes)
This is implemented as settings in ~/.config/plasmamobilerc, which can
set panel heights, paddings, and center spacings to duck display
cutouts. The pixel values are scaling independent, and so are not
affected when the display scaling is changed.
This is then exposed over DBus, so that components from outside of
plasmashell (ex. KWin) can access it easily without needing to connect to
kscreen themselves. Each screen is exposed as a single object.
Currently support is only added in the status bar and the navigation
panel.
Currently all screens have the settings applied. In the future, we may
want to limit this just to the internal screen (?)
---
This also adds a "devices" folder (in `devices/configs`) where per-device configs can be set.
This is installed to `/usr/share/plasma-mobile-device-configs`.
In `plasmamobilerc` (installed to `/etc/xdg/plasmamobilerc`, or
`~/.config/plasmamobilerc`), envmanager will read:
```toml
[Device]
device=oneplus-enchilada
```
for the device config to use and write its settings to
`~/.config/plasma-mobile/plasmamobilerc`.
2025-10-05 23:06:52 +00:00
|
|
|
shrinkSize: root.middleAction.shrinkSize
|
2023-03-18 07:02:01 +00:00
|
|
|
iconSource: root.middleAction.iconSource
|
|
|
|
|
onClicked: {
|
|
|
|
|
if (enabled) {
|
|
|
|
|
root.middleAction.triggered();
|
2021-10-31 04:11:10 +00:00
|
|
|
}
|
|
|
|
|
}
|
2023-03-18 07:02:01 +00:00
|
|
|
}
|
2021-10-31 04:11:10 +00:00
|
|
|
|
2023-03-18 07:02:01 +00:00
|
|
|
NavigationPanelButton {
|
|
|
|
|
id: rightButton
|
|
|
|
|
visible: root.rightAction.visible
|
2023-09-05 16:18:47 +00:00
|
|
|
Kirigami.Theme.colorSet: root.foregroundColorGroup
|
|
|
|
|
Kirigami.Theme.inherit: false
|
2023-03-18 07:02:01 +00:00
|
|
|
enabled: root.rightAction.enabled
|
panels: Add support for defining device specific panel tweaks
This adds support for specifying options needed to deal with phone
display panel pecularities (ex. screen curves, notches, punch holes)
This is implemented as settings in ~/.config/plasmamobilerc, which can
set panel heights, paddings, and center spacings to duck display
cutouts. The pixel values are scaling independent, and so are not
affected when the display scaling is changed.
This is then exposed over DBus, so that components from outside of
plasmashell (ex. KWin) can access it easily without needing to connect to
kscreen themselves. Each screen is exposed as a single object.
Currently support is only added in the status bar and the navigation
panel.
Currently all screens have the settings applied. In the future, we may
want to limit this just to the internal screen (?)
---
This also adds a "devices" folder (in `devices/configs`) where per-device configs can be set.
This is installed to `/usr/share/plasma-mobile-device-configs`.
In `plasmamobilerc` (installed to `/etc/xdg/plasmamobilerc`, or
`~/.config/plasmamobilerc`), envmanager will read:
```toml
[Device]
device=oneplus-enchilada
```
for the device config to use and write its settings to
`~/.config/plasma-mobile/plasmamobilerc`.
2025-10-05 23:06:52 +00:00
|
|
|
shrinkSize: root.rightAction.shrinkSize
|
2023-03-18 07:02:01 +00:00
|
|
|
iconSource: root.rightAction.iconSource
|
|
|
|
|
onClicked: {
|
|
|
|
|
if (enabled) {
|
|
|
|
|
root.rightAction.triggered();
|
2021-10-31 04:11:10 +00:00
|
|
|
}
|
|
|
|
|
}
|
2023-03-18 07:02:01 +00:00
|
|
|
}
|
2021-10-31 04:11:10 +00:00
|
|
|
|
2023-03-18 07:02:01 +00:00
|
|
|
NavigationPanelButton {
|
|
|
|
|
id: rightCornerButton
|
|
|
|
|
visible: root.rightCornerAction.visible
|
2023-09-05 16:18:47 +00:00
|
|
|
Kirigami.Theme.colorSet: root.foregroundColorGroup
|
|
|
|
|
Kirigami.Theme.inherit: false
|
2023-03-18 07:02:01 +00:00
|
|
|
enabled: root.rightCornerAction.enabled
|
panels: Add support for defining device specific panel tweaks
This adds support for specifying options needed to deal with phone
display panel pecularities (ex. screen curves, notches, punch holes)
This is implemented as settings in ~/.config/plasmamobilerc, which can
set panel heights, paddings, and center spacings to duck display
cutouts. The pixel values are scaling independent, and so are not
affected when the display scaling is changed.
This is then exposed over DBus, so that components from outside of
plasmashell (ex. KWin) can access it easily without needing to connect to
kscreen themselves. Each screen is exposed as a single object.
Currently support is only added in the status bar and the navigation
panel.
Currently all screens have the settings applied. In the future, we may
want to limit this just to the internal screen (?)
---
This also adds a "devices" folder (in `devices/configs`) where per-device configs can be set.
This is installed to `/usr/share/plasma-mobile-device-configs`.
In `plasmamobilerc` (installed to `/etc/xdg/plasmamobilerc`, or
`~/.config/plasmamobilerc`), envmanager will read:
```toml
[Device]
device=oneplus-enchilada
```
for the device config to use and write its settings to
`~/.config/plasma-mobile/plasmamobilerc`.
2025-10-05 23:06:52 +00:00
|
|
|
shrinkSize: root.rightCornerAction.shrinkSize
|
2023-03-18 07:02:01 +00:00
|
|
|
iconSource: root.rightCornerAction.iconSource
|
|
|
|
|
onClicked: {
|
|
|
|
|
if (enabled) {
|
|
|
|
|
root.rightCornerAction.triggered();
|
2022-09-10 02:32:04 +00:00
|
|
|
}
|
|
|
|
|
}
|
2021-10-31 04:11:10 +00:00
|
|
|
}
|
2026-04-08 17:07:37 +00:00
|
|
|
|
|
|
|
|
// Running-app task strip for convergence (desktop) mode
|
2026-04-09 08:15:14 +00:00
|
|
|
// NOTE: Disabled — running apps now shown in FavouritesBar dock
|
2026-04-08 17:07:37 +00:00
|
|
|
ListView {
|
|
|
|
|
id: taskStrip
|
2026-04-09 08:15:14 +00:00
|
|
|
visible: false
|
2026-04-08 17:07:37 +00:00
|
|
|
orientation: root.isVertical ? ListView.Vertical : ListView.Horizontal
|
|
|
|
|
spacing: Kirigami.Units.smallSpacing
|
|
|
|
|
clip: true
|
|
|
|
|
interactive: contentWidth > width
|
|
|
|
|
model: root.taskModel
|
|
|
|
|
|
|
|
|
|
delegate: NavigationPanelButton {
|
|
|
|
|
id: taskDelegate
|
|
|
|
|
required property int index
|
|
|
|
|
required property var model
|
|
|
|
|
width: taskStrip.orientation === ListView.Horizontal ? height : taskStrip.width
|
|
|
|
|
height: taskStrip.orientation === ListView.Horizontal ? taskStrip.height : taskStrip.width
|
|
|
|
|
|
|
|
|
|
Kirigami.Theme.colorSet: root.foregroundColorGroup
|
|
|
|
|
Kirigami.Theme.inherit: false
|
|
|
|
|
iconSource: taskDelegate.model.decoration
|
|
|
|
|
enabled: true
|
|
|
|
|
shrinkSize: 0
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
root.taskModel.requestActivate(root.taskModel.makeModelIndex(taskDelegate.index));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Right-click context menu
|
|
|
|
|
MouseArea {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
acceptedButtons: Qt.RightButton
|
|
|
|
|
onClicked: taskContextMenu.popup()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Controls.Menu {
|
|
|
|
|
id: taskContextMenu
|
2026-04-08 18:12:38 +00:00
|
|
|
Controls.MenuItem {
|
|
|
|
|
text: taskDelegate.model.IsMinimized ? i18n("Restore") : i18n("Minimize")
|
|
|
|
|
icon.name: taskDelegate.model.IsMinimized ? "window-restore" : "window-minimize"
|
|
|
|
|
onTriggered: root.taskModel.requestToggleMinimized(root.taskModel.makeModelIndex(taskDelegate.index))
|
|
|
|
|
}
|
|
|
|
|
Controls.MenuItem {
|
|
|
|
|
text: taskDelegate.model.IsMaximized ? i18n("Restore") : i18n("Maximize")
|
|
|
|
|
icon.name: taskDelegate.model.IsMaximized ? "window-restore" : "window-maximize"
|
|
|
|
|
onTriggered: root.taskModel.requestToggleMaximized(root.taskModel.makeModelIndex(taskDelegate.index))
|
|
|
|
|
}
|
|
|
|
|
Controls.MenuSeparator {}
|
2026-04-08 17:07:37 +00:00
|
|
|
Controls.MenuItem {
|
|
|
|
|
text: i18n("Close")
|
|
|
|
|
icon.name: "window-close"
|
|
|
|
|
onTriggered: root.taskModel.requestClose(root.taskModel.makeModelIndex(taskDelegate.index))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Active-window indicator dot
|
|
|
|
|
Rectangle {
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
anchors.bottomMargin: Kirigami.Units.smallSpacing / 2
|
|
|
|
|
width: Kirigami.Units.smallSpacing * 2
|
|
|
|
|
height: width
|
|
|
|
|
radius: width / 2
|
|
|
|
|
color: Kirigami.Theme.highlightColor
|
|
|
|
|
visible: taskDelegate.model.IsActive === true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-08 18:12:38 +00:00
|
|
|
|
|
|
|
|
// Virtual desktop switcher (convergence mode, multiple desktops)
|
|
|
|
|
Row {
|
|
|
|
|
id: workspaceIndicator
|
|
|
|
|
visible: root.convergenceMode && root.virtualDesktopInfo !== null && root.virtualDesktopInfo.numberOfDesktops > 1
|
|
|
|
|
spacing: Kirigami.Units.smallSpacing / 2
|
|
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
|
model: root.virtualDesktopInfo ? root.virtualDesktopInfo.desktopIds : []
|
|
|
|
|
|
|
|
|
|
delegate: Rectangle {
|
|
|
|
|
required property int index
|
|
|
|
|
required property var modelData
|
|
|
|
|
width: Kirigami.Units.gridUnit * 1.5
|
|
|
|
|
height: width
|
|
|
|
|
radius: Kirigami.Units.smallSpacing
|
|
|
|
|
|
|
|
|
|
color: modelData === root.virtualDesktopInfo.currentDesktop
|
|
|
|
|
? Kirigami.Theme.highlightColor
|
|
|
|
|
: Qt.rgba(Kirigami.Theme.textColor.r, Kirigami.Theme.textColor.g, Kirigami.Theme.textColor.b, 0.2)
|
|
|
|
|
|
|
|
|
|
Text {
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
text: index + 1
|
|
|
|
|
color: parent.modelData === root.virtualDesktopInfo.currentDesktop
|
|
|
|
|
? Kirigami.Theme.highlightedTextColor
|
|
|
|
|
: Kirigami.Theme.textColor
|
|
|
|
|
font.pixelSize: parent.height * 0.6
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
onClicked: root.virtualDesktopInfo.requestActivate(parent.modelData)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-10-31 04:11:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
states: [
|
|
|
|
|
State {
|
2023-11-23 04:48:22 +00:00
|
|
|
name: "vertical"
|
|
|
|
|
when: root.isVertical
|
2021-10-31 04:11:10 +00:00
|
|
|
PropertyChanges {
|
|
|
|
|
target: icons
|
panels: Add support for defining device specific panel tweaks
This adds support for specifying options needed to deal with phone
display panel pecularities (ex. screen curves, notches, punch holes)
This is implemented as settings in ~/.config/plasmamobilerc, which can
set panel heights, paddings, and center spacings to duck display
cutouts. The pixel values are scaling independent, and so are not
affected when the display scaling is changed.
This is then exposed over DBus, so that components from outside of
plasmashell (ex. KWin) can access it easily without needing to connect to
kscreen themselves. Each screen is exposed as a single object.
Currently support is only added in the status bar and the navigation
panel.
Currently all screens have the settings applied. In the future, we may
want to limit this just to the internal screen (?)
---
This also adds a "devices" folder (in `devices/configs`) where per-device configs can be set.
This is installed to `/usr/share/plasma-mobile-device-configs`.
In `plasmamobilerc` (installed to `/etc/xdg/plasmamobilerc`, or
`~/.config/plasmamobilerc`), envmanager will read:
```toml
[Device]
device=oneplus-enchilada
```
for the device config to use and write its settings to
`~/.config/plasma-mobile/plasmamobilerc`.
2025-10-05 23:06:52 +00:00
|
|
|
anchors {
|
|
|
|
|
topMargin: root.leftPadding
|
|
|
|
|
bottomMargin: root.rightPadding
|
|
|
|
|
}
|
2023-07-25 01:13:52 +00:00
|
|
|
buttonLength: Math.min(Kirigami.Units.gridUnit * 10, icons.height * 0.7 / 3)
|
2021-10-31 04:11:10 +00:00
|
|
|
}
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: leftButton
|
|
|
|
|
anchors {
|
|
|
|
|
horizontalCenter: parent.horizontalCenter
|
2022-06-27 21:28:41 +00:00
|
|
|
top: middleButton.bottom
|
2021-10-31 04:11:10 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: leftButton
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: icons.buttonLength
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: middleButton
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: icons.buttonLength
|
|
|
|
|
}
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: rightButton
|
|
|
|
|
anchors {
|
|
|
|
|
horizontalCenter: parent.horizontalCenter
|
2022-06-27 21:28:41 +00:00
|
|
|
bottom: middleButton.top
|
2021-10-31 04:11:10 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: rightButton
|
|
|
|
|
height: icons.buttonLength
|
|
|
|
|
width: icons.width
|
|
|
|
|
}
|
2022-09-10 02:32:04 +00:00
|
|
|
AnchorChanges {
|
|
|
|
|
target: rightCornerButton
|
|
|
|
|
anchors {
|
|
|
|
|
horizontalCenter: parent.horizontalCenter
|
|
|
|
|
top: parent.top
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: rightCornerButton
|
2023-07-25 01:13:52 +00:00
|
|
|
height: Kirigami.Units.gridUnit * 2
|
2022-09-10 02:32:04 +00:00
|
|
|
width: icons.width
|
|
|
|
|
}
|
2024-11-08 07:52:45 +00:00
|
|
|
AnchorChanges {
|
|
|
|
|
target: leftCornerButton
|
|
|
|
|
anchors {
|
|
|
|
|
horizontalCenter: parent.horizontalCenter
|
|
|
|
|
bottom: parent.bottom
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: leftCornerButton
|
|
|
|
|
height: Kirigami.Units.gridUnit * 2
|
|
|
|
|
width: icons.width
|
|
|
|
|
}
|
2026-04-08 17:07:37 +00:00
|
|
|
// Task strip: vertical layout — positioned between leftCornerButton (bottom) and leftButton (above middle)
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: taskStrip
|
|
|
|
|
anchors {
|
|
|
|
|
horizontalCenter: parent.horizontalCenter
|
|
|
|
|
bottom: leftButton.top
|
|
|
|
|
top: undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: taskStrip
|
|
|
|
|
width: parent.width
|
|
|
|
|
// Fill space between leftCorner (bottom) and the nav button group
|
|
|
|
|
height: taskStrip.visible ? (leftButton.y - leftCornerButton.y - leftCornerButton.height - Kirigami.Units.smallSpacing * 2) : 0
|
|
|
|
|
}
|
2026-04-08 18:12:38 +00:00
|
|
|
// Workspace indicator: vertical — above rightCornerButton (top)
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: workspaceIndicator
|
|
|
|
|
anchors {
|
|
|
|
|
horizontalCenter: parent.horizontalCenter
|
|
|
|
|
top: rightCornerButton.bottom
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-09 08:15:14 +00:00
|
|
|
}, State {
|
|
|
|
|
name: "convergence-horizontal"
|
|
|
|
|
when: !root.isVertical && root.convergenceMode
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: icons
|
|
|
|
|
anchors {
|
|
|
|
|
leftMargin: root.leftPadding
|
|
|
|
|
rightMargin: root.rightPadding
|
|
|
|
|
}
|
|
|
|
|
buttonLength: Math.min(Kirigami.Units.gridUnit * 8, icons.width * 0.7 / 3)
|
|
|
|
|
}
|
|
|
|
|
// Home button: far left
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: middleButton
|
|
|
|
|
anchors {
|
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
|
left: parent.left
|
|
|
|
|
right: undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: middleButton
|
|
|
|
|
height: parent.height
|
|
|
|
|
width: icons.buttonLength
|
|
|
|
|
anchors.centerIn: undefined
|
|
|
|
|
}
|
|
|
|
|
// Overview button: far right
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: leftButton
|
|
|
|
|
anchors {
|
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
|
right: parent.right
|
|
|
|
|
left: undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: leftButton
|
|
|
|
|
height: parent.height
|
|
|
|
|
width: icons.buttonLength
|
|
|
|
|
}
|
|
|
|
|
// Hide close button (already not visible via action)
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: rightButton
|
|
|
|
|
height: parent.height
|
|
|
|
|
width: 0
|
|
|
|
|
visible: false
|
|
|
|
|
}
|
|
|
|
|
// Hide corner buttons in convergence
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: leftCornerButton
|
|
|
|
|
width: 0
|
|
|
|
|
visible: false
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: rightCornerButton
|
|
|
|
|
width: 0
|
|
|
|
|
visible: false
|
|
|
|
|
}
|
|
|
|
|
// Workspace indicator: left of Overview button
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: workspaceIndicator
|
|
|
|
|
anchors {
|
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
|
right: leftButton.left
|
|
|
|
|
left: undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Task strip hidden
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: taskStrip
|
|
|
|
|
height: 0
|
|
|
|
|
visible: false
|
|
|
|
|
}
|
2021-10-31 04:11:10 +00:00
|
|
|
}, State {
|
2023-11-23 04:48:22 +00:00
|
|
|
name: "horizontal"
|
|
|
|
|
when: !root.isVertical
|
2021-10-31 04:11:10 +00:00
|
|
|
PropertyChanges {
|
|
|
|
|
target: icons
|
panels: Add support for defining device specific panel tweaks
This adds support for specifying options needed to deal with phone
display panel pecularities (ex. screen curves, notches, punch holes)
This is implemented as settings in ~/.config/plasmamobilerc, which can
set panel heights, paddings, and center spacings to duck display
cutouts. The pixel values are scaling independent, and so are not
affected when the display scaling is changed.
This is then exposed over DBus, so that components from outside of
plasmashell (ex. KWin) can access it easily without needing to connect to
kscreen themselves. Each screen is exposed as a single object.
Currently support is only added in the status bar and the navigation
panel.
Currently all screens have the settings applied. In the future, we may
want to limit this just to the internal screen (?)
---
This also adds a "devices" folder (in `devices/configs`) where per-device configs can be set.
This is installed to `/usr/share/plasma-mobile-device-configs`.
In `plasmamobilerc` (installed to `/etc/xdg/plasmamobilerc`, or
`~/.config/plasmamobilerc`), envmanager will read:
```toml
[Device]
device=oneplus-enchilada
```
for the device config to use and write its settings to
`~/.config/plasma-mobile/plasmamobilerc`.
2025-10-05 23:06:52 +00:00
|
|
|
anchors {
|
|
|
|
|
leftMargin: root.leftPadding
|
|
|
|
|
rightMargin: root.rightPadding
|
|
|
|
|
}
|
2023-07-25 01:13:52 +00:00
|
|
|
buttonLength: Math.min(Kirigami.Units.gridUnit * 8, icons.width * 0.7 / 3)
|
2021-10-31 04:11:10 +00:00
|
|
|
}
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: leftButton
|
|
|
|
|
anchors {
|
|
|
|
|
verticalCenter: parent.verticalCenter
|
2022-06-27 21:28:41 +00:00
|
|
|
right: middleButton.left
|
2021-10-31 04:11:10 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: leftButton
|
|
|
|
|
height: parent.height
|
|
|
|
|
width: icons.buttonLength
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: middleButton
|
|
|
|
|
height: parent.height
|
|
|
|
|
width: icons.buttonLength
|
|
|
|
|
}
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: rightButton
|
|
|
|
|
anchors {
|
|
|
|
|
verticalCenter: parent.verticalCenter
|
2022-06-27 21:28:41 +00:00
|
|
|
left: middleButton.right
|
2021-10-31 04:11:10 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: rightButton
|
|
|
|
|
height: parent.height
|
|
|
|
|
width: icons.buttonLength
|
|
|
|
|
}
|
2022-09-10 02:32:04 +00:00
|
|
|
AnchorChanges {
|
|
|
|
|
target: rightCornerButton
|
|
|
|
|
anchors {
|
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
|
right: parent.right
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: rightCornerButton
|
|
|
|
|
height: parent.height
|
2023-07-25 01:13:52 +00:00
|
|
|
width: Kirigami.Units.gridUnit * 2
|
2022-09-10 02:32:04 +00:00
|
|
|
}
|
2024-11-08 07:52:45 +00:00
|
|
|
AnchorChanges {
|
|
|
|
|
target: leftCornerButton
|
|
|
|
|
anchors {
|
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
|
left: parent.left
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: leftCornerButton
|
|
|
|
|
height: parent.height
|
|
|
|
|
width: Kirigami.Units.gridUnit * 2
|
|
|
|
|
}
|
2026-04-08 17:07:37 +00:00
|
|
|
// Task strip: horizontal layout — positioned between leftCornerButton (left) and leftButton (near center)
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: taskStrip
|
|
|
|
|
anchors {
|
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
|
left: leftCornerButton.right
|
|
|
|
|
right: leftButton.left
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: taskStrip
|
|
|
|
|
height: parent.height
|
|
|
|
|
}
|
2026-04-08 18:12:38 +00:00
|
|
|
// Workspace indicator: horizontal — between rightButton and rightCornerButton
|
|
|
|
|
AnchorChanges {
|
|
|
|
|
target: workspaceIndicator
|
|
|
|
|
anchors {
|
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
|
left: rightButton.right
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-10-31 04:11:10 +00:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|