mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-06-25 07:37:42 +00:00
Compare commits
No commits in common. "8f3a94b1048add03351f04d2bfc788f62b559ffe" and "d1cd5f09d854978fc37db89e5e538488ffc34b4f" have entirely different histories.
8f3a94b104
...
d1cd5f09d8
13 changed files with 32 additions and 102 deletions
|
|
@ -11,7 +11,6 @@ import org.kde.plasma.private.mobileshell as MobileShell
|
||||||
import org.kde.plasma.components 3.0 as PC3
|
import org.kde.plasma.components 3.0 as PC3
|
||||||
import org.kde.kirigami as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS
|
import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS
|
||||||
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Root element that contains all the ActionDrawer's contents, and is anchored to the screen.
|
* Root element that contains all the ActionDrawer's contents, and is anchored to the screen.
|
||||||
|
|
@ -63,10 +62,7 @@ Item {
|
||||||
Kirigami.Theme.backgroundColor.b,
|
Kirigami.Theme.backgroundColor.b,
|
||||||
0.9)
|
0.9)
|
||||||
Behavior on color { ColorAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.OutQuad } }
|
Behavior on color { ColorAnimation { duration: Kirigami.Units.longDuration; easing.type: Easing.OutQuad } }
|
||||||
opacity: {
|
opacity: Math.max(0, Math.min(brightnessPressedValue, actionDrawer.offset / root.minimizedQuickSettingsOffset))
|
||||||
let base = Math.max(0, Math.min(brightnessPressedValue, actionDrawer.offset / root.minimizedQuickSettingsOffset));
|
|
||||||
return ShellSettings.Settings.convergenceModeEnabled ? base * 0.3 : base;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The base swipe area.
|
// The base swipe area.
|
||||||
|
|
@ -110,8 +106,8 @@ Item {
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
topMargin: notificationDrawer.height + 1
|
topMargin: notificationDrawer.height + 1
|
||||||
leftMargin: actionDrawer.mode == MobileShell.ActionDrawer.Portrait ? 0 : (notificationDrawer.isConvergence ? Kirigami.Units.smallSpacing : 10)
|
leftMargin: actionDrawer.mode == MobileShell.ActionDrawer.Portrait ? 0 : 10
|
||||||
rightMargin: actionDrawer.mode == MobileShell.ActionDrawer.Portrait ? 0 : (notificationDrawer.isConvergence ? parent.width * 0.5 : notificationDrawer.notificationWidget.anchors.rightMargin + Kirigami.Units.gridUnit - notificationDrawer.anchors.leftMargin + 370)
|
rightMargin: actionDrawer.mode == MobileShell.ActionDrawer.Portrait ? 0 : notificationDrawer.notificationWidget.anchors.rightMargin + Kirigami.Units.gridUnit - notificationDrawer.anchors.leftMargin + 370
|
||||||
top: parent.top
|
top: parent.top
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
|
|
@ -164,28 +160,19 @@ Item {
|
||||||
NotificationDrawer {
|
NotificationDrawer {
|
||||||
id: notificationDrawer
|
id: notificationDrawer
|
||||||
|
|
||||||
readonly property bool isConvergence: ShellSettings.Settings.convergenceModeEnabled
|
|
||||||
|
|
||||||
swipeArea: swipeAreaPortrait
|
swipeArea: swipeAreaPortrait
|
||||||
actionDrawer: root.actionDrawer
|
actionDrawer: root.actionDrawer
|
||||||
mediaControlsWidget: root.mediaControlsWidget
|
mediaControlsWidget: root.mediaControlsWidget
|
||||||
contentContainer: root
|
contentContainer: root
|
||||||
opacity: {
|
opacity: Math.max(0, Math.min(root.brightnessPressedValue, actionDrawer.offsetResistance / root.minimizedQuickSettingsOffset))
|
||||||
let base = Math.max(0, Math.min(root.brightnessPressedValue, actionDrawer.offsetResistance / root.minimizedQuickSettingsOffset));
|
|
||||||
return isConvergence ? Math.max(0, Math.min(1, actionDrawer.offset / root.minimizedQuickSettingsOffset)) : base;
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
topMargin: isConvergence ? Kirigami.Units.smallSpacing : 0
|
rightMargin: root.actionDrawer.mode == MobileShell.ActionDrawer.Portrait ? 0 : 360
|
||||||
rightMargin: root.actionDrawer.mode == MobileShell.ActionDrawer.Portrait ? 0 : (isConvergence ? parent.width * 0.5 : 360)
|
leftMargin: actionDrawer.mode == MobileShell.ActionDrawer.Portrait ? 0 : notificationDrawer.minWidthHeight * 0.06
|
||||||
leftMargin: actionDrawer.mode == MobileShell.ActionDrawer.Portrait ? 0 : (isConvergence ? Kirigami.Units.smallSpacing : notificationDrawer.minWidthHeight * 0.06)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// In convergence, cap the height so it doesn't stretch full-screen
|
|
||||||
maximumHeight: isConvergence ? root.height * 0.6 : -1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Secondary swipe area for uses in portrait.
|
// Secondary swipe area for uses in portrait.
|
||||||
|
|
|
||||||
|
|
@ -56,14 +56,10 @@ Item {
|
||||||
: ShellSettings.Settings.quickSettingsColumns
|
: ShellSettings.Settings.quickSettingsColumns
|
||||||
readonly property real intendedWidth: (columnWidth * effectiveColumns) + Kirigami.Units.gridUnit
|
readonly property real intendedWidth: (columnWidth * effectiveColumns) + Kirigami.Units.gridUnit
|
||||||
|
|
||||||
readonly property bool isConvergence: ShellSettings.Settings.convergenceModeEnabled
|
property real offsetRatio: quickSettingsPanel.height / root.height
|
||||||
property real offsetRatio: (quickSettingsPanel.height + restingTopMargin) / root.height
|
anchors.topMargin: Math.min(root.actionDrawer.offsetResistance * offsetRatio - quickSettingsPanel.height, 0)
|
||||||
readonly property real restingTopMargin: isConvergence ? Kirigami.Units.smallSpacing : 0
|
|
||||||
anchors.topMargin: isConvergence ? restingTopMargin : Math.min(root.actionDrawer.offsetResistance * offsetRatio - quickSettingsPanel.height, 0)
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: isConvergence ? Kirigami.Units.smallSpacing : 0
|
|
||||||
opacity: isConvergence ? Math.max(0, Math.min(1, root.actionDrawer.offset / root.minimizedQuickSettingsOffset)) : 1
|
|
||||||
|
|
||||||
actionDrawer: root.actionDrawer
|
actionDrawer: root.actionDrawer
|
||||||
fullScreenHeight: root.height
|
fullScreenHeight: root.height
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import QtQuick.Layouts 1.1
|
||||||
import org.kde.plasma.clock
|
import org.kde.plasma.clock
|
||||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||||
import org.kde.plasma.private.mobileshell as MobileShell
|
import org.kde.plasma.private.mobileshell as MobileShell
|
||||||
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
|
|
||||||
import org.kde.kirigami as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
@ -25,26 +24,14 @@ Item {
|
||||||
property alias notificationWidget: notificationWidget
|
property alias notificationWidget: notificationWidget
|
||||||
property real contentY: notificationWidget.listView.contentY
|
property real contentY: notificationWidget.listView.contentY
|
||||||
|
|
||||||
property real topPadding: {
|
property real topPadding: actionDrawer.mode == MobileShell.ActionDrawer.Portrait ? Kirigami.Units.largeSpacing : date.y + date.height + Kirigami.Units.smallSpacing * 6
|
||||||
if (actionDrawer.mode == MobileShell.ActionDrawer.Portrait)
|
|
||||||
return Kirigami.Units.largeSpacing;
|
|
||||||
if (ShellSettings.Settings.convergenceModeEnabled)
|
|
||||||
return Kirigami.Units.largeSpacing;
|
|
||||||
return date.y + date.height + Kirigami.Units.smallSpacing * 6;
|
|
||||||
}
|
|
||||||
property real topMargin: actionDrawer.mode == MobileShell.ActionDrawer.Portrait ? actionDrawer.offsetResistance + 1 : 0
|
property real topMargin: actionDrawer.mode == MobileShell.ActionDrawer.Portrait ? actionDrawer.offsetResistance + 1 : 0
|
||||||
|
|
||||||
readonly property real minWidthHeight: Math.min(actionDrawer.width, actionDrawer.height)
|
readonly property real minWidthHeight: Math.min(actionDrawer.width, actionDrawer.height)
|
||||||
readonly property bool hasNotifications: notificationWidget.hasNotifications
|
readonly property bool hasNotifications: notificationWidget.hasNotifications
|
||||||
readonly property bool listOverflowing: notificationWidget.listView.listOverflowing
|
readonly property bool listOverflowing: notificationWidget.listView.listOverflowing
|
||||||
|
|
||||||
// External cap for convergence mode; -1 means uncapped.
|
height: Math.min(actionDrawer.height - toolButtons.height, notificationWidget.listView.contentHeight + 10 + topMargin)
|
||||||
property real maximumHeight: -1
|
|
||||||
|
|
||||||
height: {
|
|
||||||
let h = Math.min(actionDrawer.height - toolButtons.height, notificationWidget.listView.contentHeight + 10 + topMargin);
|
|
||||||
return maximumHeight > 0 ? Math.min(h, maximumHeight) : h;
|
|
||||||
}
|
|
||||||
|
|
||||||
// time source for the time and date whenin landscape mode
|
// time source for the time and date whenin landscape mode
|
||||||
Clock {
|
Clock {
|
||||||
|
|
@ -168,7 +155,6 @@ Item {
|
||||||
id: landscapeModeHeader
|
id: landscapeModeHeader
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: actionDrawer.mode != MobileShell.ActionDrawer.Portrait
|
visible: actionDrawer.mode != MobileShell.ActionDrawer.Portrait
|
||||||
&& !ShellSettings.Settings.convergenceModeEnabled
|
|
||||||
|
|
||||||
transform: [
|
transform: [
|
||||||
Translate {
|
Translate {
|
||||||
|
|
|
||||||
|
|
@ -73,11 +73,9 @@ MobileShell.BaseItem {
|
||||||
id: statusBarProxy
|
id: statusBarProxy
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
// Hide status bar in convergence — already visible in the top panel
|
|
||||||
visible: !ShellSettings.Settings.convergenceModeEnabled
|
|
||||||
// Align these to double pixels to aid vertical alignment and sharper icon rendering
|
// Align these to double pixels to aid vertical alignment and sharper icon rendering
|
||||||
Layout.preferredHeight: visible ? Math.round(Kirigami.Units.gridUnit * 1.5 * ShellSettings.Settings.statusBarScaleFactor / 2) * 2 : 0
|
Layout.preferredHeight: Math.round(Kirigami.Units.gridUnit * 1.5 * ShellSettings.Settings.statusBarScaleFactor / 2) * 2
|
||||||
Layout.maximumHeight: visible ? Math.round(Kirigami.Units.gridUnit * 1.5 * ShellSettings.Settings.statusBarScaleFactor / 2) * 2 : 0
|
Layout.maximumHeight: Math.round(Kirigami.Units.gridUnit * 1.5 * ShellSettings.Settings.statusBarScaleFactor / 2) * 2
|
||||||
|
|
||||||
Kirigami.Theme.colorSet: Kirigami.Theme.Window
|
Kirigami.Theme.colorSet: Kirigami.Theme.Window
|
||||||
Kirigami.Theme.inherit: false
|
Kirigami.Theme.inherit: false
|
||||||
|
|
|
||||||
|
|
@ -27,15 +27,6 @@ Item {
|
||||||
// 'popupWidth' and 'openOffset' is set by the 'notificationPopupManager'
|
// 'popupWidth' and 'openOffset' is set by the 'notificationPopupManager'
|
||||||
property int popupWidth
|
property int popupWidth
|
||||||
property real openOffset
|
property real openOffset
|
||||||
property bool isConvergence: false
|
|
||||||
|
|
||||||
// In convergence the popup enters from the bottom-right corner
|
|
||||||
readonly property real effectiveOpenOffset: isConvergence
|
|
||||||
? (Screen.height - openOffset - popupHeight)
|
|
||||||
: openOffset
|
|
||||||
readonly property real effectiveClosedOffset: isConvergence
|
|
||||||
? (Screen.height + Kirigami.Units.smallSpacing)
|
|
||||||
: closedOffset
|
|
||||||
|
|
||||||
// calculate the position needed to at when the expanded drawer is active
|
// calculate the position needed to at when the expanded drawer is active
|
||||||
readonly property real fullOpenOffset: popupDrawerOpened ? aboveNotificationFullOffset + aboveNotificationHeight + Kirigami.Units.largeSpacing : 0
|
readonly property real fullOpenOffset: popupDrawerOpened ? aboveNotificationFullOffset + aboveNotificationHeight + Kirigami.Units.largeSpacing : 0
|
||||||
|
|
@ -253,7 +244,7 @@ Item {
|
||||||
waiting = false;
|
waiting = false;
|
||||||
inPopupDrawer = true;
|
inPopupDrawer = true;
|
||||||
if (notificationPopup.popupDrawerOpened && notificationItem.state != "inDrawerClosed" && notificationItem.state != "open") {
|
if (notificationPopup.popupDrawerOpened && notificationItem.state != "inDrawerClosed" && notificationItem.state != "open") {
|
||||||
notificationItem.offset = effectiveOpenOffset;
|
notificationItem.offset = openOffset;
|
||||||
notificationItem.scale = 0.75;
|
notificationItem.scale = 0.75;
|
||||||
notificationItem.popupOpacity = 0.0;
|
notificationItem.popupOpacity = 0.0;
|
||||||
}
|
}
|
||||||
|
|
@ -264,7 +255,7 @@ Item {
|
||||||
|
|
||||||
function openPopup() {
|
function openPopup() {
|
||||||
if (notificationPopup.popupDrawerOpened && notificationItem.state != "open" && notificationItem.state != "inDrawerClosed") {
|
if (notificationPopup.popupDrawerOpened && notificationItem.state != "open" && notificationItem.state != "inDrawerClosed") {
|
||||||
notificationItem.offset = effectiveOpenOffset;
|
notificationItem.offset = openOffset;
|
||||||
notificationItem.scale = 0.75;
|
notificationItem.scale = 0.75;
|
||||||
notificationItem.popupOpacity = 0.0;
|
notificationItem.popupOpacity = 0.0;
|
||||||
}
|
}
|
||||||
|
|
@ -352,7 +343,7 @@ Item {
|
||||||
|
|
||||||
onDismissRequested: closePopup(popupIndex)
|
onDismissRequested: closePopup(popupIndex)
|
||||||
|
|
||||||
property real offset: notificationPopup.effectiveClosedOffset
|
property real offset: closedOffset
|
||||||
property real scale: 1.0
|
property real scale: 1.0
|
||||||
property real popupOpacity: 1.0 // controls the opacity of the notification popup when outside the popup drawer
|
property real popupOpacity: 1.0 // controls the opacity of the notification popup when outside the popup drawer
|
||||||
property real drawerScale: {
|
property real drawerScale: {
|
||||||
|
|
@ -374,9 +365,6 @@ Item {
|
||||||
return Kirigami.Units.gridUnit * 0.5 * indexClamped;
|
return Kirigami.Units.gridUnit * 0.5 * indexClamped;
|
||||||
}
|
}
|
||||||
property real drawerOpacity: {
|
property real drawerOpacity: {
|
||||||
if (notificationPopup.isConvergence && notificationPopup.inPopupDrawer) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
let index = notificationPopup.popupIndex - popupNotifications.currentPopupIndex;
|
let index = notificationPopup.popupIndex - popupNotifications.currentPopupIndex;
|
||||||
if (index > 2 && !notificationPopup.popupDrawerOpened) {
|
if (index > 2 && !notificationPopup.popupDrawerOpened) {
|
||||||
return 0; // make this popup invisible if it is below 3 other popups
|
return 0; // make this popup invisible if it is below 3 other popups
|
||||||
|
|
@ -411,7 +399,7 @@ Item {
|
||||||
State {
|
State {
|
||||||
name: "open"
|
name: "open"
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: notificationItem; offset: notificationPopup.effectiveOpenOffset
|
target: notificationItem; offset: notificationPopup.openOffset
|
||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: notificationItem; scale: 1.0
|
target: notificationItem; scale: 1.0
|
||||||
|
|
@ -423,7 +411,7 @@ Item {
|
||||||
State {
|
State {
|
||||||
name: "closeWithMove"
|
name: "closeWithMove"
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: notificationItem; offset: notificationPopup.effectiveClosedOffset
|
target: notificationItem; offset: notificationPopup.closedOffset
|
||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: notificationItem; scale: 1.0
|
target: notificationItem; scale: 1.0
|
||||||
|
|
@ -435,7 +423,7 @@ Item {
|
||||||
State {
|
State {
|
||||||
name: "closeWithScale"
|
name: "closeWithScale"
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: notificationItem; offset: notificationPopup.effectiveOpenOffset
|
target: notificationItem; offset: notificationPopup.openOffset
|
||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: notificationItem; scale: 0.75
|
target: notificationItem; scale: 0.75
|
||||||
|
|
@ -447,7 +435,7 @@ Item {
|
||||||
State {
|
State {
|
||||||
name: "inDrawerClosed"
|
name: "inDrawerClosed"
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: notificationItem; offset: notificationPopup.effectiveOpenOffset
|
target: notificationItem; offset: notificationPopup.openOffset
|
||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: notificationItem; scale: 1
|
target: notificationItem; scale: 1
|
||||||
|
|
@ -568,29 +556,15 @@ Item {
|
||||||
startActive = false;
|
startActive = false;
|
||||||
}
|
}
|
||||||
lastOffset = notificationPopup.dragOffset;
|
lastOffset = notificationPopup.dragOffset;
|
||||||
let rawOffset = startDragOffset + (translation.y - startPosition);
|
notificationPopup.dragOffset = calculateResistance(startDragOffset + (translation.y - startPosition), 0);
|
||||||
if (notificationPopup.isConvergence) {
|
|
||||||
notificationPopup.dragOffset = -calculateResistance(-rawOffset, 0);
|
|
||||||
} else {
|
|
||||||
notificationPopup.dragOffset = calculateResistance(rawOffset, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onActiveChanged: {
|
onActiveChanged: {
|
||||||
startActive = active;
|
startActive = active;
|
||||||
notificationPopup.preventDismissTimeout = true;
|
notificationPopup.preventDismissTimeout = true;
|
||||||
if (!active && !(notificationItem.state == "closeWithScale" || notificationItem.state == "closeWithMove")) {
|
if (!active && !(notificationItem.state == "closeWithScale" || notificationItem.state == "closeWithMove")) {
|
||||||
let dominated = false;
|
if ((lastOffset - notificationPopup.dragOffset > 1.0 && notificationPopup.dragOffset < 0) || (-(notificationPopup.openOffset - notificationPopup.closedOffset) / 4 > notificationPopup.dragOffset)) {
|
||||||
if (notificationPopup.isConvergence) {
|
// this code is called when the notification is swiped or dragged to the top.
|
||||||
// convergence: dismiss on swipe down
|
|
||||||
dominated = (notificationPopup.dragOffset - lastOffset > 1.0 && notificationPopup.dragOffset > 0)
|
|
||||||
|| (notificationPopup.dragOffset > (notificationPopup.effectiveClosedOffset - notificationPopup.effectiveOpenOffset) / 4);
|
|
||||||
} else {
|
|
||||||
// mobile: dismiss on swipe up
|
|
||||||
dominated = (lastOffset - notificationPopup.dragOffset > 1.0 && notificationPopup.dragOffset < 0)
|
|
||||||
|| (-(notificationPopup.openOffset - notificationPopup.closedOffset) / 4 > notificationPopup.dragOffset);
|
|
||||||
}
|
|
||||||
if (dominated) {
|
|
||||||
notificationPopup.closedWithSwipe = true;
|
notificationPopup.closedWithSwipe = true;
|
||||||
notificationPopup.closePopup(popupIndex);
|
notificationPopup.closePopup(popupIndex);
|
||||||
return;
|
return;
|
||||||
|
|
@ -615,7 +589,7 @@ Item {
|
||||||
|
|
||||||
height: Kirigami.Units.gridUnit * 2
|
height: Kirigami.Units.gridUnit * 2
|
||||||
|
|
||||||
enabled: !notificationPopup.isConvergence && !notificationPopup.popupDrawerOpened && (notificationPopup.popupCount - popupNotifications.currentPopupIndex > 1)
|
enabled: !notificationPopup.popupDrawerOpened && (notificationPopup.popupCount - popupNotifications.currentPopupIndex > 1)
|
||||||
|
|
||||||
onReleased: {
|
onReleased: {
|
||||||
notificationPopup.openPopupDrawer();
|
notificationPopup.openPopupDrawer();
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import QtQuick.Window
|
||||||
import org.kde.kirigami as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
import org.kde.plasma.private.mobileshell as MobileShell
|
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.shellsettingsplugin as ShellSettings
|
|
||||||
|
|
||||||
import org.kde.layershell 1.0 as LayerShell
|
import org.kde.layershell 1.0 as LayerShell
|
||||||
|
|
||||||
|
|
@ -32,7 +31,6 @@ Window {
|
||||||
readonly property int popupWidth: Math.min(Kirigami.Units.gridUnit * 20, Screen.width - Kirigami.Units.gridUnit * 2)
|
readonly property int popupWidth: Math.min(Kirigami.Units.gridUnit * 20, Screen.width - Kirigami.Units.gridUnit * 2)
|
||||||
readonly property real openOffset: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 3
|
readonly property real openOffset: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 3
|
||||||
readonly property int longestLength: Math.max(Screen.width, Screen.height)
|
readonly property int longestLength: Math.max(Screen.width, Screen.height)
|
||||||
readonly property bool isConvergence: ShellSettings.Settings.convergenceModeEnabled
|
|
||||||
property var keyboardInteractivity: LayerShell.Window.KeyboardInteractivityNone
|
property var keyboardInteractivity: LayerShell.Window.KeyboardInteractivityNone
|
||||||
|
|
||||||
LayerShell.Window.scope: "notification"
|
LayerShell.Window.scope: "notification"
|
||||||
|
|
@ -99,13 +97,7 @@ Window {
|
||||||
console.warn("popupNotification: could not retrieve current popup height - falling back to a default value")
|
console.warn("popupNotification: could not retrieve current popup height - falling back to a default value")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isConvergence) {
|
ShellUtil.setInputRegion(notificationPopupManager, Qt.rect((notificationPopupManager.width - notificationPopupManager.popupWidth - Kirigami.Units.gridUnit) / 2, openOffset - Kirigami.Units.gridUnit / 2, notificationPopupManager.popupWidth + Kirigami.Units.gridUnit, popupHeight + Kirigami.Units.gridUnit * ((notifications.count - notifications.currentPopupIndex > 1) ? 4 : 1)));
|
||||||
let regionX = notificationPopupManager.width - notificationPopupManager.popupWidth - Kirigami.Units.gridUnit * 4;
|
|
||||||
let regionY = Screen.height - openOffset - popupHeight - Kirigami.Units.gridUnit;
|
|
||||||
ShellUtil.setInputRegion(notificationPopupManager, Qt.rect(regionX, regionY, notificationPopupManager.popupWidth + Kirigami.Units.gridUnit * 2, popupHeight + Kirigami.Units.gridUnit * 2));
|
|
||||||
} else {
|
|
||||||
ShellUtil.setInputRegion(notificationPopupManager, Qt.rect((notificationPopupManager.width - notificationPopupManager.popupWidth - Kirigami.Units.gridUnit) / 2, openOffset - Kirigami.Units.gridUnit / 2, notificationPopupManager.popupWidth + Kirigami.Units.gridUnit, popupHeight + Kirigami.Units.gridUnit * ((notifications.count - notifications.currentPopupIndex > 1) ? 4 : 1)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -202,12 +194,9 @@ Window {
|
||||||
delegate: NotificationPopup {
|
delegate: NotificationPopup {
|
||||||
id: popup
|
id: popup
|
||||||
|
|
||||||
x: notificationPopupManager.isConvergence
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
? (parent.width - width - Kirigami.Units.gridUnit * 2)
|
|
||||||
: (parent.width - width) / 2
|
|
||||||
z: notifications.count - index
|
z: notifications.count - index
|
||||||
|
|
||||||
isConvergence: notificationPopupManager.isConvergence
|
|
||||||
popupWidth: notificationPopupManager.popupWidth
|
popupWidth: notificationPopupManager.popupWidth
|
||||||
openOffset: notificationPopupManager.openOffset
|
openOffset: notificationPopupManager.openOffset
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ QMap<QString, QMap<QString, QVariant>> getKwinrcSettings(KSharedConfig::Ptr m_mo
|
||||||
{
|
{
|
||||||
{"blurEnabled", false}, // disable blur for performance reasons, we could reconsider in the future for more powerful devices
|
{"blurEnabled", false}, // disable blur for performance reasons, we could reconsider in the future for more powerful devices
|
||||||
{"convergentwindowsEnabled", true}, // enable our convergent window plugin
|
{"convergentwindowsEnabled", true}, // enable our convergent window plugin
|
||||||
{"mobiletaskswitcherEnabled", !convergenceModeEnabled}, // mobile task switcher on phone only; convergence uses standard Alt-Tab tabbox
|
{"mobiletaskswitcherEnabled", true}, // ensure the mobile task switcher plugin is enabled
|
||||||
{"overviewEnabled", convergenceModeEnabled}, // enable KWin Overview effect in convergence mode for desktop-style task switching
|
{"overviewEnabled", convergenceModeEnabled}, // enable KWin Overview effect in convergence mode for desktop-style task switching
|
||||||
{"screenedgeEnabled", convergenceModeEnabled} // enable screen edge visual feedback in convergence mode (mouse hot corners)
|
{"screenedgeEnabled", convergenceModeEnabled} // enable screen edge visual feedback in convergence mode (mouse hot corners)
|
||||||
}},
|
}},
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
SPDX-FileCopyrightText: 2026 Marco Allegretti.
|
SPDX-FileCopyrightText: 2025 Marco A.
|
||||||
SPDX-License-Identifier: EUPL-1.2
|
SPDX-License-Identifier: EUPL-1.2
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
SPDX-FileCopyrightText: 2026 Marco Allegretti.
|
SPDX-FileCopyrightText: 2025 Marco A.
|
||||||
SPDX-License-Identifier: EUPL-1.2
|
SPDX-License-Identifier: EUPL-1.2
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
SPDX-FileCopyrightText: 2026 Marco Allegretti.
|
SPDX-FileCopyrightText: 2025 Marco A.
|
||||||
SPDX-License-Identifier: EUPL-1.2
|
SPDX-License-Identifier: EUPL-1.2
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
SPDX-FileCopyrightText: 2026 Marco Allegretti.
|
SPDX-FileCopyrightText: 2025 Marco A.
|
||||||
SPDX-License-Identifier: EUPL-1.2
|
SPDX-License-Identifier: EUPL-1.2
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
SPDX-FileCopyrightText: 2026 Marco Allegretti.
|
SPDX-FileCopyrightText: 2025 Marco A.
|
||||||
SPDX-License-Identifier: EUPL-1.2
|
SPDX-License-Identifier: EUPL-1.2
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
SPDX-FileCopyrightText: 2026 Marco Allegretti.
|
SPDX-FileCopyrightText: 2025 Marco A.
|
||||||
SPDX-License-Identifier: EUPL-1.2
|
SPDX-License-Identifier: EUPL-1.2
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue