2023-10-22 03:59:27 +00:00
|
|
|
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
|
|
|
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
|
|
|
|
|
|
import QtQuick 2.12
|
|
|
|
|
import QtQuick.Window 2.12
|
|
|
|
|
import QtQuick.Layouts 1.1
|
|
|
|
|
|
|
|
|
|
import org.kde.plasma.components 3.0 as PC3
|
2023-11-02 11:08:17 +00:00
|
|
|
import org.kde.plasma.private.mobileshell.state as MobileShellState
|
2026-04-09 08:15:14 +00:00
|
|
|
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
|
|
|
|
import org.kde.taskmanager as TaskManager
|
2025-07-16 17:02:18 +00:00
|
|
|
import plasma.applet.org.kde.plasma.mobile.homescreen.folio as Folio
|
2023-11-02 11:08:17 +00:00
|
|
|
import org.kde.plasma.private.mobileshell as MobileShell
|
2026-03-07 03:08:07 +00:00
|
|
|
import org.kde.kirigami as Kirigami
|
2026-04-09 08:15:14 +00:00
|
|
|
import QtQuick.Controls as Controls
|
2026-04-11 07:42:21 +00:00
|
|
|
import QtQuick.Templates as T
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2024-03-06 14:19:03 +00:00
|
|
|
import "./private"
|
2023-10-22 03:59:27 +00:00
|
|
|
import "./delegate"
|
|
|
|
|
|
2023-10-22 17:55:04 +00:00
|
|
|
MouseArea {
|
2023-10-22 03:59:27 +00:00
|
|
|
id: root
|
2024-06-21 04:42:14 +00:00
|
|
|
property Folio.HomeScreen folio
|
Folio/Halcyon: Expand Background Blur Effect using a MaskLayer
This merge request expands upon the folio and halcyon background blur effects, making the folio background blur include the backgrounds of folder icons, the favorites bar, and wallpaper selector, and for halcyon, it now includes the folder icons, app library, search, and wallpaper selector. To accomplish this, a mask layer plugin was created to easily attach to these elements. This way, we can use a `OpacityMask` to cut out from the existing blur layer, thus hopefully keeping the performance cost low. And with my limited testing, it does at least seems to run about the same on my oneplus 6t, though it is not really a low end device, so I can not fairly judge the impact for something slower (eg. PinePhone). To be on the safe side, a third option was also added to the folio settings, allowing for the ability to toggle back to the old functionality if needed.




2025-06-27 18:27:30 +00:00
|
|
|
property MobileShell.MaskManager maskManager
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
property var homeScreen
|
|
|
|
|
|
|
|
|
|
signal delegateDragRequested(var item)
|
|
|
|
|
|
2026-04-09 08:15:14 +00:00
|
|
|
// Convergence mode: show running apps alongside favourites
|
|
|
|
|
readonly property bool convergenceMode: ShellSettings.Settings.convergenceModeEnabled
|
|
|
|
|
readonly property int totalItemCount: repeater.count + (convergenceMode ? taskRepeater.count : 0)
|
|
|
|
|
|
|
|
|
|
// In convergence mode, size icons to fit the dock bar instead of using page grid cells
|
|
|
|
|
readonly property real dockCellWidth: convergenceMode ? root.height : folio.HomeScreenState.pageCellWidth
|
|
|
|
|
readonly property real dockCellHeight: convergenceMode ? root.height : folio.HomeScreenState.pageCellHeight
|
|
|
|
|
|
|
|
|
|
// Navigation buttons width (used to offset center positioning)
|
|
|
|
|
readonly property real navButtonWidth: convergenceMode ? root.height : 0
|
|
|
|
|
|
|
|
|
|
// Center x for dock items (offset between nav buttons in convergence mode)
|
|
|
|
|
readonly property real dockCenterX: convergenceMode
|
|
|
|
|
? navButtonWidth + (root.width - 2 * navButtonWidth) / 2
|
|
|
|
|
: root.width / 2
|
|
|
|
|
|
2026-04-13 07:39:19 +00:00
|
|
|
// Visible spacer between pinned favourites and running tasks
|
|
|
|
|
readonly property bool showSpacer: convergenceMode && repeater.count > 0 && taskRepeater.count > 0
|
|
|
|
|
property real spacerWidth: showSpacer ? Kirigami.Units.largeSpacing * 2 : 0
|
|
|
|
|
Behavior on spacerWidth {
|
|
|
|
|
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad }
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-10 08:23:36 +00:00
|
|
|
// Thumbnail popup hover tracking
|
|
|
|
|
property int hoveredTaskIndex: -1
|
|
|
|
|
|
2026-04-12 12:15:13 +00:00
|
|
|
// Drag-reorder state (convergence mode only)
|
|
|
|
|
property int dragReorderIndex: -1
|
|
|
|
|
property real dragReorderOffset: 0
|
|
|
|
|
readonly property int dragTargetIndex: {
|
|
|
|
|
if (dragReorderIndex === -1) return -1
|
|
|
|
|
let shift = Math.round(dragReorderOffset / dockCellWidth)
|
|
|
|
|
return Math.max(0, Math.min(repeater.count - 1, dragReorderIndex + shift))
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-13 10:32:54 +00:00
|
|
|
// Drag-to-pin state for running tasks in convergence mode.
|
|
|
|
|
property int taskPinDragIndex: -1
|
|
|
|
|
property real taskPinDragOffset: 0
|
|
|
|
|
property int taskPinTargetIndex: -1
|
|
|
|
|
property string taskPinStorageId: ""
|
|
|
|
|
readonly property bool taskPinCanDrop: taskPinTargetIndex !== -1 && taskPinStorageId !== ""
|
|
|
|
|
|
|
|
|
|
function runningTaskStorageId(taskModel) {
|
|
|
|
|
var id = taskModel ? taskModel.AppId || "" : ""
|
|
|
|
|
if (id && !id.endsWith(".desktop"))
|
|
|
|
|
id += ".desktop"
|
|
|
|
|
return id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function favouriteBaseX(index) {
|
|
|
|
|
return index * root.dockCellWidth - (root.totalItemCount / 2) * root.dockCellWidth + root.dockCenterX - root.spacerWidth / 2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function taskBaseX(index) {
|
|
|
|
|
return (repeater.count + index) * root.dockCellWidth - (root.totalItemCount / 2) * root.dockCellWidth + root.dockCenterX + root.spacerWidth / 2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function clearTaskPinDrag() {
|
|
|
|
|
root.taskPinDragIndex = -1
|
|
|
|
|
root.taskPinDragOffset = 0
|
|
|
|
|
root.taskPinTargetIndex = -1
|
|
|
|
|
root.taskPinStorageId = ""
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function updateTaskPinTarget() {
|
|
|
|
|
if (root.taskPinDragIndex === -1 || root.taskPinStorageId === "" || folio.FolioSettings.lockLayout || folio.FavouritesModel.containsApplication(root.taskPinStorageId)) {
|
|
|
|
|
root.taskPinTargetIndex = -1
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var draggedCenterX = root.taskBaseX(root.taskPinDragIndex) + root.dockCellWidth / 2 + root.taskPinDragOffset
|
|
|
|
|
var firstTaskCenterX = root.taskBaseX(0) + root.dockCellWidth / 2
|
|
|
|
|
|
|
|
|
|
if (draggedCenterX >= firstTaskCenterX) {
|
|
|
|
|
root.taskPinTargetIndex = -1
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (repeater.count === 0) {
|
|
|
|
|
root.taskPinTargetIndex = 0
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (let index = 0; index < repeater.count; ++index) {
|
|
|
|
|
let favouriteCenterX = root.favouriteBaseX(index) + root.dockCellWidth / 2
|
|
|
|
|
if (draggedCenterX < favouriteCenterX) {
|
|
|
|
|
root.taskPinTargetIndex = index
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
root.taskPinTargetIndex = repeater.count
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-09 08:15:14 +00:00
|
|
|
// Home button (convergence mode, left end)
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: homeButton
|
|
|
|
|
visible: root.convergenceMode
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
width: root.navButtonWidth
|
2026-04-09 09:09:15 +00:00
|
|
|
color: homeMouseArea.containsPress
|
|
|
|
|
? Qt.rgba(255, 255, 255, 0.2)
|
|
|
|
|
: (homeMouseArea.containsMouse ? Qt.rgba(255, 255, 255, 0.1) : "transparent")
|
|
|
|
|
radius: Kirigami.Units.cornerRadius
|
2026-04-09 08:15:14 +00:00
|
|
|
|
|
|
|
|
Kirigami.Icon {
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
width: Math.min(parent.width, parent.height) * 0.75
|
|
|
|
|
height: width
|
|
|
|
|
source: "start-here-kde"
|
2026-04-09 09:09:15 +00:00
|
|
|
active: homeMouseArea.containsMouse
|
2026-04-09 08:15:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MouseArea {
|
2026-04-09 09:09:15 +00:00
|
|
|
id: homeMouseArea
|
2026-04-09 08:15:14 +00:00
|
|
|
anchors.fill: parent
|
2026-04-09 09:09:15 +00:00
|
|
|
hoverEnabled: true
|
2026-04-09 08:15:14 +00:00
|
|
|
onClicked: MobileShellState.ShellDBusClient.openHomeScreen()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Overview button (convergence mode, right end)
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: overviewButton
|
|
|
|
|
visible: root.convergenceMode
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
width: root.navButtonWidth
|
2026-04-09 09:09:15 +00:00
|
|
|
color: overviewMouseArea.containsPress
|
|
|
|
|
? Qt.rgba(255, 255, 255, 0.2)
|
|
|
|
|
: (overviewMouseArea.containsMouse ? Qt.rgba(255, 255, 255, 0.1) : "transparent")
|
|
|
|
|
radius: Kirigami.Units.cornerRadius
|
2026-04-09 08:15:14 +00:00
|
|
|
|
|
|
|
|
Kirigami.Icon {
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
width: Math.min(parent.width, parent.height) * 0.75
|
|
|
|
|
height: width
|
|
|
|
|
source: "view-grid-symbolic"
|
2026-04-09 09:09:15 +00:00
|
|
|
active: overviewMouseArea.containsMouse
|
2026-04-09 08:15:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MouseArea {
|
2026-04-09 09:09:15 +00:00
|
|
|
id: overviewMouseArea
|
2026-04-09 08:15:14 +00:00
|
|
|
anchors.fill: parent
|
2026-04-09 09:09:15 +00:00
|
|
|
hoverEnabled: true
|
2026-04-09 08:15:14 +00:00
|
|
|
onClicked: root.folio.triggerOverview()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TaskManager.VirtualDesktopInfo {
|
|
|
|
|
id: virtualDesktopInfo
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TaskManager.ActivityInfo {
|
|
|
|
|
id: activityInfo
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TaskManager.TasksModel {
|
|
|
|
|
id: tasksModel
|
|
|
|
|
filterByVirtualDesktop: true
|
|
|
|
|
filterByActivity: true
|
|
|
|
|
filterNotMaximized: false
|
|
|
|
|
filterByScreen: true
|
2026-04-10 11:04:04 +00:00
|
|
|
filterHidden: false
|
2026-04-09 08:15:14 +00:00
|
|
|
virtualDesktop: virtualDesktopInfo.currentDesktop
|
|
|
|
|
activity: activityInfo.currentActivity
|
2026-04-11 11:25:01 +00:00
|
|
|
groupMode: TaskManager.TasksModel.GroupApplications
|
2026-04-10 11:32:16 +00:00
|
|
|
}
|
|
|
|
|
|
2026-04-08 17:08:23 +00:00
|
|
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
|
|
|
|
2025-05-01 09:04:38 +00:00
|
|
|
onPressAndHold: {
|
|
|
|
|
folio.HomeScreenState.openSettingsView();
|
|
|
|
|
haptics.buttonVibrate();
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-08 17:08:23 +00:00
|
|
|
onClicked: (mouse) => {
|
|
|
|
|
// Right-click opens settings view (wallpaper/widgets), same as long-press
|
|
|
|
|
if (mouse.button === Qt.RightButton) {
|
|
|
|
|
folio.HomeScreenState.openSettingsView();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-27 04:14:26 +00:00
|
|
|
onDoubleClicked: {
|
|
|
|
|
if (folio.FolioSettings.doubleTapToLock) {
|
|
|
|
|
deviceLock.triggerLock();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-11 20:04:35 +00:00
|
|
|
onActiveFocusChanged: {
|
|
|
|
|
if (activeFocus) {
|
|
|
|
|
// Focus on first delegate when favorites bar focused
|
|
|
|
|
let firstDelegate = repeater.itemAt(0);
|
|
|
|
|
if (!firstDelegate) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
firstDelegate.keyboardFocus();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-01 09:04:38 +00:00
|
|
|
MobileShell.HapticsEffect {
|
|
|
|
|
id: haptics
|
|
|
|
|
}
|
2023-10-22 17:55:04 +00:00
|
|
|
|
2025-06-27 04:14:26 +00:00
|
|
|
MobileShell.DeviceLock {
|
|
|
|
|
id: deviceLock
|
2025-06-25 20:39:36 +00:00
|
|
|
}
|
|
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
Repeater {
|
2024-11-07 05:17:57 +00:00
|
|
|
id: repeater
|
2024-06-21 04:42:14 +00:00
|
|
|
model: folio.FavouritesModel
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
delegate: Item {
|
|
|
|
|
id: delegate
|
|
|
|
|
|
2024-11-07 05:17:57 +00:00
|
|
|
readonly property var delegateModel: model.delegate
|
|
|
|
|
readonly property int index: model.index
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2024-11-07 05:17:57 +00:00
|
|
|
readonly property var dragState: folio.HomeScreenState.dragState
|
|
|
|
|
readonly property bool isDropPositionThis: dragState.candidateDropPosition.location === Folio.DelegateDragPosition.Favourites &&
|
2025-08-11 20:04:35 +00:00
|
|
|
dragState.candidateDropPosition.favouritesPosition === delegate.index
|
2025-12-12 05:33:25 +00:00
|
|
|
readonly property bool isAppHoveredOver: folio.HomeScreenState.isDraggingDelegate &&
|
2025-08-11 20:04:35 +00:00
|
|
|
dragState.dropDelegate &&
|
|
|
|
|
dragState.dropDelegate.type === Folio.FolioDelegate.Application &&
|
|
|
|
|
isDropPositionThis
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2024-11-07 05:17:57 +00:00
|
|
|
readonly property bool isLocationBottom: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Bottom
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2024-11-07 05:17:57 +00:00
|
|
|
// get the normalized index position value from the center so we can animate it
|
2026-04-09 08:15:14 +00:00
|
|
|
property double fromCenterValue: model.index - (root.totalItemCount / 2)
|
2024-11-07 05:17:57 +00:00
|
|
|
Behavior on fromCenterValue {
|
2025-09-11 14:13:26 +00:00
|
|
|
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad; }
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
|
2024-11-07 05:17:57 +00:00
|
|
|
// multiply the 'fromCenterValue' by the cell size to get the actual position
|
2026-04-09 08:15:14 +00:00
|
|
|
readonly property int centerPosition: (isLocationBottom ? root.dockCellWidth : root.dockCellHeight) * fromCenterValue
|
2024-11-07 05:17:57 +00:00
|
|
|
|
2026-04-12 12:15:13 +00:00
|
|
|
// Visual shift during drag-reorder: dragged item follows cursor,
|
|
|
|
|
// displaced items slide to make room.
|
|
|
|
|
property real dragVisualShift: {
|
|
|
|
|
if (root.dragReorderIndex === -1) return 0
|
|
|
|
|
if (delegate.index === root.dragReorderIndex) return root.dragReorderOffset
|
|
|
|
|
let targetIdx = root.dragTargetIndex
|
|
|
|
|
let myIdx = delegate.index
|
|
|
|
|
let dragIdx = root.dragReorderIndex
|
|
|
|
|
let cellW = root.dockCellWidth
|
|
|
|
|
if (targetIdx > dragIdx && myIdx > dragIdx && myIdx <= targetIdx) return -cellW
|
|
|
|
|
if (targetIdx < dragIdx && myIdx >= targetIdx && myIdx < dragIdx) return cellW
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
Behavior on dragVisualShift {
|
|
|
|
|
enabled: root.dragReorderIndex !== -1 && delegate.index !== root.dragReorderIndex
|
|
|
|
|
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad }
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-13 10:32:54 +00:00
|
|
|
property real taskPinVisualShift: root.taskPinCanDrop && delegate.index >= root.taskPinTargetIndex ? root.dockCellWidth : 0
|
|
|
|
|
|
|
|
|
|
x: (isLocationBottom ? root.favouriteBaseX(delegate.index) : (parent.width - width) / 2) + dragVisualShift + taskPinVisualShift
|
2026-04-09 08:15:14 +00:00
|
|
|
y: isLocationBottom ? (parent.height - height) / 2 : parent.height / 2 - centerPosition - root.dockCellHeight
|
2024-11-07 05:17:57 +00:00
|
|
|
|
2026-04-09 08:15:14 +00:00
|
|
|
implicitWidth: root.dockCellWidth
|
|
|
|
|
implicitHeight: root.dockCellHeight
|
|
|
|
|
width: root.dockCellWidth
|
|
|
|
|
height: root.dockCellHeight
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2025-08-11 20:04:35 +00:00
|
|
|
// Keyboard navigation to other delegates
|
|
|
|
|
Keys.onPressed: (event) => {
|
|
|
|
|
switch (event.key) {
|
|
|
|
|
case Qt.Key_Up:
|
|
|
|
|
if (!isLocationBottom) {
|
|
|
|
|
let nextDelegate = repeater.itemAt(delegate.index - 1);
|
|
|
|
|
if (nextDelegate) {
|
|
|
|
|
nextDelegate.keyboardFocus();
|
|
|
|
|
event.accepted = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case Qt.Key_Down:
|
|
|
|
|
if (!isLocationBottom) {
|
|
|
|
|
let nextDelegate = repeater.itemAt(delegate.index + 1);
|
|
|
|
|
if (nextDelegate) {
|
|
|
|
|
nextDelegate.keyboardFocus();
|
|
|
|
|
event.accepted = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case Qt.Key_Left:
|
|
|
|
|
if (isLocationBottom) {
|
|
|
|
|
let nextDelegate = repeater.itemAt(delegate.index - 1);
|
|
|
|
|
if (nextDelegate) {
|
|
|
|
|
nextDelegate.keyboardFocus();
|
|
|
|
|
event.accepted = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case Qt.Key_Right:
|
|
|
|
|
if (isLocationBottom) {
|
|
|
|
|
let nextDelegate = repeater.itemAt(delegate.index + 1);
|
|
|
|
|
if (nextDelegate) {
|
|
|
|
|
nextDelegate.keyboardFocus();
|
|
|
|
|
event.accepted = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function keyboardFocus() {
|
|
|
|
|
if (loader.item) {
|
|
|
|
|
loader.item.keyboardFocus();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
Loader {
|
2025-08-11 20:04:35 +00:00
|
|
|
id: loader
|
2023-10-22 03:59:27 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
|
|
sourceComponent: {
|
|
|
|
|
if (delegate.delegateModel.type === Folio.FolioDelegate.Application) {
|
|
|
|
|
return appComponent;
|
|
|
|
|
} else if (delegate.delegateModel.type === Folio.FolioDelegate.Folder) {
|
|
|
|
|
return folderComponent;
|
|
|
|
|
} else {
|
|
|
|
|
// ghost entry
|
|
|
|
|
return placeholderComponent;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: placeholderComponent
|
|
|
|
|
|
2025-03-19 19:38:35 +00:00
|
|
|
// square that shows when hovering over a spot to drop a delegate on (ghost entry)
|
|
|
|
|
PlaceholderDelegate {
|
|
|
|
|
id: dragDropFeedback
|
|
|
|
|
folio: root.folio
|
2026-04-09 08:15:14 +00:00
|
|
|
width: root.dockCellWidth
|
|
|
|
|
height: root.dockCellHeight
|
2025-03-19 19:38:35 +00:00
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: appComponent
|
|
|
|
|
|
|
|
|
|
AppDelegate {
|
|
|
|
|
id: appDelegate
|
2024-06-21 04:42:14 +00:00
|
|
|
folio: root.folio
|
Folio/Halcyon: Expand Background Blur Effect using a MaskLayer
This merge request expands upon the folio and halcyon background blur effects, making the folio background blur include the backgrounds of folder icons, the favorites bar, and wallpaper selector, and for halcyon, it now includes the folder icons, app library, search, and wallpaper selector. To accomplish this, a mask layer plugin was created to easily attach to these elements. This way, we can use a `OpacityMask` to cut out from the existing blur layer, thus hopefully keeping the performance cost low. And with my limited testing, it does at least seems to run about the same on my oneplus 6t, though it is not really a low end device, so I can not fairly judge the impact for something slower (eg. PinePhone). To be on the safe side, a third option was also added to the folio settings, allowing for the ability to toggle back to the old functionality if needed.




2025-06-27 18:27:30 +00:00
|
|
|
maskManager: root.maskManager
|
2023-10-22 03:59:27 +00:00
|
|
|
application: delegate.delegateModel.application
|
2024-06-21 04:42:14 +00:00
|
|
|
name: folio.FolioSettings.showFavouritesAppLabels ? delegate.delegateModel.application.name : ""
|
2023-10-22 03:59:27 +00:00
|
|
|
shadow: true
|
|
|
|
|
|
|
|
|
|
turnToFolder: delegate.isAppHoveredOver
|
2025-12-12 05:33:25 +00:00
|
|
|
turnToFolderAnimEnabled: folio.HomeScreenState.isDraggingDelegate
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
// do not show if the drop animation is running to this delegate
|
|
|
|
|
visible: !(root.homeScreen.dropAnimationRunning && delegate.isDropPositionThis)
|
|
|
|
|
|
|
|
|
|
// don't show label in drag and drop mode
|
|
|
|
|
labelOpacity: delegate.opacity
|
|
|
|
|
|
2026-04-12 12:15:13 +00:00
|
|
|
// Convergence drag-reorder: click-and-drag to reorder
|
|
|
|
|
onDraggingChanged: {
|
|
|
|
|
if (root.convergenceMode && !folio.FolioSettings.lockLayout) {
|
|
|
|
|
if (appDelegate.dragging) {
|
|
|
|
|
contextMenu.close()
|
|
|
|
|
root.dragReorderIndex = delegate.index
|
|
|
|
|
root.dragReorderOffset = 0
|
|
|
|
|
} else {
|
|
|
|
|
let from = root.dragReorderIndex
|
|
|
|
|
let to = root.dragTargetIndex
|
|
|
|
|
root.dragReorderIndex = -1
|
|
|
|
|
root.dragReorderOffset = 0
|
|
|
|
|
if (from !== -1 && to !== -1 && from !== to) {
|
|
|
|
|
folio.FavouritesModel.moveEntry(from, to)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onDragMoved: (deltaX) => {
|
|
|
|
|
if (root.convergenceMode && !folio.FolioSettings.lockLayout) {
|
|
|
|
|
root.dragReorderOffset = deltaX
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
onPressAndHold: {
|
2025-04-21 14:01:54 +00:00
|
|
|
// prevent editing if lock layout is enabled
|
|
|
|
|
if (folio.FolioSettings.lockLayout) return;
|
|
|
|
|
|
2026-04-12 12:15:13 +00:00
|
|
|
// In convergence mode, drag-reorder is handled by DragHandler;
|
|
|
|
|
// only open the context menu on press-and-hold.
|
|
|
|
|
if (!root.convergenceMode) {
|
|
|
|
|
let mappedCoords = root.homeScreen.prepareStartDelegateDrag(delegate.delegateModel, appDelegate.delegateItem);
|
|
|
|
|
folio.HomeScreenState.startDelegateFavouritesDrag(
|
|
|
|
|
mappedCoords.x,
|
|
|
|
|
mappedCoords.y,
|
|
|
|
|
appDelegate.pressPosition.x,
|
|
|
|
|
appDelegate.pressPosition.y,
|
|
|
|
|
delegate.index
|
|
|
|
|
);
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
contextMenu.open();
|
2025-05-01 09:04:38 +00:00
|
|
|
haptics.buttonVibrate();
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onPressAndHoldReleased: {
|
|
|
|
|
// cancel the event if the delegate is not dragged
|
2026-04-12 12:15:13 +00:00
|
|
|
if (!root.convergenceMode && folio.HomeScreenState.swipeState === Folio.HomeScreenState.AwaitingDraggingDelegate) {
|
2023-10-22 03:59:27 +00:00
|
|
|
homeScreen.cancelDelegateDrag();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onRightMousePress: {
|
|
|
|
|
contextMenu.open();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ContextMenuLoader {
|
|
|
|
|
id: contextMenu
|
2026-04-11 07:42:21 +00:00
|
|
|
menuPopupType: root.convergenceMode ? T.Popup.Window : T.Popup.Item
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
// close menu when drag starts
|
|
|
|
|
Connections {
|
2024-06-21 04:42:14 +00:00
|
|
|
target: folio.HomeScreenState
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2025-12-12 05:33:25 +00:00
|
|
|
function onDelegateDragStarted() {
|
|
|
|
|
contextMenu.close();
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
actions: [
|
2026-04-09 10:29:38 +00:00
|
|
|
Kirigami.Action {
|
|
|
|
|
icon.name: delegate.delegateModel.application.icon
|
|
|
|
|
text: i18n("Launch")
|
|
|
|
|
onTriggered: appDelegate.launchApp()
|
|
|
|
|
},
|
2023-10-22 03:59:27 +00:00
|
|
|
Kirigami.Action {
|
|
|
|
|
icon.name: "emblem-favorite"
|
2026-04-09 10:29:38 +00:00
|
|
|
text: i18n("Remove from Dock")
|
2025-04-21 14:01:54 +00:00
|
|
|
enabled: !folio.FolioSettings.lockLayout
|
2024-06-21 04:42:14 +00:00
|
|
|
onTriggered: folio.FavouritesModel.removeEntry(delegate.index)
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Component {
|
|
|
|
|
id: folderComponent
|
|
|
|
|
|
|
|
|
|
AppFolderDelegate {
|
|
|
|
|
id: appFolderDelegate
|
2024-06-21 04:42:14 +00:00
|
|
|
folio: root.folio
|
Folio/Halcyon: Expand Background Blur Effect using a MaskLayer
This merge request expands upon the folio and halcyon background blur effects, making the folio background blur include the backgrounds of folder icons, the favorites bar, and wallpaper selector, and for halcyon, it now includes the folder icons, app library, search, and wallpaper selector. To accomplish this, a mask layer plugin was created to easily attach to these elements. This way, we can use a `OpacityMask` to cut out from the existing blur layer, thus hopefully keeping the performance cost low. And with my limited testing, it does at least seems to run about the same on my oneplus 6t, though it is not really a low end device, so I can not fairly judge the impact for something slower (eg. PinePhone). To be on the safe side, a third option was also added to the folio settings, allowing for the ability to toggle back to the old functionality if needed.




2025-06-27 18:27:30 +00:00
|
|
|
maskManager: root.maskManager
|
2023-10-22 03:59:27 +00:00
|
|
|
shadow: true
|
|
|
|
|
folder: delegate.delegateModel.folder
|
2024-06-21 04:42:14 +00:00
|
|
|
name: folio.FolioSettings.showFavouritesAppLabels ? delegate.delegateModel.folder.name : ""
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
// do not show if the drop animation is running to this delegate, and the drop delegate is a folder
|
|
|
|
|
visible: !(root.homeScreen.dropAnimationRunning &&
|
Folio/Halcyon: Expand Background Blur Effect using a MaskLayer
This merge request expands upon the folio and halcyon background blur effects, making the folio background blur include the backgrounds of folder icons, the favorites bar, and wallpaper selector, and for halcyon, it now includes the folder icons, app library, search, and wallpaper selector. To accomplish this, a mask layer plugin was created to easily attach to these elements. This way, we can use a `OpacityMask` to cut out from the existing blur layer, thus hopefully keeping the performance cost low. And with my limited testing, it does at least seems to run about the same on my oneplus 6t, though it is not really a low end device, so I can not fairly judge the impact for something slower (eg. PinePhone). To be on the safe side, a third option was also added to the folio settings, allowing for the ability to toggle back to the old functionality if needed.




2025-06-27 18:27:30 +00:00
|
|
|
delegate.isDropPositionThis &&
|
|
|
|
|
delegate.dragState.dropDelegate.type === Folio.FolioDelegate.Folder)
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
appHoveredOver: delegate.isAppHoveredOver
|
|
|
|
|
|
|
|
|
|
// don't show label in drag and drop mode
|
|
|
|
|
labelOpacity: delegate.opacity
|
|
|
|
|
|
|
|
|
|
onAfterClickAnimation: {
|
|
|
|
|
const pos = homeScreen.prepareFolderOpen(appFolderDelegate.contentItem);
|
2024-06-21 04:42:14 +00:00
|
|
|
folio.HomeScreenState.openFolder(pos.x, pos.y, delegate.delegateModel.folder);
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
|
2026-04-12 12:15:13 +00:00
|
|
|
// Convergence drag-reorder: click-and-drag to reorder
|
|
|
|
|
onDraggingChanged: {
|
|
|
|
|
if (root.convergenceMode && !folio.FolioSettings.lockLayout) {
|
|
|
|
|
if (appFolderDelegate.dragging) {
|
|
|
|
|
contextMenu.close()
|
|
|
|
|
root.dragReorderIndex = delegate.index
|
|
|
|
|
root.dragReorderOffset = 0
|
|
|
|
|
} else {
|
|
|
|
|
let from = root.dragReorderIndex
|
|
|
|
|
let to = root.dragTargetIndex
|
|
|
|
|
root.dragReorderIndex = -1
|
|
|
|
|
root.dragReorderOffset = 0
|
|
|
|
|
if (from !== -1 && to !== -1 && from !== to) {
|
|
|
|
|
folio.FavouritesModel.moveEntry(from, to)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onDragMoved: (deltaX) => {
|
|
|
|
|
if (root.convergenceMode && !folio.FolioSettings.lockLayout) {
|
|
|
|
|
root.dragReorderOffset = deltaX
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-22 03:59:27 +00:00
|
|
|
onPressAndHold: {
|
2026-04-12 12:15:13 +00:00
|
|
|
// prevent editing if lock layout is enabled
|
|
|
|
|
if (folio.FolioSettings.lockLayout) return;
|
|
|
|
|
|
|
|
|
|
if (!root.convergenceMode) {
|
|
|
|
|
let mappedCoords = root.homeScreen.prepareStartDelegateDrag(delegate.delegateModel, appFolderDelegate.delegateItem);
|
|
|
|
|
folio.HomeScreenState.startDelegateFavouritesDrag(
|
|
|
|
|
mappedCoords.x,
|
|
|
|
|
mappedCoords.y,
|
|
|
|
|
appFolderDelegate.pressPosition.x,
|
|
|
|
|
appFolderDelegate.pressPosition.y,
|
|
|
|
|
delegate.index
|
|
|
|
|
);
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
contextMenu.open();
|
2025-05-01 09:04:38 +00:00
|
|
|
haptics.buttonVibrate();
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onPressAndHoldReleased: {
|
|
|
|
|
// cancel the event if the delegate is not dragged
|
2026-04-12 12:15:13 +00:00
|
|
|
if (!root.convergenceMode && folio.HomeScreenState.swipeState === Folio.HomeScreenState.AwaitingDraggingDelegate) {
|
2023-10-22 03:59:27 +00:00
|
|
|
root.homeScreen.cancelDelegateDrag();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onRightMousePress: {
|
|
|
|
|
contextMenu.open();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ContextMenuLoader {
|
|
|
|
|
id: contextMenu
|
2026-04-11 07:42:21 +00:00
|
|
|
menuPopupType: root.convergenceMode ? T.Popup.Window : T.Popup.Item
|
2023-10-22 03:59:27 +00:00
|
|
|
|
|
|
|
|
// close menu when drag starts
|
|
|
|
|
Connections {
|
2024-06-21 04:42:14 +00:00
|
|
|
target: folio.HomeScreenState
|
2023-10-22 03:59:27 +00:00
|
|
|
|
2025-12-12 05:33:25 +00:00
|
|
|
function onDelegateDragStarted() {
|
|
|
|
|
contextMenu.close();
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
actions: [
|
|
|
|
|
Kirigami.Action {
|
|
|
|
|
icon.name: "emblem-favorite"
|
|
|
|
|
text: i18n("Remove")
|
2024-03-06 14:19:03 +00:00
|
|
|
onTriggered: deleteDialog.open()
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
]
|
2024-03-06 14:19:03 +00:00
|
|
|
|
|
|
|
|
ConfirmDeleteFolderDialogLoader {
|
|
|
|
|
id: deleteDialog
|
|
|
|
|
parent: root.homeScreen
|
2024-06-21 04:42:14 +00:00
|
|
|
onAccepted: folio.FavouritesModel.removeEntry(delegate.index)
|
2024-03-06 14:19:03 +00:00
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-09 08:15:14 +00:00
|
|
|
|
|
|
|
|
// Running-app task icons (convergence mode only)
|
2026-04-10 08:23:36 +00:00
|
|
|
|
|
|
|
|
Timer {
|
|
|
|
|
id: thumbnailShowTimer
|
|
|
|
|
interval: Kirigami.Units.toolTipDelay
|
|
|
|
|
onTriggered: {
|
|
|
|
|
thumbnailPopup.visible = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Timer {
|
|
|
|
|
id: thumbnailHideTimer
|
|
|
|
|
interval: 300
|
|
|
|
|
onTriggered: {
|
|
|
|
|
thumbnailPopup.visible = false
|
|
|
|
|
root.hoveredTaskIndex = -1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Window {
|
|
|
|
|
id: thumbnailPopup
|
|
|
|
|
|
|
|
|
|
property var targetDelegate: null
|
2026-04-11 11:25:01 +00:00
|
|
|
property int taskIndex: -1
|
|
|
|
|
property var windowIds: []
|
|
|
|
|
property bool isGroup: false
|
2026-04-10 08:23:36 +00:00
|
|
|
property bool popupHovered: false
|
|
|
|
|
|
|
|
|
|
function open() { visible = true }
|
|
|
|
|
function close() { visible = false }
|
|
|
|
|
readonly property bool opened: visible
|
|
|
|
|
|
|
|
|
|
flags: Qt.ToolTip | Qt.FramelessWindowHint | Qt.WindowDoesNotAcceptFocus
|
|
|
|
|
color: "transparent"
|
2026-04-11 11:25:01 +00:00
|
|
|
|
|
|
|
|
readonly property real thumbWidth: windowIds.length <= 1
|
|
|
|
|
? Kirigami.Units.gridUnit * 16
|
|
|
|
|
: Kirigami.Units.gridUnit * 12
|
|
|
|
|
|
|
|
|
|
width: Math.max(Kirigami.Units.gridUnit * 8,
|
|
|
|
|
windowIds.length * thumbWidth
|
|
|
|
|
+ Math.max(0, windowIds.length - 1) * Kirigami.Units.smallSpacing
|
|
|
|
|
+ 2 * Kirigami.Units.smallSpacing)
|
2026-04-10 08:23:36 +00:00
|
|
|
height: popupContent.implicitHeight + 2 * Kirigami.Units.smallSpacing
|
|
|
|
|
|
|
|
|
|
// Position above the hovered dock icon, in global coordinates
|
|
|
|
|
x: {
|
|
|
|
|
if (!targetDelegate) return 0
|
|
|
|
|
var delegateGlobal = targetDelegate.mapToGlobal(0, 0)
|
|
|
|
|
return Math.max(0, delegateGlobal.x + (targetDelegate.width - width) / 2)
|
|
|
|
|
}
|
|
|
|
|
y: {
|
|
|
|
|
if (!targetDelegate) return 0
|
|
|
|
|
var delegateGlobal = targetDelegate.mapToGlobal(0, 0)
|
|
|
|
|
return delegateGlobal.y - height - Kirigami.Units.smallSpacing
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onVisibleChanged: {
|
|
|
|
|
if (!visible) {
|
2026-04-11 11:25:01 +00:00
|
|
|
windowIds = []
|
2026-04-10 08:23:36 +00:00
|
|
|
targetDelegate = null
|
2026-04-11 11:25:01 +00:00
|
|
|
taskIndex = -1
|
|
|
|
|
isGroup = false
|
2026-04-10 08:23:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
color: Kirigami.Theme.backgroundColor
|
|
|
|
|
border.color: Qt.rgba(
|
|
|
|
|
Kirigami.Theme.textColor.r,
|
|
|
|
|
Kirigami.Theme.textColor.g,
|
|
|
|
|
Kirigami.Theme.textColor.b, 0.2)
|
|
|
|
|
border.width: 1
|
|
|
|
|
radius: Kirigami.Units.cornerRadius
|
|
|
|
|
|
2026-04-11 11:25:01 +00:00
|
|
|
// HoverHandler for popup-level hover tracking (does not
|
|
|
|
|
// consume mouse events, so clicks still reach delegates).
|
|
|
|
|
HoverHandler {
|
|
|
|
|
id: popupHoverHandler
|
|
|
|
|
onHoveredChanged: {
|
|
|
|
|
thumbnailPopup.popupHovered = hovered
|
|
|
|
|
if (hovered) {
|
2026-04-10 08:23:36 +00:00
|
|
|
thumbnailHideTimer.stop()
|
|
|
|
|
} else if (root.hoveredTaskIndex < 0) {
|
|
|
|
|
thumbnailHideTimer.restart()
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-11 11:25:01 +00:00
|
|
|
}
|
2026-04-10 08:23:36 +00:00
|
|
|
|
2026-04-11 11:25:01 +00:00
|
|
|
Row {
|
|
|
|
|
id: popupContent
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
anchors.margins: Kirigami.Units.smallSpacing
|
|
|
|
|
spacing: Kirigami.Units.smallSpacing
|
2026-04-10 08:23:36 +00:00
|
|
|
|
2026-04-11 11:25:01 +00:00
|
|
|
Repeater {
|
|
|
|
|
model: thumbnailPopup.windowIds.length
|
|
|
|
|
|
|
|
|
|
delegate: MouseArea {
|
|
|
|
|
id: thumbEntry
|
|
|
|
|
width: thumbnailPopup.thumbWidth
|
|
|
|
|
height: thumbColumn.implicitHeight
|
|
|
|
|
hoverEnabled: true
|
|
|
|
|
|
|
|
|
|
readonly property string childUuid: thumbnailPopup.windowIds[index] || ""
|
|
|
|
|
readonly property string childTitle: {
|
|
|
|
|
if (!thumbnailPopup.isGroup)
|
|
|
|
|
return tasksModel.data(tasksModel.makeModelIndex(thumbnailPopup.taskIndex), 0) || ""
|
|
|
|
|
return tasksModel.data(tasksModel.makeModelIndex(thumbnailPopup.taskIndex, index), 0) || ""
|
|
|
|
|
}
|
2026-04-10 08:23:36 +00:00
|
|
|
|
2026-04-11 11:25:01 +00:00
|
|
|
onClicked: {
|
|
|
|
|
var idx = thumbnailPopup.isGroup
|
|
|
|
|
? tasksModel.makeModelIndex(thumbnailPopup.taskIndex, index)
|
|
|
|
|
: tasksModel.makeModelIndex(thumbnailPopup.taskIndex)
|
|
|
|
|
tasksModel.requestActivate(idx)
|
|
|
|
|
thumbnailPopup.close()
|
|
|
|
|
}
|
2026-04-10 08:23:36 +00:00
|
|
|
|
2026-04-11 11:25:01 +00:00
|
|
|
Rectangle {
|
2026-04-10 08:23:36 +00:00
|
|
|
anchors.fill: parent
|
2026-04-11 11:25:01 +00:00
|
|
|
radius: Kirigami.Units.cornerRadius
|
|
|
|
|
color: thumbEntry.containsMouse
|
|
|
|
|
? Qt.rgba(Kirigami.Theme.highlightColor.r,
|
|
|
|
|
Kirigami.Theme.highlightColor.g,
|
|
|
|
|
Kirigami.Theme.highlightColor.b, 0.15)
|
|
|
|
|
: "transparent"
|
2026-04-10 08:23:36 +00:00
|
|
|
}
|
|
|
|
|
|
2026-04-11 11:25:01 +00:00
|
|
|
Column {
|
|
|
|
|
id: thumbColumn
|
|
|
|
|
width: parent.width
|
|
|
|
|
spacing: Kirigami.Units.smallSpacing
|
|
|
|
|
|
|
|
|
|
Item {
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: width * 9 / 16
|
|
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
|
id: thumbPipeWireLoader
|
|
|
|
|
active: thumbnailPopup.visible
|
|
|
|
|
&& thumbEntry.childUuid !== ""
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
sourceComponent: PipeWireThumbnail {
|
|
|
|
|
windowUuid: thumbEntry.childUuid
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Kirigami.Icon {
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
width: Kirigami.Units.iconSizes.huge
|
|
|
|
|
height: width
|
|
|
|
|
source: thumbnailPopup.targetDelegate
|
|
|
|
|
? thumbnailPopup.targetDelegate.model.decoration
|
|
|
|
|
: ""
|
|
|
|
|
visible: !thumbPipeWireLoader.item
|
|
|
|
|
|| !thumbPipeWireLoader.item.hasThumbnail
|
|
|
|
|
}
|
2026-04-12 08:15:28 +00:00
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
|
id: closeButton
|
|
|
|
|
width: Kirigami.Units.iconSizes.small
|
|
|
|
|
height: width
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.margins: Kirigami.Units.smallSpacing
|
|
|
|
|
z: 1
|
|
|
|
|
visible: thumbEntry.containsMouse
|
|
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
|
var idx = thumbnailPopup.isGroup
|
|
|
|
|
? tasksModel.makeModelIndex(thumbnailPopup.taskIndex, index)
|
|
|
|
|
: tasksModel.makeModelIndex(thumbnailPopup.taskIndex)
|
|
|
|
|
tasksModel.requestClose(idx)
|
|
|
|
|
if (thumbnailPopup.windowIds.length <= 1) {
|
|
|
|
|
thumbnailPopup.close()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Kirigami.Icon {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
source: "window-close"
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-11 11:25:01 +00:00
|
|
|
}
|
2026-04-10 08:23:36 +00:00
|
|
|
|
2026-04-11 11:25:01 +00:00
|
|
|
PC3.Label {
|
|
|
|
|
width: parent.width
|
|
|
|
|
text: thumbEntry.childTitle
|
|
|
|
|
elide: Text.ElideRight
|
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
|
maximumLineCount: 1
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-10 08:23:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-13 07:39:19 +00:00
|
|
|
// Separator between pinned favourites and running tasks
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: dockSpacer
|
|
|
|
|
visible: root.showSpacer
|
|
|
|
|
x: (repeater.count - root.totalItemCount / 2) * root.dockCellWidth + root.dockCenterX - width / 2
|
|
|
|
|
y: parent.height * 0.2
|
|
|
|
|
width: Math.round(Kirigami.Units.devicePixelRatio)
|
|
|
|
|
height: parent.height * 0.6
|
|
|
|
|
color: Kirigami.Theme.textColor
|
|
|
|
|
opacity: 0.4
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-13 10:32:54 +00:00
|
|
|
PlaceholderDelegate {
|
|
|
|
|
id: taskPinPlaceholder
|
|
|
|
|
visible: root.taskPinCanDrop
|
|
|
|
|
folio: root.folio
|
|
|
|
|
width: root.dockCellWidth
|
|
|
|
|
height: root.dockCellHeight
|
|
|
|
|
x: root.favouriteBaseX(root.taskPinTargetIndex)
|
|
|
|
|
y: (parent.height - height) / 2
|
|
|
|
|
z: 1
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-09 08:15:14 +00:00
|
|
|
Repeater {
|
|
|
|
|
id: taskRepeater
|
|
|
|
|
model: root.convergenceMode ? tasksModel : null
|
|
|
|
|
|
|
|
|
|
delegate: Item {
|
|
|
|
|
id: taskDelegate
|
|
|
|
|
|
|
|
|
|
required property int index
|
|
|
|
|
required property var model
|
|
|
|
|
|
|
|
|
|
readonly property bool isLocationBottom: folio.HomeScreenState.favouritesBarLocation === Folio.HomeScreenState.Bottom
|
2026-04-13 10:32:54 +00:00
|
|
|
readonly property string taskStorageId: root.runningTaskStorageId(taskDelegate.model)
|
2026-04-09 08:15:14 +00:00
|
|
|
|
|
|
|
|
// Position after all favourites
|
|
|
|
|
property double fromCenterValue: (repeater.count + taskDelegate.index) - (root.totalItemCount / 2)
|
|
|
|
|
Behavior on fromCenterValue {
|
|
|
|
|
NumberAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.InOutQuad; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
readonly property int centerPosition: (isLocationBottom ? root.dockCellWidth : root.dockCellHeight) * fromCenterValue
|
|
|
|
|
|
2026-04-13 10:32:54 +00:00
|
|
|
x: isLocationBottom ? root.taskBaseX(taskDelegate.index) + (root.taskPinDragIndex === taskDelegate.index ? root.taskPinDragOffset : 0) : (parent.width - width) / 2
|
2026-04-09 08:15:14 +00:00
|
|
|
y: isLocationBottom ? (parent.height - height) / 2 : parent.height / 2 - centerPosition - root.dockCellHeight
|
2026-04-13 10:32:54 +00:00
|
|
|
z: root.taskPinDragIndex === taskDelegate.index ? 2 : 0
|
2026-04-09 08:15:14 +00:00
|
|
|
|
|
|
|
|
implicitWidth: root.dockCellWidth
|
|
|
|
|
implicitHeight: root.dockCellHeight
|
|
|
|
|
width: root.dockCellWidth
|
|
|
|
|
height: root.dockCellHeight
|
|
|
|
|
|
2026-04-09 09:09:15 +00:00
|
|
|
// Hover highlight background
|
|
|
|
|
Rectangle {
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
radius: Kirigami.Units.cornerRadius
|
|
|
|
|
color: taskMouseArea.containsPress
|
|
|
|
|
? Qt.rgba(255, 255, 255, 0.2)
|
|
|
|
|
: (taskMouseArea.containsMouse ? Qt.rgba(255, 255, 255, 0.1) : "transparent")
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-09 08:15:14 +00:00
|
|
|
// Task icon
|
|
|
|
|
Kirigami.Icon {
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
width: Math.min(parent.width, parent.height) * 0.6
|
|
|
|
|
height: width
|
|
|
|
|
source: taskDelegate.model.decoration
|
2026-04-09 09:09:15 +00:00
|
|
|
active: taskMouseArea.containsMouse
|
2026-04-09 08:15:14 +00:00
|
|
|
}
|
|
|
|
|
|
2026-04-13 10:32:54 +00:00
|
|
|
DragHandler {
|
|
|
|
|
id: taskDragHandler
|
|
|
|
|
target: null
|
|
|
|
|
xAxis.enabled: true
|
|
|
|
|
yAxis.enabled: false
|
|
|
|
|
enabled: root.convergenceMode && taskDelegate.isLocationBottom && !folio.FolioSettings.lockLayout && taskDelegate.taskStorageId !== "" && !folio.FavouritesModel.containsApplication(taskDelegate.taskStorageId)
|
|
|
|
|
|
|
|
|
|
onActiveChanged: {
|
|
|
|
|
if (active) {
|
|
|
|
|
thumbnailPopup.close()
|
|
|
|
|
thumbnailShowTimer.stop()
|
|
|
|
|
thumbnailHideTimer.stop()
|
|
|
|
|
root.hoveredTaskIndex = -1
|
|
|
|
|
root.taskPinDragIndex = taskDelegate.index
|
|
|
|
|
root.taskPinDragOffset = 0
|
|
|
|
|
root.taskPinTargetIndex = -1
|
|
|
|
|
root.taskPinStorageId = taskDelegate.taskStorageId
|
|
|
|
|
} else if (root.taskPinDragIndex === taskDelegate.index) {
|
|
|
|
|
if (root.taskPinCanDrop) {
|
|
|
|
|
folio.FavouritesModel.addApplicationAt(root.taskPinTargetIndex, root.taskPinStorageId)
|
|
|
|
|
}
|
|
|
|
|
root.clearTaskPinDrag()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onTranslationChanged: {
|
|
|
|
|
if (root.taskPinDragIndex === taskDelegate.index) {
|
|
|
|
|
root.taskPinDragOffset = translation.x
|
|
|
|
|
root.updateTaskPinTarget()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onCanceled: {
|
|
|
|
|
if (root.taskPinDragIndex === taskDelegate.index) {
|
|
|
|
|
root.clearTaskPinDrag()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-10 11:32:16 +00:00
|
|
|
// Window indicator dots (one per sibling window of the same app)
|
|
|
|
|
Row {
|
2026-04-09 08:15:14 +00:00
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
anchors.bottomMargin: Kirigami.Units.smallSpacing / 2
|
2026-04-10 11:32:16 +00:00
|
|
|
spacing: Kirigami.Units.smallSpacing / 2
|
|
|
|
|
|
|
|
|
|
Repeater {
|
2026-04-11 11:25:01 +00:00
|
|
|
model: {
|
|
|
|
|
var ids = taskDelegate.model.WinIdList
|
|
|
|
|
return ids ? ids.length : 1
|
|
|
|
|
}
|
2026-04-10 11:32:16 +00:00
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
width: Kirigami.Units.smallSpacing * 1.5
|
|
|
|
|
height: width
|
|
|
|
|
radius: width / 2
|
|
|
|
|
color: Kirigami.Theme.highlightColor
|
|
|
|
|
opacity: taskDelegate.model.IsActive === true ? 1.0 : 0.4
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-09 08:15:14 +00:00
|
|
|
}
|
|
|
|
|
|
2026-04-13 09:16:08 +00:00
|
|
|
// Click to activate, middle-click to close, hover for thumbnail preview
|
2026-04-09 08:15:14 +00:00
|
|
|
MouseArea {
|
2026-04-09 09:09:15 +00:00
|
|
|
id: taskMouseArea
|
2026-04-09 08:15:14 +00:00
|
|
|
anchors.fill: parent
|
2026-04-09 09:09:15 +00:00
|
|
|
hoverEnabled: true
|
2026-04-13 09:16:08 +00:00
|
|
|
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
|
2026-04-09 08:15:14 +00:00
|
|
|
onClicked: (mouse) => {
|
2026-04-13 09:16:08 +00:00
|
|
|
if (mouse.button === Qt.MiddleButton) {
|
|
|
|
|
thumbnailPopup.close()
|
|
|
|
|
tasksModel.requestClose(tasksModel.makeModelIndex(taskDelegate.index));
|
|
|
|
|
return
|
|
|
|
|
}
|
2026-04-09 08:15:14 +00:00
|
|
|
if (mouse.button === Qt.RightButton) {
|
2026-04-10 08:23:36 +00:00
|
|
|
thumbnailPopup.close()
|
|
|
|
|
thumbnailShowTimer.stop()
|
2026-04-11 07:42:21 +00:00
|
|
|
taskContextMenu.open();
|
2026-04-09 08:15:14 +00:00
|
|
|
} else {
|
2026-04-11 11:25:01 +00:00
|
|
|
var winIds = taskDelegate.model.WinIdList
|
|
|
|
|
if (winIds && winIds.length > 1) {
|
|
|
|
|
// Multiple windows: toggle thumbnail popup
|
|
|
|
|
if (thumbnailPopup.opened && thumbnailPopup.taskIndex === taskDelegate.index) {
|
|
|
|
|
thumbnailPopup.close()
|
|
|
|
|
} else {
|
|
|
|
|
thumbnailPopup.targetDelegate = taskDelegate
|
|
|
|
|
thumbnailPopup.taskIndex = taskDelegate.index
|
|
|
|
|
thumbnailPopup.windowIds = winIds
|
|
|
|
|
thumbnailPopup.isGroup = taskDelegate.model.IsGroupParent === true
|
|
|
|
|
thumbnailPopup.open()
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
thumbnailPopup.close()
|
|
|
|
|
tasksModel.requestActivate(tasksModel.makeModelIndex(taskDelegate.index));
|
|
|
|
|
}
|
2026-04-09 08:15:14 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-04-10 08:23:36 +00:00
|
|
|
onContainsMouseChanged: {
|
|
|
|
|
if (containsMouse) {
|
|
|
|
|
thumbnailHideTimer.stop()
|
|
|
|
|
thumbnailPopup.targetDelegate = taskDelegate
|
2026-04-11 11:25:01 +00:00
|
|
|
thumbnailPopup.taskIndex = taskDelegate.index
|
2026-04-10 08:23:36 +00:00
|
|
|
var winIds = taskDelegate.model.WinIdList
|
2026-04-11 11:25:01 +00:00
|
|
|
thumbnailPopup.windowIds = winIds ? winIds : []
|
|
|
|
|
thumbnailPopup.isGroup = taskDelegate.model.IsGroupParent === true
|
2026-04-10 08:23:36 +00:00
|
|
|
root.hoveredTaskIndex = taskDelegate.index
|
|
|
|
|
if (!thumbnailPopup.opened) {
|
|
|
|
|
thumbnailShowTimer.restart()
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
root.hoveredTaskIndex = -1
|
|
|
|
|
if (!thumbnailPopup.popupHovered) {
|
|
|
|
|
thumbnailShowTimer.stop()
|
|
|
|
|
thumbnailHideTimer.restart()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-09 08:15:14 +00:00
|
|
|
}
|
|
|
|
|
|
2026-04-11 07:42:21 +00:00
|
|
|
PC3.Menu {
|
2026-04-09 08:15:14 +00:00
|
|
|
id: taskContextMenu
|
2026-04-11 07:42:21 +00:00
|
|
|
popupType: T.Popup.Window
|
|
|
|
|
|
|
|
|
|
PC3.MenuItem {
|
|
|
|
|
icon.name: "window-pin"
|
|
|
|
|
text: i18n("Pin to Dock")
|
2026-04-12 07:36:23 +00:00
|
|
|
// repeater.count dependency forces re-evaluation when favourites change
|
2026-04-13 10:32:54 +00:00
|
|
|
visible: taskDelegate.taskStorageId !== "" && repeater.count >= 0 && !folio.FavouritesModel.containsApplication(taskDelegate.taskStorageId)
|
2026-04-11 07:42:21 +00:00
|
|
|
enabled: !folio.FolioSettings.lockLayout
|
2026-04-13 10:32:54 +00:00
|
|
|
onClicked: folio.FavouritesModel.addApplication(taskDelegate.taskStorageId)
|
2026-04-11 07:42:21 +00:00
|
|
|
}
|
|
|
|
|
PC3.MenuItem {
|
2026-04-09 08:15:14 +00:00
|
|
|
icon.name: taskDelegate.model.IsMinimized ? "window-restore" : "window-minimize"
|
2026-04-11 07:42:21 +00:00
|
|
|
text: taskDelegate.model.IsMinimized ? i18n("Restore") : i18n("Minimize")
|
|
|
|
|
onClicked: tasksModel.requestToggleMinimized(tasksModel.makeModelIndex(taskDelegate.index))
|
2026-04-09 08:15:14 +00:00
|
|
|
}
|
2026-04-11 07:42:21 +00:00
|
|
|
PC3.MenuItem {
|
2026-04-09 08:15:14 +00:00
|
|
|
icon.name: taskDelegate.model.IsMaximized ? "window-restore" : "window-maximize"
|
2026-04-11 07:42:21 +00:00
|
|
|
text: taskDelegate.model.IsMaximized ? i18n("Restore") : i18n("Maximize")
|
2026-04-11 11:25:01 +00:00
|
|
|
visible: taskDelegate.model.IsGroupParent !== true
|
2026-04-11 07:42:21 +00:00
|
|
|
onClicked: tasksModel.requestToggleMaximized(tasksModel.makeModelIndex(taskDelegate.index))
|
2026-04-09 08:15:14 +00:00
|
|
|
}
|
2026-04-11 07:42:21 +00:00
|
|
|
PC3.MenuItem {
|
2026-04-09 08:15:14 +00:00
|
|
|
icon.name: "window-close"
|
2026-04-11 11:25:01 +00:00
|
|
|
text: {
|
|
|
|
|
var ids = taskDelegate.model.WinIdList
|
|
|
|
|
return (ids && ids.length > 1) ? i18n("Close All") : i18n("Close")
|
|
|
|
|
}
|
2026-04-11 07:42:21 +00:00
|
|
|
onClicked: tasksModel.requestClose(tasksModel.makeModelIndex(taskDelegate.index))
|
2026-04-09 08:15:14 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-10-22 03:59:27 +00:00
|
|
|
}
|