diff --git a/.gitignore b/.gitignore index 71668c77..48f1d351 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,9 @@ # SPDX-License-Identifier: CC0-1.0 build -*.config -*.creator -*.files +*.config +*.creator +*.files *.includes *.user diff --git a/LICENSES/BSD-3-Clause.txt b/LICENSES/BSD-3-Clause.txt index ea890afb..086d3992 100644 --- a/LICENSES/BSD-3-Clause.txt +++ b/LICENSES/BSD-3-Clause.txt @@ -1,4 +1,4 @@ -Copyright (c) . +Copyright (c) . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/LICENSES/CC0-1.0.txt b/LICENSES/CC0-1.0.txt index 7ae4dc1b..6ca207ef 100644 --- a/LICENSES/CC0-1.0.txt +++ b/LICENSES/CC0-1.0.txt @@ -119,4 +119,4 @@ express Statement of Purpose. d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work. - + diff --git a/LICENSES/LGPL-3.0-only.txt b/LICENSES/LGPL-3.0-only.txt index 9e2e9f78..f076143c 100644 --- a/LICENSES/LGPL-3.0-only.txt +++ b/LICENSES/LGPL-3.0-only.txt @@ -93,7 +93,7 @@ that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. -1) Use a suitable shared library mechanism for linking with the Library. +1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the diff --git a/README.md b/README.md index d896bf4d..7e053f1f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ diff --git a/components/mobileshell/qml/actiondrawer/ActionDrawer.qml b/components/mobileshell/qml/actiondrawer/ActionDrawer.qml index 480680c3..bbe0de7b 100644 --- a/components/mobileshell/qml/actiondrawer/ActionDrawer.qml +++ b/components/mobileshell/qml/actiondrawer/ActionDrawer.qml @@ -17,17 +17,17 @@ import org.kde.kirigami 2.20 as Kirigami Item { id: root - + /** * The model for the notification widget. */ property var notificationModel - + /** * The model type for the notification widget. */ property var notificationModelType: MobileShell.NotificationsModelType.NotificationsModel - + /** * The notification settings object to be used in the notification widget. */ @@ -35,21 +35,21 @@ Item { /** * Whether actions should be subject to restricted permissions (ex. lockscreen). - * + * * The permissionsRequested() signal emits when authentication is requested. */ property bool restrictedPermissions: false - + /** * The amount of pixels moved by touch/mouse in the process of opening/closing the panel. */ property real offset: 0 - + /** * Whether the panel is being dragged. */ property bool dragging: false - + /** * Whether the panel is open after touch/mouse release from the first opening swipe. */ @@ -60,52 +60,52 @@ Item { * Only applies to portrait mode. */ property bool openToPinnedMode: true - + /** * Direction the panel is currently moving in. */ property int direction: MobileShell.Direction.None - + /** * The notifications widget being shown. May be null. */ property var notificationsWidget: contentContainerLoader.item.notificationsWidget - + /** * The mode of the action drawer (portrait or landscape). */ property int mode: (height > width && width <= largePortraitThreshold) ? ActionDrawer.Portrait : ActionDrawer.Landscape - + /** * At some point, even if the screen is technically portrait, if we have a ton of width it'd be best to just show the landscape mode. */ readonly property real largePortraitThreshold: Kirigami.Units.gridUnit * 35 - + enum Mode { Portrait = 0, Landscape } - + /** * Emitted when the drawer has closed. */ signal drawerClosed() - + /** * Emitted when the drawer has opened. */ signal drawerOpened() - + /** * Emitted when permissions are requested (ex. unlocking the phone). - * + * * Only gets emitted when restrictedPermissions is set to true. */ signal permissionsRequested() - + /** * Runs the held notification action that was pending for authentication. - * + * * Should be called by users if authentication is successful after permissionsRequested() was emitted. */ signal runPendingNotificationAction() @@ -119,13 +119,13 @@ Item { if (offset < 0) { offset = 0; } - - root.direction = (oldOffset === offset) - ? MobileShell.Direction.None + + root.direction = (oldOffset === offset) + ? MobileShell.Direction.None : (offset > oldOffset ? MobileShell.Direction.Down : MobileShell.Direction.Up); - + oldOffset = offset; - + // close panel immediately after panel is not shown, and the flickable is not being dragged if (opened && root.offset <= 0 && !swipeArea.moving && !closeAnim.running && !openAnim.running) { root.updateState(); @@ -137,7 +137,7 @@ Item { closeAnim.stop(); openAnim.stop(); } - + function open() { cancelAnimations(); if (openToPinnedMode) { @@ -146,36 +146,36 @@ Item { expandAnim.restart(); // go to maximized height } } - + function closeImmediately() { cancelAnimations(); offset = 0; closeAnim.finished(); } - + function close() { cancelAnimations(); closeAnim.restart(); } - + function expand() { cancelAnimations(); expandAnim.restart(); } - + function updateState() { cancelAnimations(); let openThreshold = Kirigami.Units.gridUnit; - + if (root.offset <= 0) { - // close immediately, so that we don't have to wait Kirigami.Units.longDuration + // close immediately, so that we don't have to wait Kirigami.Units.longDuration root.visible = false; close(); } else if (root.direction === MobileShell.Direction.None || !root.opened) { - + // if the panel has not been opened yet, run open animation only if drag passed threshold (root.offset < openThreshold) ? close() : open(); - + } else if (root.offset > contentContainerLoader.maximizedQuickSettingsOffset) { // if drag has gone past the fully expanded view expand(); @@ -187,7 +187,7 @@ Item { // go back to pinned, or close if pinned mode is disabled openToPinnedMode ? open() : close(); } - + } else if (root.direction === MobileShell.Direction.Down) { // if drag is between pinned view and open view, and dragging down open(); @@ -226,7 +226,7 @@ Item { to: contentContainerLoader.maximizedQuickSettingsOffset onFinished: root.opened = true; } - + MobileShell.SwipeArea { id: swipeArea mode: MobileShell.SwipeArea.VerticalOnly @@ -247,14 +247,14 @@ Item { Loader { id: contentContainerLoader anchors.fill: parent - + property real minimizedQuickSettingsOffset: item ? item.minimizedQuickSettingsOffset : 0 property real maximizedQuickSettingsOffset: item ? item.maximizedQuickSettingsOffset : 0 - + asynchronous: true sourceComponent: root.mode == ActionDrawer.Portrait ? portraitContentContainer : landscapeContentContainer } - + Component { id: portraitContentContainer PortraitContentContainer { @@ -263,7 +263,7 @@ Item { height: root.height } } - + Component { id: landscapeContentContainer LandscapeContentContainer { diff --git a/components/mobileshell/qml/actiondrawer/ActionDrawerWindow.qml b/components/mobileshell/qml/actiondrawer/ActionDrawerWindow.qml index 43884588..a4b2ccc5 100644 --- a/components/mobileshell/qml/actiondrawer/ActionDrawerWindow.qml +++ b/components/mobileshell/qml/actiondrawer/ActionDrawerWindow.qml @@ -14,30 +14,30 @@ import org.kde.plasma.private.nanoshell 2.0 as NanoShell /** * Window with the ActionDrawer component embedded in it. - * + * * Used for overlaying the ActionDrawer if the original window does not cover * the whole screen. */ NanoShell.FullScreenOverlay { id: window - + /** * The ActionDrawer component. */ property alias actionDrawer: drawer - + visible: drawer.visible width: Screen.width height: Screen.height - + color: "transparent" - + onActiveChanged: { if (!active) { drawer.close(); } } - + ActionDrawer { id: drawer anchors.fill: parent diff --git a/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml b/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml index 855c362c..30c372de 100644 --- a/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml +++ b/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml @@ -21,53 +21,53 @@ import org.kde.plasma.private.mobileshell as MobileShell */ Item { id: root - + required property var actionDrawer - + property alias notificationsWidget: notificationWidget - + readonly property real minimizedQuickSettingsOffset: height readonly property real maximizedQuickSettingsOffset: height readonly property bool isOnLargeScreen: width > quickSettings.width * 2.5 readonly property real minWidthHeight: Math.min(root.width, root.height) readonly property real opacityValue: Math.max(0, Math.min(1, actionDrawer.offset / root.minimizedQuickSettingsOffset)) - + Kirigami.Theme.colorSet: Kirigami.Theme.View Kirigami.Theme.inherit: false - + // fullscreen background Rectangle { anchors.fill: parent - + // darken if there are notifications - color: Qt.rgba(Kirigami.Theme.backgroundColor.r, - Kirigami.Theme.backgroundColor.g, - Kirigami.Theme.backgroundColor.b, + color: Qt.rgba(Kirigami.Theme.backgroundColor.r, + Kirigami.Theme.backgroundColor.g, + Kirigami.Theme.backgroundColor.b, notificationWidget.hasNotifications ? 0.95 : 0.9) Behavior on color { ColorAnimation { duration: Kirigami.Units.longDuration } } opacity: opacityValue } - + P5Support.DataSource { id: timeSource engine: "time" connectedSources: ["Local"] interval: 60 * 1000 } - + MouseArea { anchors.fill: parent - + // dismiss drawer when background is clicked onClicked: root.actionDrawer.close(); - - // left side + + // left side ColumnLayout { id: columnLayout - + opacity: opacityValue spacing: 0 - + anchors { top: mediaWidget.bottom topMargin: 0 @@ -77,7 +77,7 @@ Item { left: parent.left } anchors.margins: minWidthHeight * 0.06 - + MobileShell.NotificationsWidget { id: notificationWidget historyModel: root.actionDrawer.notificationModel @@ -85,17 +85,17 @@ Item { notificationSettings: root.actionDrawer.notificationSettings actionsRequireUnlock: root.actionDrawer.restrictedPermissions onUnlockRequested: root.actionDrawer.permissionsRequested() - + Connections { target: root.actionDrawer - + function onRunPendingNotificationAction() { notificationWidget.runPendingAction(); } } - + onBackgroundClicked: root.actionDrawer.close(); - + // don't allow notifications widget to get too wide Layout.maximumWidth: Kirigami.Units.gridUnit * 25 Layout.fillHeight: true @@ -103,32 +103,32 @@ Item { Layout.topMargin: minWidthHeight * 0.02 } } - + PlasmaComponents.Label { id: clock text: Qt.formatTime(timeSource.data.Local.DateTime, MobileShell.ShellUtil.isSystem24HourFormat ? "h:mm" : "h:mm ap") verticalAlignment: Qt.AlignVCenter opacity: columnLayout.opacity - + anchors { left: parent.left top: parent.top topMargin: columnLayout.anchors.margins / 2 leftMargin: columnLayout.anchors.margins } - + font.pixelSize: Math.min(40, minWidthHeight * 0.1) font.weight: Font.ExtraLight elide: Text.ElideRight } - + PlasmaComponents.Label { id: date text: Qt.formatDate(timeSource.data.Local.DateTime, "ddd MMMM d") verticalAlignment: Qt.AlignTop color: Kirigami.Theme.disabledTextColor opacity: columnLayout.opacity - + anchors { left: parent.left top: clock.bottom @@ -140,15 +140,15 @@ Item { font.pixelSize: Math.min(20, minWidthHeight * 0.05) font.weight: Font.Light } - + MobileShell.MediaControlsWidget { id: mediaWidget property real fullHeight: visible ? height + Kirigami.Units.smallSpacing * 6 : 0 - + y: isOnLargeScreen ? date.y - height + date.implicitHeight : date.y + date.implicitHeight + columnLayout.anchors.margins / 2 - + opacity: columnLayout.opacity - + anchors { right: quickSettings.left left: isOnLargeScreen ? date.right : parent.left @@ -156,21 +156,21 @@ Item { rightMargin: columnLayout.anchors.margins - quickSettings.leftPadding } } - + // right sidebar MobileShell.QuickSettingsPanel { id: quickSettings height: quickSettings.contentImplicitHeight + quickSettings.topPadding + quickSettings.bottomPadding width: intendedWidth - + readonly property real intendedWidth: 360 - + anchors.top: parent.top anchors.right: parent.right - + actionDrawer: root.actionDrawer fullScreenHeight: root.height - + transform: Translate { id: translate property real offsetRatio: quickSettings.height / root.height diff --git a/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml b/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml index 398cf32c..336bcbaf 100644 --- a/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml +++ b/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml @@ -18,56 +18,56 @@ import org.kde.kirigami 2.20 as Kirigami */ Item { id: root - + required property var actionDrawer - + property alias notificationsWidget: notificationWidget - + // pinned position (disabled when openToPinnedMode is false) readonly property real minimizedQuickSettingsOffset: quickSettings.minimizedHeight - + // fully open position readonly property real maximizedQuickSettingsOffset: minimizedQuickSettingsOffset + quickSettings.maxAddedHeight - + Kirigami.Theme.colorSet: Kirigami.Theme.View Kirigami.Theme.inherit: false - + function applyMinMax(val) { return Math.max(0, Math.min(1, val)); } - + // fullscreen background Rectangle { anchors.fill: parent // darken if there are notifications - color: Qt.rgba(Kirigami.Theme.backgroundColor.r, - Kirigami.Theme.backgroundColor.g, - Kirigami.Theme.backgroundColor.b, + color: Qt.rgba(Kirigami.Theme.backgroundColor.r, + Kirigami.Theme.backgroundColor.g, + Kirigami.Theme.backgroundColor.b, 0.95) Behavior on color { ColorAnimation { duration: Kirigami.Units.longDuration } } opacity: Math.max(0, Math.min(1, actionDrawer.offset / root.minimizedQuickSettingsOffset)) } - + MobileShell.QuickSettingsDrawer { id: quickSettings z: 1 // ensure it's above notifications anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - + actionDrawer: root.actionDrawer - + // opacity and move animation (disabled when openToPinnedMode is false) property real offsetDist: actionDrawer.offset - minimizedQuickSettingsOffset property real totalOffsetDist: maximizedQuickSettingsOffset - minimizedQuickSettingsOffset minimizedToFullProgress: actionDrawer.openToPinnedMode ? (actionDrawer.opened ? applyMinMax(offsetDist / totalOffsetDist) : 0) : 1 - + // this drawer opens in two stages when pinned mode is enabled: // --- // stage 1: the transform effect is used, the drawer physically moves down to the pinned mode // stage 2: the rectangle increases height to reveal content, but the content stays still // when pinned mode is disabled, only stage 1 happens - + // increase height of drawer when between pinned mode <-> maximized mode addedHeight: { if (!actionDrawer.openToPinnedMode) { @@ -88,7 +88,7 @@ Item { return (quickSettings.maxAddedHeight * effectProgress) + Math.max(0, Math.min(quickSettings.maxAddedHeight, root.actionDrawer.offset - minimizedQuickSettingsOffset)); } } - + // physically move the drawer when between closed <-> pinned mode transform: Translate { id: translate @@ -96,7 +96,7 @@ Item { y: Math.min(root.actionDrawer.offset - offsetHeight, 0) } } - + MobileShell.NotificationsWidget { id: notificationWidget historyModel: root.actionDrawer.notificationModel @@ -104,17 +104,17 @@ Item { notificationSettings: root.actionDrawer.notificationSettings actionsRequireUnlock: root.actionDrawer.restrictedPermissions onUnlockRequested: root.actionDrawer.permissionsRequested() - + Connections { target: root.actionDrawer - + function onRunPendingNotificationAction() { notificationWidget.runPendingAction(); } } - + onBackgroundClicked: root.actionDrawer.close(); - + anchors { top: quickSettings.top topMargin: quickSettings.height + translate.y @@ -123,7 +123,7 @@ Item { right: parent.right } opacity: applyMinMax(root.actionDrawer.offset / root.minimizedQuickSettingsOffset) - + // HACK: there are weird issues with text rendering black regardless of opacity, just set the text to be invisible once it's out visible: opacity > 0.05 } diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/Handle.qml b/components/mobileshell/qml/actiondrawer/quicksettings/Handle.qml index 4759e07a..d30915fc 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/Handle.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/Handle.qml @@ -10,15 +10,15 @@ import org.kde.kirigami 2.20 as Kirigami Rectangle { id: handle - + signal tapped() - + implicitWidth: Kirigami.Units.gridUnit * 3 implicitHeight: 3 radius: height color: Kirigami.Theme.textColor opacity: 0.5 - + TapHandler { cursorShape: pressed ? Qt.ClosedHandCursor : Qt.PointingHandCursor onTapped: handle.tapped() diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml index 2f8a6c86..d81bdf38 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml @@ -21,7 +21,7 @@ import org.kde.kirigami 2.20 as Kirigami Item { id: root clip: true - + required property var actionDrawer required property int mode @@ -34,19 +34,19 @@ Item { readonly property real columnWidth: Math.floor(width / columns) readonly property int minimizedColumns: Math.round(Math.min(8, Math.max(5, width / intendedMinimizedColumnWidth))) readonly property real minimizedColumnWidth: Math.floor(width / minimizedColumns) - + readonly property real rowHeight: columnWidth * 0.7 readonly property real fullHeight: fullView.implicitHeight - + readonly property real intendedColumnWidth: Kirigami.Units.gridUnit * 7 readonly property real intendedMinimizedColumnWidth: Kirigami.Units.gridUnit * 4 + Kirigami.Units.smallSpacing readonly property real minimizedRowHeight: Kirigami.Units.gridUnit * 4 + Kirigami.Units.smallSpacing - + property real minimizedViewProgress: 0 property real fullViewProgress: 1 readonly property QS.QuickSettingsModel quickSettingsModel: QS.QuickSettingsModel {} - + readonly property int columnCount: Math.floor(width/columnWidth) readonly property int rowCount: { let totalRows = Math.ceil(quickSettingsCount / columnCount); @@ -56,17 +56,17 @@ Item { let maxRows = 5; // more than 5 is just disorienting let targetRows = Math.floor(Window.height * 0.65 / rowHeight); return Math.min(maxRows, Math.min(totalRows, targetRows)); - + } else if (root.mode === QuickSettings.ScrollView) { // horizontal orientation let targetRows = Math.floor(Window.height * 0.8 / rowHeight); return Math.min(totalRows, targetRows); } } - + readonly property int pageSize: rowCount * columnCount readonly property int quickSettingsCount: quickSettingsModel.count - + function resetSwipeView() { if (root.mode === QuickSettings.Pages) { pageLoader.item.view.currentIndex = 0; @@ -83,29 +83,29 @@ Item { } } } - + // view when fully open ColumnLayout { id: fullView opacity: root.fullViewProgress visible: opacity !== 0 transform: Translate { y: (1 - fullView.opacity) * root.rowHeight } - + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - + // Dynamically loads the appropriate view Loader { id: pageLoader - + Layout.fillWidth: true Layout.minimumHeight: rowCount * rowHeight asynchronous: true sourceComponent: root.mode === QuickSettings.Pages ? swipeViewComponent : scrollViewComponent } - + BrightnessItem { id: brightnessItem Layout.bottomMargin: Kirigami.Units.smallSpacing * 2 @@ -114,7 +114,7 @@ Item { Layout.fillWidth: true } } - + // view when in minimized mode RowLayout { id: minimizedView @@ -122,11 +122,11 @@ Item { opacity: root.minimizedViewProgress visible: opacity !== 0 transform: Translate { y: (1 - minimizedView.opacity) * -root.rowHeight } - + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - + Repeater { model: QS.PaginateModel { sourceModel: quickSettingsModel @@ -134,22 +134,22 @@ Item { } delegate: MobileShell.BaseItem { required property var modelData - + implicitHeight: root.minimizedRowHeight implicitWidth: root.minimizedColumnWidth horizontalPadding: (width - Kirigami.Units.gridUnit * 3) / 2 verticalPadding: (height - Kirigami.Units.gridUnit * 3) / 2 - + contentItem: QuickSettingsMinimizedDelegate { restrictedPermissions: actionDrawer.restrictedPermissions - + text: modelData.text status: modelData.status icon: modelData.icon enabled: modelData.enabled settingsCommand: modelData.settingsCommand toggleFunction: modelData.toggle - + onCloseRequested: { actionDrawer.close(); } @@ -157,28 +157,28 @@ Item { } } } - + // Loads portrait quick settings view Component { id: swipeViewComponent - + ColumnLayout { readonly property var view: swipeView - + SwipeView { id: swipeView - + Layout.fillWidth: true Layout.preferredHeight: rowCount * rowHeight - + Repeater { model: Math.ceil(quickSettingsCount / pageSize) delegate: Flow { id: flow spacing: 0 - + required property int index - + Repeater { model: QS.PaginateModel { sourceModel: quickSettingsModel @@ -187,34 +187,34 @@ Item { } delegate: Loader { required property var modelData - + asynchronous: true - + sourceComponent: quickSettingComponent } } } } } - + Loader { id: indicatorLoader - + Layout.alignment: Qt.AlignCenter Layout.topMargin: Kirigami.Units.smallSpacing Layout.leftMargin: Kirigami.Units.smallSpacing Layout.rightMargin: Kirigami.Units.smallSpacing - + // Avoid wasting space when not loaded Layout.maximumHeight: active ? item.implicitHeight : 0 - + active: swipeView.count > 1 ? true: false asynchronous: true - + sourceComponent: PageIndicator { count: swipeView.count currentIndex: swipeView.currentIndex - + delegate: Rectangle { implicitWidth: 8 implicitHeight: count > 1 ? 8 : 0 @@ -228,28 +228,28 @@ Item { } } } - + // Loads landscape quick settings view Component { id: scrollViewComponent - + Item { width: parent.width height: rowCount * rowHeight - + Flickable { id: flickable anchors.fill: parent contentWidth: width contentHeight: flow.height - + clip: true - + ScrollIndicator.vertical: ScrollIndicator { id: scrollIndicator visible: quickSettingsCount > pageSize ? true : false position: 0.1 - + contentItem: Item { implicitWidth: Kirigami.Units.smallSpacing / 4 Rectangle { @@ -257,28 +257,28 @@ Item { anchors.fill: parent anchors.leftMargin: 2 anchors.rightMargin: -2 - + color: Kirigami.Theme.textColor opacity: scrollIndicator.active ? 0.5 : 0 - + Behavior on opacity { NumberAnimation {} } } } } - + Flow { id: flow width: parent.width height: Math.ceil(quickSettingsCount / columnCount) * rowHeight spacing: 0 - + Repeater { model: quickSettingsModel delegate: Loader { required property var modelData - + asynchronous: true - + sourceComponent: quickSettingComponent } } @@ -286,11 +286,11 @@ Item { } } } - + // Quick setting component Component { id: quickSettingComponent - + MobileShell.BaseItem { height: root.rowHeight width: root.columnWidth @@ -298,14 +298,14 @@ Item { contentItem: QuickSettingsFullDelegate { restrictedPermissions: actionDrawer.restrictedPermissions - + text: modelData.text status: modelData.status icon: modelData.icon enabled: modelData.enabled settingsCommand: modelData.settingsCommand toggleFunction: modelData.toggle - + onCloseRequested: { actionDrawer.close(); } diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml index 97e9cb61..578c5158 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml @@ -20,40 +20,40 @@ import org.kde.plasma.private.mobileshell as MobileShell */ MobileShell.BaseItem { id: root - + required property var actionDrawer - + /** * The amount of height to add to the panel (increasing the height of the quick settings area). */ property real addedHeight: 0 - + /** * The maximum amount of added height to snap to the full height of the quick settings panel. */ readonly property real maxAddedHeight: quickSettings.fullHeight - minimizedQuickSettingsHeight // first row is part of minimized height - + /** * Height of panel when in minimized mode. */ readonly property real minimizedHeight: bottomPadding + topPadding + statusBar.height + minimizedQuickSettingsHeight + mediaWidget.height + handle.fullHeight - + /** * Height of just the QuickSettings component in minimized mode. */ readonly property real minimizedQuickSettingsHeight: quickSettings.minimizedRowHeight + Kirigami.Units.gridUnit - + /** * Progress of showing the full quick settings view from pinned. */ property real minimizedToFullProgress: 1 - + // we need extra padding if the background side border is enabled - topPadding: Kirigami.Units.smallSpacing - leftPadding: Kirigami.Units.smallSpacing + topPadding: Kirigami.Units.smallSpacing + leftPadding: Kirigami.Units.smallSpacing rightPadding: Kirigami.Units.smallSpacing bottomPadding: Kirigami.Units.smallSpacing * 4 - + background: KSvg.FrameSvgItem { enabledBorders: KSvg.FrameSvgItem.BottomBorder imagePath: "widgets/background" @@ -62,7 +62,7 @@ MobileShell.BaseItem { contentItem: Item { id: containerItem implicitHeight: column.implicitHeight - + // use container item so that our column doesn't get stretched if base item is anchored ColumnLayout { id: column @@ -70,29 +70,29 @@ MobileShell.BaseItem { anchors.right: parent.right anchors.top: parent.top spacing: 0 - + MobileShell.StatusBar { id: statusBar Layout.fillWidth: true Layout.preferredHeight: MobileShell.Constants.topPanelHeight + Kirigami.Units.gridUnit * 0.8 - + Kirigami.Theme.colorSet: Kirigami.Theme.Window Kirigami.Theme.inherit: false backgroundColor: "transparent" showSecondRow: true showDropShadow: false - + // security reasons, system tray also doesn't work on lockscreen disableSystemTray: actionDrawer.restrictedPermissions } - + MobileShell.QuickSettings { id: quickSettings Layout.preferredHeight: root.minimizedQuickSettingsHeight + root.addedHeight Layout.topMargin: Kirigami.Units.smallSpacing Layout.fillWidth: true - + mode: QuickSettings.Pages actionDrawer: root.actionDrawer minimizedViewProgress: 1 - root.minimizedToFullProgress @@ -100,7 +100,7 @@ MobileShell.BaseItem { height: root.minimizedQuickSettingsHeight + root.addedHeight width: parent.width } - + MobileShell.MediaControlsWidget { id: mediaWidget property real fullHeight: height + Layout.topMargin @@ -109,13 +109,13 @@ MobileShell.BaseItem { Layout.leftMargin: Kirigami.Units.largeSpacing Layout.rightMargin: Kirigami.Units.largeSpacing } - + Handle { id: handle property real fullHeight: height + Layout.topMargin Layout.alignment: Qt.AlignHCenter Layout.topMargin: Kirigami.Units.smallSpacing * 2 - + onTapped: { if (root.minimizedToFullProgress < 0.5) { root.actionDrawer.expand(); diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml index 210df77b..b8809546 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml @@ -19,22 +19,22 @@ import org.kde.plasma.core as PlasmaCore */ MobileShell.BaseItem { id: root - + required property var actionDrawer - + required property real fullScreenHeight - + /** * Implicit height of the contents of the panel. */ readonly property real contentImplicitHeight: column.implicitHeight - + // we need extra padding since the background side border is enabled topPadding: Kirigami.Units.smallSpacing * 4 leftPadding: Kirigami.Units.smallSpacing * 4 rightPadding: Kirigami.Units.smallSpacing * 4 bottomPadding: Kirigami.Units.smallSpacing * 4 - + background: KSvg.FrameSvgItem { enabledBorders: KSvg.FrameSvgItem.AllBorders imagePath: "widgets/background" @@ -42,7 +42,7 @@ MobileShell.BaseItem { contentItem: Item { id: containerItem - + // use container item so that our column doesn't get stretched if base item is anchored ColumnLayout { id: column @@ -51,14 +51,14 @@ MobileShell.BaseItem { anchors.top: parent.top height: root.fullScreenHeight spacing: 0 - + MobileShell.StatusBar { id: statusBar Layout.alignment: Qt.AlignTop Layout.fillWidth: true Layout.preferredHeight: Kirigami.Units.gridUnit * 1.5 Layout.maximumHeight: Kirigami.Units.gridUnit * 1.5 - + Kirigami.Theme.colorSet: Kirigami.Theme.Window Kirigami.Theme.inherit: false @@ -66,31 +66,31 @@ MobileShell.BaseItem { showSecondRow: false showDropShadow: false showTime: false - + // security reasons, system tray also doesn't work on lockscreen disableSystemTray: actionDrawer.restrictedPermissions } - + MobileShell.QuickSettings { id: quickSettings - + mode: QuickSettings.ScrollView width: column.width implicitHeight: quickSettings.fullHeight - + Layout.alignment: Qt.AlignTop Layout.fillWidth: true Layout.maximumHeight: root.fullScreenHeight - root.topPadding - root.bottomPadding - statusBar.height - Kirigami.Units.smallSpacing Layout.maximumWidth: column.width - + actionDrawer: root.actionDrawer minimizedViewProgress: 0 fullViewProgress: 1 } - + Item { Layout.fillHeight: true } } - + Handle { id: handle anchors.horizontalCenter: parent.horizontalCenter diff --git a/components/mobileshell/qml/components/BaseItem.qml b/components/mobileshell/qml/components/BaseItem.qml index 08c796cb..e44898d5 100644 --- a/components/mobileshell/qml/components/BaseItem.qml +++ b/components/mobileshell/qml/components/BaseItem.qml @@ -4,18 +4,18 @@ import QtQuick 2.15 /** - * Serves a similar function as a QQC2.Control, but does not + * Serves a similar function as a QQC2.Control, but does not * take touch input events, preventing conflicts with Flickable. */ Item { id: root - + property real topInset: 0 property real bottomInset: 0 property real leftInset: 0 property real rightInset: 0 - + property real padding: 0 property real verticalPadding: padding property real horizontalPadding: padding @@ -23,10 +23,10 @@ Item { property real bottomPadding: verticalPadding property real leftPadding: horizontalPadding property real rightPadding: horizontalPadding - + property Item contentItem: Item {} property Item background: Item {} - + implicitHeight: topPadding + bottomPadding + contentItem.implicitHeight implicitWidth: leftPadding + rightPadding + contentItem.implicitWidth @@ -34,12 +34,12 @@ Item { contentItem.parent = contentItemLoader; contentItem.anchors.fill = contentItemLoader; } - + onBackgroundChanged: { background.parent = backgroundLoader; background.anchors.fill = backgroundLoader; } - + Item { id: backgroundLoader anchors.fill: parent @@ -48,7 +48,7 @@ Item { anchors.topMargin: root.topInset anchors.bottomMargin: root.bottomInset } - + Item { id: contentItemLoader anchors.fill: parent diff --git a/components/mobileshell/qml/components/ExtendedAbstractButton.qml b/components/mobileshell/qml/components/ExtendedAbstractButton.qml index cce3fbe5..1065e51f 100644 --- a/components/mobileshell/qml/components/ExtendedAbstractButton.qml +++ b/components/mobileshell/qml/components/ExtendedAbstractButton.qml @@ -6,29 +6,29 @@ import QtQuick.Controls 2.15 as QQC2 /** * This component is an AbstractButton with some added functionality to simulate a MouseArea. - * + * * The hovered property of AbstractButton is much more accurate than the containsMouse property of MouseArea, * and so this is useful for creating custom buttons. */ QQC2.AbstractButton { id: root - + /** * The cursor shape when the mouse is over the button. */ property alias cursorShape: hoverHandler.cursorShape - + /** * Alias to MouseArea used in the button. */ property alias mouseArea: mouseArea - + /** * Whether a mouse is hovering over the button (not touch). */ readonly property bool mouseHovered: hoverHandler.hovered - + /** * Signal that is emitted when the right click button is pressed. */ @@ -46,7 +46,7 @@ QQC2.AbstractButton { } } } - + HoverHandler { id: hoverHandler acceptedDevices: PointerDevice.Mouse diff --git a/components/mobileshell/qml/components/MarqueeLabel.qml b/components/mobileshell/qml/components/MarqueeLabel.qml index 95dd4a52..41a80c44 100644 --- a/components/mobileshell/qml/components/MarqueeLabel.qml +++ b/components/mobileshell/qml/components/MarqueeLabel.qml @@ -12,26 +12,26 @@ import org.kde.plasma.components 3.0 as PlasmaComponents PlasmaComponents.Label { id: root - + required property string inputText readonly property string filteredText: inputText.replace(/\n/g, ' ') // remove new line characters - + readonly property int interval: 200 // update position every 200 ms readonly property int longDuration: 300 - readonly property int waitDuration: 900 - + readonly property int waitDuration: 900 + readonly property int charactersOverflow: Math.ceil((txtMeter.advanceWidth - root.width) / (txtMeter.advanceWidth / filteredText.length)) property int step: 0 - + TextMetrics { id: txtMeter font: root.font text: filteredText } - - Timer { + + Timer { property bool paused: false - + interval: root.interval running: visible && charactersOverflow > 0 repeat: true @@ -52,13 +52,13 @@ PlasmaComponents.Label { } } } - + onRunningChanged: { if (!running) { step = 0; } } } - + text: filteredText.substring(step, step + filteredText.length - charactersOverflow) } diff --git a/components/mobileshell/qml/components/PopupMenu.qml b/components/mobileshell/qml/components/PopupMenu.qml index 0d07702f..7c3d0a99 100644 --- a/components/mobileshell/qml/components/PopupMenu.qml +++ b/components/mobileshell/qml/components/PopupMenu.qml @@ -96,5 +96,5 @@ NanoShell.FullScreenOverlay { } } } - + } diff --git a/components/mobileshell/qml/components/VelocityCalculator.qml b/components/mobileshell/qml/components/VelocityCalculator.qml index 8f4b55c0..5c5f36ec 100644 --- a/components/mobileshell/qml/components/VelocityCalculator.qml +++ b/components/mobileshell/qml/components/VelocityCalculator.qml @@ -10,27 +10,27 @@ import QtQuick 2.15 QtObject { id: root - + property bool zeroVelocityCounts: false - + property real velocity: 0 - + function changePosition(position) { __pushDragEvent(position); } - + function startMeasure(position) { __dragEvents = []; __pushDragEvent(position); } - + //BEGIN internal - + property var __dragEvents: [] property var __dateTime: new function() { this.getCurrentTimeMs = function() {return new Date().getTime()} } - + function __updateSpeed() { var totalSpeed = 0; for (var i = 0; i < __dragEvents.length; i++) { @@ -61,13 +61,13 @@ QtObject { return 0; } } - + function __pushDragEvent(position) { let currentTime = __dateTime.getCurrentTimeMs(); __dragEvents.push([currentTime, position, __getEventSpeed(currentTime, position)]); __cullOldDragEvents(currentTime); __updateSpeed(); } - + //END internal } diff --git a/components/mobileshell/qml/dataproviders/BatteryInfo.qml b/components/mobileshell/qml/dataproviders/BatteryInfo.qml index 444363cd..96b4f573 100644 --- a/components/mobileshell/qml/dataproviders/BatteryInfo.qml +++ b/components/mobileshell/qml/dataproviders/BatteryInfo.qml @@ -17,7 +17,7 @@ QtObject { property bool isVisible: pmSource.data["Battery"]["Has Cumulative"] property int percent: pmSource.data["Battery"]["Percent"] property bool pluggedIn: pmSource.data["AC Adapter"] ? pmSource.data["AC Adapter"]["Plugged in"] : false - + property P5Support.DataSource pmSource: P5Support.DataSource { engine: "powermanagement" connectedSources: ["Battery", "AC Adapter"] diff --git a/components/mobileshell/qml/dataproviders/BluetoothInfo.qml b/components/mobileshell/qml/dataproviders/BluetoothInfo.qml index f880dcd6..1287aaa5 100644 --- a/components/mobileshell/qml/dataproviders/BluetoothInfo.qml +++ b/components/mobileshell/qml/dataproviders/BluetoothInfo.qml @@ -16,9 +16,9 @@ QtObject { id: root readonly property bool isVisible: BluezQt.Manager.bluetoothOperational readonly property string icon: deviceConnected ? "network-bluetooth-activated" : "network-bluetooth" - + property bool deviceConnected: false - + function updateStatus() { let connectedDevices = []; @@ -28,13 +28,13 @@ QtObject { connectedDevices.push(device); } } - + root.deviceConnected = connectedDevices.length > 0; } - + property var connections: Connections { target: BluezQt.Manager - + function onDeviceAdded() { root.updateStatus(); } @@ -51,7 +51,7 @@ QtObject { root.updateStatus(); } } - + Component.onCompleted: { updateStatus(); } diff --git a/components/mobileshell/qml/navigationpanel/NavigationPanel.qml b/components/mobileshell/qml/navigationpanel/NavigationPanel.qml index 2b68931c..cb00ad5e 100644 --- a/components/mobileshell/qml/navigationpanel/NavigationPanel.qml +++ b/components/mobileshell/qml/navigationpanel/NavigationPanel.qml @@ -17,15 +17,15 @@ import org.kde.plasma.private.mobileshell.state as MobileShellState Item { id: root - + property bool shadow: false property color backgroundColor property var foregroundColorGroup - + property NavigationPanelAction leftAction property NavigationPanelAction middleAction property NavigationPanelAction rightAction - + property NavigationPanelAction leftCornerAction property NavigationPanelAction rightCornerAction @@ -41,7 +41,7 @@ Item { shadowVerticalOffset: 1 shadowOpacity: 0.8 } - + Item { id: icons anchors.fill: parent diff --git a/components/mobileshell/qml/navigationpanel/NavigationPanelAction.qml b/components/mobileshell/qml/navigationpanel/NavigationPanelAction.qml index 6c415983..dc66f541 100644 --- a/components/mobileshell/qml/navigationpanel/NavigationPanelAction.qml +++ b/components/mobileshell/qml/navigationpanel/NavigationPanelAction.qml @@ -11,6 +11,6 @@ QtObject { property bool visible: true property string iconSource property real iconSizeFactor - + signal triggered() } diff --git a/components/mobileshell/qml/navigationpanel/NavigationPanelButton.qml b/components/mobileshell/qml/navigationpanel/NavigationPanelButton.qml index a5a2a5d6..878a12fd 100644 --- a/components/mobileshell/qml/navigationpanel/NavigationPanelButton.qml +++ b/components/mobileshell/qml/navigationpanel/NavigationPanelButton.qml @@ -28,20 +28,20 @@ Controls.AbstractButton { } onPressed: haptics.buttonVibrate() - + Rectangle { id: rect radius: height/2 anchors.fill: parent opacity: 0 color: Kirigami.Theme.textColor - + // this way of calculating animations lets the animation fully complete before switching back (tap runs the full animation) property bool buttonHeld: button.pressed && button.enabled - + onButtonHeldChanged: showBackground(buttonHeld) Component.onCompleted: showBackground(buttonHeld) - + function showBackground(show) { if (show) { if (!opacityAnimator.running && opacityAnimator.to !== 0.1) { diff --git a/components/mobileshell/qml/statusbar/ClockText.qml b/components/mobileshell/qml/statusbar/ClockText.qml index 2250f55f..11f3cc7a 100644 --- a/components/mobileshell/qml/statusbar/ClockText.qml +++ b/components/mobileshell/qml/statusbar/ClockText.qml @@ -23,9 +23,9 @@ RowLayout { PlasmaComponents.Label { id: clock - + property bool is24HourTime: MobileShell.ShellUtil.isSystem24HourFormat - + text: Qt.formatTime(source.data.Local.DateTime, is24HourTime ? "h:mm" : "h:mm ap") color: Kirigami.Theme.textColor verticalAlignment: Qt.AlignVCenter diff --git a/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml b/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml index ca5acd40..d6a1e8f9 100644 --- a/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml @@ -16,7 +16,7 @@ import org.kde.plasma.private.mobileshell as MobileShell RowLayout { property real textPixelSize: Kirigami.Units.gridUnit * 0.6 - + visible: MobileShell.BatteryInfo.isVisible PW.BatteryIcon { diff --git a/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml b/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml index a92faf78..2321d21c 100644 --- a/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/BluetoothIndicator.qml @@ -14,7 +14,7 @@ import org.kde.plasma.private.mobileshell as MobileShell Kirigami.Icon { id: connectionIcon - + source: MobileShell.BluetoothInfo.icon visible: MobileShell.BluetoothInfo.isVisible diff --git a/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml b/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml index e2d647f4..64b10dfd 100644 --- a/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/SignalStrengthIndicator.qml @@ -15,13 +15,13 @@ import org.kde.plasma.private.mobileshell as MobileShell Item { property InternetIndicator internetIndicator - + // check if the internet indicator icon is a mobile data related one readonly property bool isInternetIndicatorMobileData: internetIndicator && internetIndicator.icon && internetIndicator.icon.startsWith('network-mobile-') - + property bool showLabel: true property real textPixelSize: Kirigami.Units.gridUnit * 0.6 - + width: strengthIcon.width + label.width Layout.minimumWidth: strengthIcon.width + label.width @@ -33,11 +33,11 @@ Item { height: parent.height source: MobileShell.SignalStrengthInfo.icon - + // don't show mobile indicator icon if the networkmanager one is already showing visible: (!isInternetIndicatorMobileData || wirelessStatus.hotspotSSID.length !== 0) && MobileShell.SignalStrengthInfo.showIndicator } - + PlasmaComponents.Label { id: label visible: showLabel diff --git a/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml b/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml index 249326b3..7572ab9e 100644 --- a/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/VolumeIndicator.qml @@ -16,7 +16,7 @@ import org.kde.plasma.private.mobileshell as MobileShell Kirigami.Icon { id: paIcon - + source: MobileShell.AudioInfo.icon visible: MobileShell.AudioInfo.isVisible diff --git a/components/mobileshell/qml/volumeosd/AudioApplet.qml b/components/mobileshell/qml/volumeosd/AudioApplet.qml index 313e75d3..20e1953e 100644 --- a/components/mobileshell/qml/volumeosd/AudioApplet.qml +++ b/components/mobileshell/qml/volumeosd/AudioApplet.qml @@ -20,7 +20,7 @@ import org.kde.plasma.private.volume // capture presses on the audio applet so it doesn't close the overlay ColumnLayout { spacing: 0 - + PulseObjectFilterModel { id: paSinkFilterModel sortRoleName: "SortByDefault" @@ -46,14 +46,14 @@ ColumnLayout { } // ui elements - + PopupCard { Layout.alignment: Qt.AlignHCenter Layout.bottomMargin: Kirigami.Units.gridUnit contentItem: ColumnLayout { anchors.rightMargin: Kirigami.Units.smallSpacing anchors.leftMargin: Kirigami.Units.smallSpacing - + Kirigami.Heading { level: 2 text: i18n("Outputs") @@ -61,11 +61,11 @@ ColumnLayout { Layout.topMargin: Kirigami.Units.smallSpacing Layout.leftMargin: Kirigami.Units.smallSpacing } - + Repeater { id: sinkView Layout.fillWidth: true - + model: paSinkFilterModel delegate: DeviceListItem { Layout.fillWidth: true @@ -76,14 +76,14 @@ ColumnLayout { } } } - + PopupCard { Layout.alignment: Qt.AlignHCenter Layout.bottomMargin: Kirigami.Units.gridUnit contentItem: ColumnLayout { anchors.rightMargin: Kirigami.Units.smallSpacing anchors.leftMargin: Kirigami.Units.smallSpacing - + Kirigami.Heading { level: 2 text: i18n("Inputs") @@ -91,11 +91,11 @@ ColumnLayout { Layout.topMargin: Kirigami.Units.smallSpacing Layout.leftMargin: Kirigami.Units.smallSpacing } - + Repeater { id: sourceView Layout.fillWidth: true - + model: paSourceFilterModel delegate: DeviceListItem { Layout.fillWidth: true @@ -106,7 +106,7 @@ ColumnLayout { } } } - + PopupCard { visible: sourceInputView.model.count + sourceMediaInputView.model.count !== 0 Layout.alignment: Qt.AlignHCenter @@ -114,7 +114,7 @@ ColumnLayout { contentItem: ColumnLayout { anchors.rightMargin: Kirigami.Units.smallSpacing anchors.leftMargin: Kirigami.Units.smallSpacing - + Kirigami.Heading { level: 2 text: i18n("Playback Streams") @@ -122,11 +122,11 @@ ColumnLayout { Layout.topMargin: Kirigami.Units.smallSpacing Layout.leftMargin: Kirigami.Units.smallSpacing } - + Repeater { id: sourceMediaInputView Layout.fillWidth: true - + model: PulseObjectFilterModel { filters: [ { role: "Name", value: "sink-input-by-media-role:event" } ] sourceModel: StreamRestoreModel {} @@ -139,11 +139,11 @@ ColumnLayout { devicesModel: sourceView.model } } - + Repeater { id: sourceInputView Layout.fillWidth: true - + model: PulseObjectFilterModel { filters: [ { role: "VirtualStream", value: false } ] sourceModel: SinkInputModel {} @@ -159,7 +159,7 @@ ColumnLayout { } } } - + PopupCard { visible: sourceOutputView.model.count !== 0 Layout.alignment: Qt.AlignHCenter @@ -167,7 +167,7 @@ ColumnLayout { contentItem: ColumnLayout { anchors.rightMargin: Kirigami.Units.smallSpacing anchors.leftMargin: Kirigami.Units.smallSpacing - + Kirigami.Heading { level: 2 text: i18n("Recording Streams") @@ -175,11 +175,11 @@ ColumnLayout { Layout.topMargin: Kirigami.Units.smallSpacing Layout.leftMargin: Kirigami.Units.smallSpacing } - + Repeater { id: sourceOutputView Layout.fillWidth: true - + model: PulseObjectFilterModel { filters: [ { role: "VirtualStream", value: false } ] sourceModel: SourceOutputModel {} diff --git a/components/mobileshell/qml/volumeosd/ListItemBase.qml b/components/mobileshell/qml/volumeosd/ListItemBase.qml index e6cebaeb..3d702142 100644 --- a/components/mobileshell/qml/volumeosd/ListItemBase.qml +++ b/components/mobileshell/qml/volumeosd/ListItemBase.qml @@ -23,21 +23,21 @@ import "icon.js" as Icon // adapted from https://invent.kde.org/plasma/plasma-pa/-/blob/master/applet/contents/ui/ListItemBase.qml Controls.ItemDelegate { id: baseItem - + property string label property alias listIcon: clientIcon.source property string type // sink, source, source-output - + onClicked: { if (selectButton.visible) { model.PulseObject.default = true; } } - + contentItem: RowLayout { id: row spacing: Kirigami.Units.smallSpacing - + PlasmaComponents.RadioButton { id: selectButton Layout.alignment: Qt.AlignTop @@ -46,7 +46,7 @@ Controls.ItemDelegate { visible: (baseItem.type == "sink" && sinkView.model.count > 1) || (baseItem.type == "source" && sourceView.model.count > 1) onClicked: model.PulseObject.default = true } - + // application icon Kirigami.Icon { id: clientIcon @@ -62,17 +62,17 @@ Controls.ItemDelegate { } } } - + ColumnLayout { Layout.alignment: Qt.AlignVCenter Layout.fillWidth: true spacing: Kirigami.Units.smallSpacing - + RowLayout { Layout.fillWidth: true spacing: Kirigami.Units.smallSpacing Layout.alignment: Qt.AlignBottom - + PlasmaComponents.Label { id: mainLabel text: baseItem.label @@ -80,7 +80,7 @@ Controls.ItemDelegate { Layout.fillWidth: true elide: Text.ElideRight } - + PlasmaComponents.ToolButton { Layout.alignment: Qt.AlignBottom Layout.bottomMargin: -Kirigami.Units.smallSpacing @@ -95,7 +95,7 @@ Controls.ItemDelegate { PlasmaComponents.ToolTip { text: i18n("Show additional options for %1", baseItem.label) } - + ListItemMenu { id: contextMenu pulseObject: model.PulseObject @@ -123,17 +123,17 @@ Controls.ItemDelegate { } } } - + RowLayout { Layout.fillWidth: true spacing: Kirigami.Units.smallSpacing - + // this slider was effectively copied from the source (linked at the top of the file) PlasmaComponents.Slider { id: slider Layout.fillWidth: true Layout.alignment: Qt.AlignTop - + // Helper properties to allow async slider updates. // While we are sliding we must not react to value updates // as otherwise we can easily end up in a loop where value @@ -141,14 +141,14 @@ Controls.ItemDelegate { property int volume: Volume property bool ignoreValueChange: true readonly property bool forceRaiseMaxVolume: volume >= PulseAudio.NormalVolume * 1.01 - + from: PulseAudio.MinimalVolume to: PulseAudio.NormalVolume stepSize: to / (to / PulseAudio.NormalVolume * 100.0) visible: HasVolume enabled: VolumeWritable opacity: Muted ? 0.5 : 1 - + Accessible.name: i18nc("Accessibility data on volume slider", "Adjust volume for %1", baseItem.label) background: KSvg.FrameSvgItem { @@ -247,7 +247,7 @@ Controls.ItemDelegate { } } } - + function setVolumeByPercent(targetPercent) { model.PulseObject.volume = Math.round(PulseAudio.NormalVolume * (targetPercent/100)); } diff --git a/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml b/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml index 1ee9a125..7afb7ce7 100644 --- a/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml +++ b/components/mobileshell/qml/widgets/krunner/KRunnerWidget.qml @@ -19,7 +19,7 @@ import org.kde.milou as Milou import org.kde.kirigami 2.19 as Kirigami /** - * Search widget that is embedded into the homescreen. The dimensions of + * Search widget that is embedded into the homescreen. The dimensions of * the root item is assumed to be the available screen area for applications. */ Item { @@ -35,22 +35,22 @@ Item { queryField.text = ""; flickable.contentY = closedContentY; } - + function updateGestureOffset(yOffset) { flickable.contentY = Math.max(0, Math.min(closedContentY, flickable.contentY + yOffset)); } - + // call when the touch gesture has let go function endGesture() { flickable.opening ? open() : close(); } - + // open the search widget (animated) function open() { anim.to = openedContentY; anim.restart(); } - + // close the search widget (animated) function close() { anim.to = closedContentY; @@ -59,24 +59,24 @@ Item { // emitted when an item on the ListView is triggered signal actionTriggered() - + readonly property real closedContentY: Kirigami.Units.gridUnit * 5 readonly property real openedContentY: 0 readonly property real openFactor: Math.max(0, Math.min(1, 1 - flickable.contentY / closedContentY)) readonly property bool isOpen: openFactor != 0 - + Rectangle { anchors.fill: parent color: Qt.rgba(0, 0, 0, 0.3) opacity: root.openFactor } - + onOpacityChanged: { if (opacity === 0) { close(); } } - + Keys.onPressed: event => { if (event.key === Qt.Key_Down) { listView.forceActiveFocus(); @@ -85,35 +85,35 @@ Item { Flickable { id: flickable - + anchors.fill: parent anchors.topMargin: root.topMargin anchors.bottomMargin: root.bottomMargin anchors.leftMargin: root.leftMargin anchors.rightMargin: root.rightMargin - + contentHeight: flickable.height + root.closedContentY contentY: root.closedContentY property real oldContentY: contentY property bool opening: false - + onContentYChanged: { opening = contentY < oldContentY; oldContentY = contentY; - + if (contentY !== root.openedContentY) { queryField.focus = false; } } - + onMovementEnded: root.endGesture() - + onDraggingChanged: { if (!dragging) { root.endGesture(); } } - + NumberAnimation on contentY { id: anim duration: Kirigami.Units.longDuration * 2 @@ -125,12 +125,12 @@ Item { } } } - + ColumnLayout { id: column height: flickable.height width: flickable.width - + Controls.Control { opacity: root.openFactor Layout.fillWidth: true @@ -139,14 +139,14 @@ Item { Layout.topMargin: Kirigami.Units.gridUnit Layout.leftMargin: Kirigami.Units.gridUnit Layout.rightMargin: Kirigami.Units.gridUnit - - leftPadding: Kirigami.Units.smallSpacing - rightPadding: Kirigami.Units.smallSpacing - topPadding: Kirigami.Units.smallSpacing - bottomPadding: Kirigami.Units.smallSpacing - + + leftPadding: Kirigami.Units.smallSpacing + rightPadding: Kirigami.Units.smallSpacing + topPadding: Kirigami.Units.smallSpacing + bottomPadding: Kirigami.Units.smallSpacing + background: Item { - + // shadow for search window MultiEffect { anchors.fill: parent @@ -156,7 +156,7 @@ Item { shadowVerticalOffset: 1 shadowOpacity: 0.15 } - + Rectangle { id: rectBackground anchors.fill: parent @@ -164,7 +164,7 @@ Item { radius: Kirigami.Units.smallSpacing } } - + contentItem: RowLayout { Item { implicitHeight: queryField.height @@ -183,13 +183,13 @@ Item { } } } - + Controls.ScrollView { opacity: root.openFactor === 1 ? 1 : 0 Behavior on opacity { NumberAnimation { duration: Kirigami.Units.shortDuration } } - + Layout.fillWidth: true Layout.fillHeight: listView.contentHeight > availableHeight diff --git a/components/mobileshell/qml/widgets/mediacontrols/BlurredBackground.qml b/components/mobileshell/qml/widgets/mediacontrols/BlurredBackground.qml index 5d0dfd53..26f72dad 100644 --- a/components/mobileshell/qml/widgets/mediacontrols/BlurredBackground.qml +++ b/components/mobileshell/qml/widgets/mediacontrols/BlurredBackground.qml @@ -9,10 +9,10 @@ import org.kde.kirigami 2.20 as Kirigami Item { id: root - + property string imageSource property bool darken: false - + // clip corners so that the image has rounded corners layer.enabled: true layer.effect: OpacityMask { @@ -33,16 +33,16 @@ Item { id: img source: root.imageSource asynchronous: true - + anchors.fill: parent fillMode: Image.PreserveAspectCrop - + // ensure text is readable Rectangle { anchors.fill: parent color: Qt.rgba(0, 0, 0, root.darken ? 0.8 : 0.6) } - + // apply lighten, saturate and blur effect layer.enabled: true layer.effect: MultiEffect { diff --git a/components/mobileshell/qml/widgets/mediacontrols/MediaControlsWidget.qml b/components/mobileshell/qml/widgets/mediacontrols/MediaControlsWidget.qml index 4a0d44da..e3d170c9 100644 --- a/components/mobileshell/qml/widgets/mediacontrols/MediaControlsWidget.qml +++ b/components/mobileshell/qml/widgets/mediacontrols/MediaControlsWidget.qml @@ -33,11 +33,11 @@ Item { easing.type: Easing.InOutQuad } } - + MediaControlsSource { id: mpris2Source } - + // page indicator RowLayout { z: 1 @@ -46,7 +46,7 @@ Item { anchors.bottomMargin: Kirigami.Units.smallSpacing anchors.bottom: view.bottom anchors.horizontalCenter: parent.horizontalCenter - + Repeater { model: view.count delegate: Rectangle { @@ -57,24 +57,24 @@ Item { } } } - + // list of app media widgets QQC2.SwipeView { id: view clip: true - + anchors.fill: parent - + Repeater { id: sourceRepeater model: mpris2Source.mpris2Model - + delegate: Loader { id: delegate // NOTE: model is PlayerContainer from KMpris in plasma-workspace asynchronous: true - + function getTrackName() { console.log('track name: ' + model.title); if (model.title) { @@ -108,31 +108,31 @@ Item { MobileShell.AppLaunch.launchOrActivateApp(model.desktopEntry + ".desktop"); MobileShellState.ShellDBusClient.closeActionDrawer(); } - + onClicked: { root.detailledView = !root.detailledView } - + MobileShell.BaseItem { id: playerItem anchors.fill: parent - + padding: root.padding implicitHeight: root.contentHeight + root.padding * 2 implicitWidth: root.width - + background: BlurredBackground { darken: mouseArea.pressed imageSource: model.artUrl } - + contentItem: ColumnLayout { Kirigami.Theme.colorSet: Kirigami.Theme.Complementary Kirigami.Theme.inherit: false width: playerItem.width - playerItem.leftPadding - playerItem.rightPadding spacing: Kirigami.Units.largeSpacing - + RowLayout { id: controlsRow spacing: 0 diff --git a/components/mobileshell/qml/widgets/notifications/NotificationFooterActions.qml b/components/mobileshell/qml/widgets/notifications/NotificationFooterActions.qml index d7f6e6aa..524d8ebd 100644 --- a/components/mobileshell/qml/widgets/notifications/NotificationFooterActions.qml +++ b/components/mobileshell/qml/widgets/notifications/NotificationFooterActions.qml @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2021 Devin Lin * SPDX-FileCopyrightText: 2018-2019 Kai Uwe Broulik - * + * * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL */ @@ -13,12 +13,12 @@ import org.kde.plasma.components 3.0 as PlasmaComponents Item { id: actionContainer - + required property BaseNotificationItem notification - + implicitHeight: Math.max(actionFlow.implicitHeight, replyLoader.height) visible: actionRepeater.count > 0 - + Flow { id: actionFlow width: parent.width @@ -26,7 +26,7 @@ Item { layoutDirection: Qt.RightToLeft enabled: !replyLoader.active opacity: replyLoader.active ? 0 : 1 - + Behavior on opacity { NumberAnimation { duration: Kirigami.Units.longDuration @@ -48,14 +48,14 @@ Item { label: actionLabels[i] }); } - + if (notificationItem.hasReplyAction) { buttons.unshift({ actionName: "inline-reply", label: notificationItem.replyActionLabel || i18nc("Reply to message", "Reply") }); } - + return buttons; } @@ -73,19 +73,19 @@ Item { } } } - + // inline reply field Loader { id: replyLoader width: parent.width height: active ? item.implicitHeight : 0 - + // When there is only one action and it is a reply action, show text field right away active: false visible: active opacity: active ? 1 : 0 x: active ? 0 : parent.width - + Behavior on x { NumberAnimation { duration: Kirigami.Units.longDuration @@ -109,7 +109,7 @@ Item { buttonIconName: notificationItem.replySubmitButtonIconName buttonText: notificationItem.replySubmitButtonText onReplied: notificationItem.replied(text) - + replying: replyLoader.active onBeginReplyRequested: replyLoader.beginReply() } diff --git a/components/mobileshell/qml/widgets/notifications/NotificationTimeText.qml b/components/mobileshell/qml/widgets/notifications/NotificationTimeText.qml index 9054fe1f..4d8bf269 100644 --- a/components/mobileshell/qml/widgets/notifications/NotificationTimeText.qml +++ b/components/mobileshell/qml/widgets/notifications/NotificationTimeText.qml @@ -1,7 +1,7 @@ /* * SPDX-FileCopyrightText: 2021 Devin Lin * SPDX-FileCopyrightText: 2018-2019 Kai Uwe Broulik - * + * * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL */ @@ -20,17 +20,17 @@ import org.kde.coreaddons 1.0 as KCoreAddons PlasmaComponents.Label { id: ageLabel - + property int notificationType: model.type property int jobState property QtObject jobDetails - + property var time property P5Support.DataSource timeSource - + // notification created/updated time changed onTimeChanged: updateAgoText() - + Connections { target: timeSource // clock time changed @@ -38,13 +38,13 @@ PlasmaComponents.Label { ageLabel.updateAgoText() } } - + Component.onCompleted: updateAgoText() - + function updateAgoText() { ageLabel.agoText = MobileShell.NotificationsUtils.generateNotificationHeaderAgoText(time, jobState); } - + font.pixelSize: Kirigami.Theme.defaultFont.pixelSize * 0.8 // the "n minutes ago" text, for jobs we show remaining time instead diff --git a/components/mobileshell/qml/widgets/notifications/ThumbnailStrip.qml b/components/mobileshell/qml/widgets/notifications/ThumbnailStrip.qml index 4c753682..0e82662b 100644 --- a/components/mobileshell/qml/widgets/notifications/ThumbnailStrip.qml +++ b/components/mobileshell/qml/widgets/notifications/ThumbnailStrip.qml @@ -1,6 +1,6 @@ /* * SPDX-FileCopyrightText: 2016 Kai Uwe Broulik - * + * * SPDX-License-Identifier: LGPL-2.0-or-later */ diff --git a/components/wallpaperimageplugin/qml/WallpaperPluginConfigLoader.qml b/components/wallpaperimageplugin/qml/WallpaperPluginConfigLoader.qml index 206c5e1e..8036a8cb 100644 --- a/components/wallpaperimageplugin/qml/WallpaperPluginConfigLoader.qml +++ b/components/wallpaperimageplugin/qml/WallpaperPluginConfigLoader.qml @@ -37,7 +37,7 @@ QQC2.StackView { onWallpaperPluginConfigChanged: { onWallpaperConfigurationChanged(); } - + function onWallpaperConfigurationChanged() { let wallpaperConfig = root.wallpaperPluginConfig if (!wallpaperConfig || !root.currentItem) { @@ -46,21 +46,21 @@ QQC2.StackView { wallpaperConfig.keys().forEach(key => { const cfgKey = "cfg_" + key; if (cfgKey in root.currentItem) { - + var changedSignal = root.currentItem[cfgKey + "Changed"] if (changedSignal) { changedSignal.disconnect(root.onConfigurationChanged); } root.currentItem[cfgKey] = wallpaperConfig[key]; - + changedSignal = root.currentItem[cfgKey + "Changed"] if (changedSignal) { changedSignal.connect(root.onConfigurationChanged) } - } + } }) } - + function loadSourceFile() { let wallpaperConfig = root.wallpaperPluginConfig; let wallpaperPluginSource = root.wallpaperPluginSource; @@ -71,16 +71,16 @@ QQC2.StackView { "configDialog": root.configDialog, "wallpaperConfiguration": wallpaperConfig }; - + wallpaperConfig.keys().forEach(key => { // Preview is not part of the config, only of the WallpaperObject if (!key.startsWith("Preview")) { props["cfg_" + key] = wallpaperConfig[key]; } }); - + var newItem = replace(Qt.resolvedUrl(wallpaperPluginSource), props) - + wallpaperConfig.keys().forEach(key => { const cfgKey = "cfg_" + key; if (cfgKey in root.currentItem) { diff --git a/containments/homescreens/halcyon/package/contents/ui/Clock.qml b/containments/homescreens/halcyon/package/contents/ui/Clock.qml index 96b43220..3275ae30 100644 --- a/containments/homescreens/halcyon/package/contents/ui/Clock.qml +++ b/containments/homescreens/halcyon/package/contents/ui/Clock.qml @@ -15,7 +15,7 @@ ColumnLayout { readonly property bool softwareRendering: GraphicsInfo.api === GraphicsInfo.Software readonly property bool is24HourTime: MobileShell.ShellUtil.isSystem24HourFormat - + spacing: 0 Label { @@ -23,9 +23,9 @@ ColumnLayout { color: "white" style: softwareRendering ? Text.Outline : Text.Normal styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" // no outline, doesn't matter - + Layout.fillWidth: true - + horizontalAlignment: Text.AlignLeft font.weight: Font.Bold // this font weight may switch to regular on distros that don't have a light variant @@ -34,23 +34,23 @@ ColumnLayout { layer.enabled: true layer.effect: MobileShell.TextDropShadow {} } - + Label { Layout.topMargin: Kirigami.Units.smallSpacing Layout.fillWidth: true - + horizontalAlignment: Text.AlignLeft text: Qt.formatDate(timeSource.data["Local"]["DateTime"], "ddd, MMM d") color: "white" style: softwareRendering ? Text.Outline : Text.Normal styleColor: softwareRendering ? ColorScope.backgroundColor : "transparent" // no outline, doesn't matter - + font.pointSize: 12 layer.enabled: true layer.effect: MobileShell.TextDropShadow {} } - + P5Support.DataSource { id: timeSource engine: "time" diff --git a/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml b/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml index 7a99ac2a..2da8113b 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FavoritesGrid.qml @@ -16,10 +16,10 @@ import org.kde.private.mobile.homescreen.halcyon as Halcyon MobileShell.GridView { id: root required property var searchWidget - + // don't set anchors.margins since we want everywhere to be draggable required property bool twoColumn - + signal openConfigureRequested() signal requestOpenFolder(Halcyon.ApplicationFolder folder) @@ -27,7 +27,7 @@ MobileShell.GridView { property bool openingSearchWidget: false property bool canOpenSearchWidget: false property real oldVerticalOvershoot: verticalOvershoot - + onVerticalOvershootChanged: { if (dragging && canOpenSearchWidget && verticalOvershoot < 0) { if (!openingSearchWidget) { @@ -55,7 +55,7 @@ MobileShell.GridView { TapHandler { onLongPressed: root.openConfigureRequested() } - + header: MobileShell.BaseItem { topPadding: Math.round(root.height * 0.2) bottomPadding: Kirigami.Units.gridUnit @@ -69,12 +69,12 @@ MobileShell.GridView { } contentItem: Clock {} } - + Keys.onReturnPressed: currentItem.appDelegate.launch() model: DelegateModel { id: visualModel model: Halcyon.PinnedModel - + delegate: Item { id: delegateRoot property int visualIndex: DelegateModel.itemsIndex @@ -82,21 +82,21 @@ MobileShell.GridView { width: root.cellWidth height: root.cellHeight - + function moveDragToCurrentPos(from, to) { if (from !== to) { visualModel.items.move(from, to); Halcyon.PinnedModel.moveEntry(from, to); } } - + function topDragEnter(drag) { if (transitionAnim.running || appDelegate.drag.active) return; // don't do anything when reordering - + let fromIndex = drag.source.visualIndex; let delegateVisualIndex = appDelegate.visualIndex; let reorderIndex = -1; - + if (fromIndex < delegateVisualIndex) { // dragged item from above // move to spot above reorderIndex = delegateVisualIndex - (root.twoColumn ? 2 : 1); @@ -104,19 +104,19 @@ MobileShell.GridView { // move to current spot reorderIndex = delegateVisualIndex; } - + if (reorderIndex >= 0 && reorderIndex < root.count) { delegateRoot.moveDragToCurrentPos(fromIndex, reorderIndex) } } - + function bottomDragEnter(drag) { if (transitionAnim.running || appDelegate.drag.active) return; // don't do anything when reordering - + let fromIndex = drag.source.visualIndex; let delegateVisualIndex = appDelegate.visualIndex; let reorderIndex = -1; - + if (fromIndex < delegateVisualIndex) { // dragged item from above // move to current spot reorderIndex = delegateVisualIndex; @@ -124,7 +124,7 @@ MobileShell.GridView { // move to spot below reorderIndex = delegateVisualIndex + (root.twoColumn ? 2 : 1); } - + if (reorderIndex >= 0 && reorderIndex < root.count) { delegateRoot.moveDragToCurrentPos(fromIndex, reorderIndex); } @@ -139,7 +139,7 @@ MobileShell.GridView { height: delegateRoot.height * 0.2 onEntered: (drag) => delegateRoot.topDragEnter(drag) } - + // bottom drop area DropArea { id: bottomDropArea @@ -149,7 +149,7 @@ MobileShell.GridView { height: delegateRoot.height * 0.2 onEntered: (drag) => delegateRoot.bottomDragEnter(drag) } - + // left drop area DropArea { id: leftDropArea @@ -159,7 +159,7 @@ MobileShell.GridView { width: root.twoColumn ? Math.max(appDelegate.leftPadding, delegateRoot.width * 0.1) : 0 onEntered: (drag) => delegateRoot.topDragEnter(drag) } - + // right drop area DropArea { id: rightDropArea @@ -169,7 +169,7 @@ MobileShell.GridView { width: root.twoColumn ? Math.max(appDelegate.rightPadding, delegateRoot.width * 0.1) : 0 onEntered: (drag) => delegateRoot.bottomDragEnter(drag) } - + // folder drop area DropArea { anchors.top: topDropArea.bottom @@ -195,7 +195,7 @@ MobileShell.GridView { folderAnim.to = 0; folderAnim.restart(); } - + NumberAnimation { id: folderAnim target: appDelegate @@ -203,18 +203,18 @@ MobileShell.GridView { duration: 100 } } - + // actual visual delegate FavoritesAppDelegate { id: appDelegate visualIndex: delegateRoot.visualIndex - + isFolder: model.isFolder folder: model.folder application: model.application - + onFolderOpenRequested: root.requestOpenFolder(model.folder) - + menuActions: [ Kirigami.Action { icon.name: "emblem-favorite" @@ -222,13 +222,13 @@ MobileShell.GridView { onTriggered: Halcyon.PinnedModel.removeEntry(model.index) } ] - + implicitWidth: root.cellWidth implicitHeight: visible ? root.cellHeight : 0 - + anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - + states: [ State { when: appDelegate.drag.active @@ -236,7 +236,7 @@ MobileShell.GridView { target: appDelegate parent: root } - + AnchorChanges { target: appDelegate anchors.horizontalCenter: undefined @@ -247,7 +247,7 @@ MobileShell.GridView { } } } - + // animations displaced: Transition { NumberAnimation { @@ -256,21 +256,21 @@ MobileShell.GridView { easing.type: Easing.OutQuad } } - + ColumnLayout { id: placeholder spacing: Kirigami.Units.gridUnit visible: root.count == 0 opacity: 0.9 - + anchors.fill: parent anchors.topMargin: Math.round(swipeView.height * 0.2) - (root.contentY - root.originY) anchors.leftMargin: root.leftMargin anchors.rightMargin: root.rightMargin - + layer.enabled: true layer.effect: MobileShell.TextDropShadow {} - + Kirigami.Icon { id: icon Layout.alignment: Qt.AlignBottom | Qt.AlignHCenter @@ -279,7 +279,7 @@ MobileShell.GridView { source: "arrow-left" color: "white" } - + Kirigami.Heading { Layout.fillWidth: true Layout.maximumWidth: placeholder.width * 0.75 @@ -290,7 +290,7 @@ MobileShell.GridView { horizontalAlignment: Text.AlignHCenter text: i18n("Add applications to your favourites so they show up here.") } - + TapHandler { onLongPressed: root.openConfigureRequested() } diff --git a/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml b/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml index 22256cff..cab175c5 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml @@ -19,22 +19,22 @@ Item { required property bool interactive required property var searchWidget - + readonly property real twoColumnThreshold: Kirigami.Units.gridUnit * 16 readonly property bool twoColumn: root.width / 2 > twoColumnThreshold - + readonly property real cellWidth: twoColumn ? (root.width - leftMargin - rightMargin) / 2 : (root.width - leftMargin - rightMargin) readonly property real cellHeight: delegateHeight - + readonly property real leftMargin: Math.round(width * 0.1) readonly property real rightMargin: Math.round(width * 0.1) readonly property real delegateHeight: Math.round(Kirigami.Units.gridUnit * 3) - + property bool folderShown: false - + signal openConfigureRequested() signal pageForwardRequested(); - + Connections { target: parent @@ -46,12 +46,12 @@ Item { function goToBeginning() { goToBeginningAnim.restart(); } - + function closeFolder() { folderShown = false; closeFolderAnim.restart() } - + function openFolder() { folderShown = true; openFolderAnim.restart() @@ -60,29 +60,29 @@ Item { function resetHighlight() { favoritesGrid.currentIndex = -1; } - + FavoritesGrid { id: favoritesGrid - + property real openFolderProgress: 0 anchors.fill: parent - + interactive: root.interactive searchWidget: root.searchWidget - + cellWidth: root.cellWidth cellHeight: root.cellHeight - + leftMargin: root.leftMargin rightMargin: root.rightMargin twoColumn: root.twoColumn - + onOpenConfigureRequested: root.openConfigureRequested() onRequestOpenFolder: (folder) => { folderGrid.folder = folder; root.openFolder(); } - + property real translateX: openFolderProgress * -Kirigami.Units.gridUnit transform: Translate { x: favoritesGrid.translateX } opacity: 1 - openFolderProgress @@ -92,46 +92,46 @@ Item { pageForwardRequested(); } } - + FolderGrid { id: folderGrid - + property real openProgress: 0 anchors.fill: parent - + folder: null - + interactive: root.interactive - + cellWidth: root.cellWidth cellHeight: root.cellHeight - + leftMargin: root.leftMargin rightMargin: root.rightMargin twoColumn: root.twoColumn - + onOpenConfigureRequested: root.openConfigureRequested() onCloseRequested: root.closeFolder() - + property real translateX: (1 - openProgress) * Kirigami.Units.gridUnit transform: Translate { x: folderGrid.translateX } opacity: openProgress visible: opacity !== 0 } - + // handle horizontal dragging in a folder DragHandler { id: dragHandler target: folderGrid enabled: folderGrid.visible - + yAxis.enabled: false xAxis.enabled: true grabPermissions: PointerHandler.TakeOverForbidden - + property real oldTranslationX property bool isClosing: false - + // when dragged onTranslationChanged: { let moveAmount = Math.max(0, translation.x) / (Kirigami.Units.gridUnit * 5); @@ -139,7 +139,7 @@ Item { isClosing = translation.x > oldTranslationX; oldTranslationX = translation.x; } - + // when drag is let go onActiveChanged: { if (!active) { @@ -147,7 +147,7 @@ Item { } } } - + NumberAnimation { id: goToBeginningAnim target: favoritesGrid @@ -156,10 +156,10 @@ Item { duration: 200 easing.type: Easing.InOutQuad } - + SequentialAnimation { id: openFolderAnim - + ParallelAnimation { NumberAnimation { target: favoritesGrid @@ -169,7 +169,7 @@ Item { easing.type: Easing.InOutQuad } } - + ParallelAnimation { NumberAnimation { target: folderGrid @@ -180,10 +180,10 @@ Item { } } } - + SequentialAnimation { id: closeFolderAnim - + ParallelAnimation { NumberAnimation { target: folderGrid @@ -193,7 +193,7 @@ Item { easing.type: Easing.InOutQuad } } - + ParallelAnimation { NumberAnimation { target: favoritesGrid diff --git a/containments/homescreens/halcyon/package/contents/ui/FolderGrid.qml b/containments/homescreens/halcyon/package/contents/ui/FolderGrid.qml index 2196cafb..6309d808 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FolderGrid.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FolderGrid.qml @@ -17,22 +17,22 @@ import org.kde.private.mobile.homescreen.halcyon as Halcyon MobileShell.GridView { id: root property Halcyon.ApplicationFolder folder: null - + property string folderName: folder ? folder.name : "" property var folderModel: folder ? folder.applications : [] - + required property bool twoColumn - + signal openConfigureRequested() signal closeRequested() - + property bool inFolderTitleEditMode: false - + TapHandler { onLongPressed: root.openConfigureRequested() onTapped: root.closeRequested() } - + header: MobileShell.BaseItem { topPadding: Math.round(root.height * 0.2) bottomPadding: Kirigami.Units.gridUnit @@ -42,29 +42,29 @@ MobileShell.GridView { background: Rectangle { color: 'transparent' - TapHandler { + TapHandler { onLongPressed: root.openConfigureRequested() onTapped: root.closeRequested() } } - + Component { id: folderTitleEdit - + TextEdit { text: root.folderName color: "white" selectByMouse: true wrapMode: TextEdit.Wrap - + Component.onCompleted: forceActiveFocus() - + font.weight: Font.Bold font.pointSize: 18 layer.enabled: true layer.effect: MobileShell.TextDropShadow {} - + onTextChanged: { if (text.includes('\n')) { // exit text edit mode when new line is entered @@ -76,10 +76,10 @@ MobileShell.GridView { onEditingFinished: root.inFolderTitleEditMode = false } } - + Component { id: folderTitleLabel - + QQC2.Label { text: root.folderName color: "white" @@ -87,7 +87,7 @@ MobileShell.GridView { styleColor: "transparent" horizontalAlignment: Text.AlignLeft textFormat: Text.MarkdownText - + elide: Text.ElideRight wrapMode: Text.Wrap maximumLineCount: 2 @@ -97,35 +97,35 @@ MobileShell.GridView { layer.enabled: true layer.effect: MobileShell.TextDropShadow {} - + MouseArea { anchors.fill: parent onClicked: root.inFolderTitleEditMode = true } } } - + contentItem: RowLayout { id: rowLayout spacing: Kirigami.Units.smallSpacing * 2 - + // close folder button MouseArea { id: button Layout.alignment: Qt.AlignVCenter implicitHeight: Kirigami.Units.iconSizes.small + Kirigami.Units.gridUnit implicitWidth: Kirigami.Units.iconSizes.small + Kirigami.Units.gridUnit - + cursorShape: Qt.PointingHandCursor onClicked: root.closeRequested() - + // button background Rectangle { anchors.fill: parent color: Qt.rgba(255, 255, 255, button.pressed ? 0.2 : 0) radius: button.width / 2 } - + // button icon Kirigami.Icon { anchors.centerIn: parent @@ -144,7 +144,7 @@ MobileShell.GridView { } } } - + // folder title Loader { Layout.alignment: Qt.AlignVCenter @@ -154,18 +154,18 @@ MobileShell.GridView { } } } - + model: DelegateModel { id: visualModel model: root.folderModel - + delegate: Item { id: delegateRoot width: root.cellWidth height: root.cellHeight - + property int visualIndex: DelegateModel.itemsIndex - + DropArea { anchors.fill: parent onEntered: (drag) => { @@ -175,14 +175,14 @@ MobileShell.GridView { root.folder.moveEntry(from, to); } } - + FavoritesAppDelegate { id: appDelegate visualIndex: delegateRoot.visualIndex - + isFolder: false application: model.application - + menuActions: [ Kirigami.Action { icon.name: "emblem-favorite" @@ -195,13 +195,13 @@ MobileShell.GridView { onTriggered: root.folder.moveAppOut(model.index) } ] - + implicitWidth: root.cellWidth implicitHeight: visible ? root.cellHeight : 0 - + anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - + states: [ State { when: appDelegate.drag.active @@ -209,7 +209,7 @@ MobileShell.GridView { target: appDelegate parent: root } - + AnchorChanges { target: appDelegate anchors.horizontalCenter: undefined @@ -220,7 +220,7 @@ MobileShell.GridView { } } } - + // animations displaced: Transition { NumberAnimation { diff --git a/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml b/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml index 478bc3dc..8721658d 100644 --- a/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml +++ b/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml @@ -25,23 +25,23 @@ MouseArea { height: GridView.view.cellHeight property Halcyon.Application application: model.application - + property int reservedSpaceForLabel property alias iconItem: icon readonly property real margins: Math.floor(width * 0.2) signal launch(int x, int y, var source, string title, string storageId) - + function openContextMenu() { dialogLoader.active = true; dialogLoader.item.open(); } - + cursorShape: Qt.PointingHandCursor acceptedButtons: Qt.LeftButton | Qt.RightButton onPressAndHold: openContextMenu() - + function launchApp() { // launch app if (application.running) { @@ -50,15 +50,15 @@ MouseArea { delegate.launch(delegate.x + (Kirigami.Units.smallSpacing * 2), delegate.y + (Kirigami.Units.smallSpacing * 2), icon.source, application.name, application.storageId); } } - + Loader { id: dialogLoader active: false - + sourceComponent: PlasmaComponents.Menu { title: label.text closePolicy: PlasmaComponents.Menu.CloseOnReleaseOutside | PlasmaComponents.Menu.CloseOnEscape - + PlasmaComponents.MenuItem { icon.name: "emblem-favorite" text: i18n("Add to favourites") @@ -72,15 +72,15 @@ MouseArea { // grow/shrink animation property real zoomScale: 1 - transform: Scale { - origin.x: delegate.width / 2; - origin.y: delegate.height / 2; + transform: Scale { + origin.x: delegate.width / 2; + origin.y: delegate.height / 2; xScale: delegate.zoomScale yScale: delegate.zoomScale } - + property bool launchAppRequested: false - + NumberAnimation on zoomScale { id: shrinkAnim running: false @@ -92,7 +92,7 @@ MouseArea { } } } - + NumberAnimation on zoomScale { id: growAnim running: false @@ -105,7 +105,7 @@ MouseArea { } } } - + onPressedChanged: { if (pressed) { growAnim.stop(); @@ -122,7 +122,7 @@ MouseArea { launchAppRequested = true; } } - + ColumnLayout { anchors { fill: parent @@ -138,7 +138,7 @@ MouseArea { Kirigami.Theme.inherit: false Kirigami.Theme.colorSet: Kirigami.Theme.Complementary - + Layout.alignment: Qt.AlignHCenter | Qt.AlignTop Layout.fillWidth: true Layout.preferredHeight: Math.floor(parent.height - delegate.reservedSpaceForLabel) @@ -158,7 +158,7 @@ MouseArea { height: width color: Kirigami.Theme.highlightColor } - + // darken effect when hovered/pressed layer { enabled: delegate.pressed @@ -167,7 +167,7 @@ MouseArea { colorizationColor: Qt.rgba(0, 0, 0, 0.3) } } - + FontMetrics { id: labelFontMetrics font: label.font @@ -183,7 +183,7 @@ MouseArea { Layout.topMargin: Kirigami.Units.smallSpacing Layout.leftMargin: -parent.anchors.leftMargin + Kirigami.Units.smallSpacing Layout.rightMargin: -parent.anchors.rightMargin + Kirigami.Units.smallSpacing - + wrapMode: Text.WordWrap maximumLineCount: 2 horizontalAlignment: Text.AlignHCenter diff --git a/initialstart/modules/wifi/package/contents/ui/ConnectDialog.qml b/initialstart/modules/wifi/package/contents/ui/ConnectDialog.qml index b3b84cb2..fc56cfdd 100644 --- a/initialstart/modules/wifi/package/contents/ui/ConnectDialog.qml +++ b/initialstart/modules/wifi/package/contents/ui/ConnectDialog.qml @@ -14,18 +14,18 @@ Kirigami.PromptDialog { property string headingText property string devicePath property string specificPath - + signal donePressed(string password) - + function openAndClear() { warning.visible = false; this.open(); passwordField.text = ""; passwordField.focus = true; } - + standardButtons: Controls.Dialog.Ok | Controls.Dialog.Cancel - + onOpened: passwordField.forceActiveFocus() onRejected: { dialogRoot.close(); @@ -40,23 +40,23 @@ Kirigami.PromptDialog { } passwordField.focus = false; } - + ColumnLayout { id: column spacing: Kirigami.Units.largeSpacing - + PasswordField { id: passwordField Layout.fillWidth: true securityType: dialogRoot.securityType onAccepted: dialogRoot.accept() } - + Controls.Label { id: warning text: i18n("Invalid input.") visible: false } } - + } diff --git a/initialstart/modules/wifi/package/contents/ui/ConnectionItemDelegate.qml b/initialstart/modules/wifi/package/contents/ui/ConnectionItemDelegate.qml index 1d4878f8..3ac9035b 100644 --- a/initialstart/modules/wifi/package/contents/ui/ConnectionItemDelegate.qml +++ b/initialstart/modules/wifi/package/contents/ui/ConnectionItemDelegate.qml @@ -32,7 +32,7 @@ FormCard.AbstractFormDelegate { Layout.rightMargin: Kirigami.Units.gridUnit implicitWidth: Kirigami.Units.iconSizes.smallMedium implicitHeight: Kirigami.Units.iconSizes.smallMedium - + Kirigami.Icon { implicitWidth: Kirigami.Units.iconSizes.smallMedium implicitHeight: Kirigami.Units.iconSizes.smallMedium @@ -55,7 +55,7 @@ FormCard.AbstractFormDelegate { font.bold: ConnectionState === PlasmaNM.Enums.Activated Accessible.ignored: true // base class sets this text on root already } - + RowLayout { Kirigami.Icon { Layout.alignment: Qt.AlignVCenter diff --git a/initialstart/modules/wifi/package/contents/ui/main.qml b/initialstart/modules/wifi/package/contents/ui/main.qml index 6ffd2362..24ac4c2c 100644 --- a/initialstart/modules/wifi/package/contents/ui/main.qml +++ b/initialstart/modules/wifi/package/contents/ui/main.qml @@ -93,11 +93,11 @@ Item { model: mobileProxyModel delegate: ConnectionItemDelegate { editMode: false - + // connected or saved property bool shouldDisplay: (Uuid != "") || ConnectionState === PlasmaNM.Enums.Activated onShouldDisplayChanged: savedCard.updateCount() - + // separate property for visible since visible is false when the whole card is not visible visible: (Uuid != "") || ConnectionState === PlasmaNM.Enums.Activated } diff --git a/initialstart/qml/LandingComponent.qml b/initialstart/qml/LandingComponent.qml index 04afd519..bec4f8ab 100644 --- a/initialstart/qml/LandingComponent.qml +++ b/initialstart/qml/LandingComponent.qml @@ -50,10 +50,10 @@ Item { const darkWallpaperFolder = 'wallpapers/Next/contents/images_dark/'; const wallpaperUrl = StandardPaths.locate( - StandardPaths.GenericDataLocation, + StandardPaths.GenericDataLocation, (Prepare.PrepareUtil.usingDarkTheme ? darkWallpaperFolder : lightWallpaperFolder) + imgFile ); - + if (!wallpaperUrl) { return StandardPaths.locate(StandardPaths.GenericDataLocation, lightWallpaperFolder + imgFile); } diff --git a/kcms/cellularnetwork/CMakeLists.txt b/kcms/cellularnetwork/CMakeLists.txt index 846bb421..09900193 100644 --- a/kcms/cellularnetwork/CMakeLists.txt +++ b/kcms/cellularnetwork/CMakeLists.txt @@ -4,7 +4,7 @@ kcmutils_add_qml_kcm(kcm_cellular_network) target_sources(kcm_cellular_network PRIVATE - cellularnetworksettings.cpp + cellularnetworksettings.cpp modem.cpp modemdetails.cpp sim.cpp diff --git a/kcms/cellularnetwork/ui/AvailableNetworks.qml b/kcms/cellularnetwork/ui/AvailableNetworks.qml index 015d29fc..4c8e52e9 100644 --- a/kcms/cellularnetwork/ui/AvailableNetworks.qml +++ b/kcms/cellularnetwork/ui/AvailableNetworks.qml @@ -14,7 +14,7 @@ import cellularnetworkkcm 1.0 Kirigami.ScrollablePage { id: root title: i18n("Available Networks") - + property Modem modem property Sim sim @@ -24,7 +24,7 @@ Kirigami.ScrollablePage { anchors.left: parent.left anchors.right: parent.right spacing: 0 - + MessagesList { visible: count != 0 Layout.fillWidth: true @@ -32,7 +32,7 @@ Kirigami.ScrollablePage { model: kcm.messages } } - + Kirigami.PlaceholderMessage { anchors.centerIn: parent visible: !modem.details.isScanningNetworks && listView.count == 0 @@ -45,16 +45,16 @@ Kirigami.ScrollablePage { onTriggered: modem.details.scanNetworks() } } - + Controls.BusyIndicator { anchors.centerIn: parent visible: modem.details.isScanningNetworks implicitWidth: Kirigami.Units.iconSizes.large implicitHeight: implicitWidth } - + model: modem.details.networks - + delegate: FormCard.FormRadioDelegate { checked: modelData.isCurrentlyUsed diff --git a/kcms/cellularnetwork/ui/EditProfilePage.qml b/kcms/cellularnetwork/ui/EditProfilePage.qml index ca668029..2b1aa543 100644 --- a/kcms/cellularnetwork/ui/EditProfilePage.qml +++ b/kcms/cellularnetwork/ui/EditProfilePage.qml @@ -18,13 +18,13 @@ FormCard.FormCardPage { bottomPadding: Kirigami.Units.gridUnit leftPadding: 0 rightPadding: 0 - + property Modem modem property ProfileSettings profile - + FormCard.FormCard { Layout.topMargin: Kirigami.Units.gridUnit - + FormCard.FormTextFieldDelegate { id: profileName label: i18n("Name") diff --git a/kcms/cellularnetwork/ui/MessagesList.qml b/kcms/cellularnetwork/ui/MessagesList.qml index a77487c4..39440016 100644 --- a/kcms/cellularnetwork/ui/MessagesList.qml +++ b/kcms/cellularnetwork/ui/MessagesList.qml @@ -11,17 +11,17 @@ import cellularnetworkkcm 1.0 ColumnLayout { id: root - + property var model property alias count: repeater.count - + spacing: 0 visible: count > 0 - + Repeater { id: repeater model: root.model - + delegate: Kirigami.InlineMessage { Layout.bottomMargin: Kirigami.Units.largeSpacing Layout.fillWidth: true @@ -34,9 +34,9 @@ ColumnLayout { case InlineMessage.Warning: return Kirigami.MessageType.Warning; case InlineMessage.Error: return Kirigami.MessageType.Error; } - return Kirigami.MessageType.Error; + return Kirigami.MessageType.Error; } - + actions: [ Kirigami.Action { icon.name: "dialog-close" diff --git a/kcms/cellularnetwork/ui/PopupDialog.qml b/kcms/cellularnetwork/ui/PopupDialog.qml index 4045b2df..f777115c 100644 --- a/kcms/cellularnetwork/ui/PopupDialog.qml +++ b/kcms/cellularnetwork/ui/PopupDialog.qml @@ -9,24 +9,24 @@ import org.kde.kirigami 2.12 as Kirigami Controls.Dialog { id: dialog - + anchors.centerIn: Controls.Overlay.overlay modal: true padding: Kirigami.Units.smallSpacing closePolicy: Controls.Popup.CloseOnEscape | Controls.Popup.CloseOnReleaseOutside - + property int translateY: (1 - opacity) * Kirigami.Units.gridUnit * 2 - + NumberAnimation on opacity { from: 0; to: 1; duration: Kirigami.Units.veryShortDuration easing.type: Easing.InOutQuad running: true } - + contentItem.transform: Translate { y: dialog.translateY } footer.transform: Translate { y: dialog.translateY } - + header: Item { transform: Translate { y: dialog.translateY } implicitHeight: heading.implicitHeight + Kirigami.Units.largeSpacing * 2 @@ -40,7 +40,7 @@ Controls.Dialog { anchors.right: parent.right anchors.leftMargin: Kirigami.Units.largeSpacing anchors.verticalCenter: parent.verticalCenter - + // use tooltip for long text that is elided Controls.ToolTip.visible: truncated && titleHoverHandler.hovered Controls.ToolTip.text: dialog.title @@ -49,10 +49,10 @@ Controls.Dialog { } } } - + background: Item { transform: Translate { y: dialog.translateY } - + RectangularGlow { anchors.fill: rect anchors.topMargin: 1 @@ -68,7 +68,7 @@ Controls.Dialog { Kirigami.Theme.colorSet: Kirigami.Theme.Window color: Kirigami.Theme.backgroundColor radius: Kirigami.Units.smallSpacing - + Kirigami.Separator { id: topSeparator anchors.left: parent.left @@ -76,7 +76,7 @@ Controls.Dialog { anchors.top: parent.top anchors.topMargin: dialog.header.implicitHeight } - + Kirigami.Separator { id: bottomSeparator anchors.left: parent.left @@ -84,7 +84,7 @@ Controls.Dialog { anchors.bottom: parent.bottom anchors.bottomMargin: dialog.footer.implicitHeight } - + Rectangle { Kirigami.Theme.inherit: false Kirigami.Theme.colorSet: Kirigami.Theme.View @@ -95,6 +95,6 @@ Controls.Dialog { anchors.bottom: bottomSeparator.top } } - } -} + } +} diff --git a/kcms/cellularnetwork/ui/ProfileList.qml b/kcms/cellularnetwork/ui/ProfileList.qml index 79ca492b..1d7c74f7 100644 --- a/kcms/cellularnetwork/ui/ProfileList.qml +++ b/kcms/cellularnetwork/ui/ProfileList.qml @@ -19,7 +19,7 @@ Kirigami.ScrollablePage { property Modem modem property bool editMode: false - + title: i18n("APNs") actions: [ Kirigami.Action { @@ -40,18 +40,18 @@ Kirigami.ScrollablePage { Layout.margins: Kirigami.Units.largeSpacing model: kcm.messages } - + Kirigami.InlineMessage { id: cannotFindWarning Layout.margins: visible ? Kirigami.Units.largeSpacing : 0 Layout.topMargin: visible && !messagesList.visible ? Kirigami.Units.largeSpacing : 0 Layout.fillWidth: true - + visible: false type: Kirigami.MessageType.Warning showCloseButton: true text: i18n("Unable to autodetect connection settings for your carrier. Please find your carrier's APN settings by either contacting support or searching online.") - + Connections { target: modem function onCouldNotAutodetectSettings() { @@ -59,7 +59,7 @@ Kirigami.ScrollablePage { } } } - + FormCard.FormHeader { title: i18n("APN List") } @@ -110,7 +110,7 @@ Kirigami.ScrollablePage { kcm.push("EditProfilePage.qml", { "profile": null, "modem": modem }); } } - + FormCard.FormButtonDelegate { text: i18n("Automatically detect APN") icon.name: 'list-add' diff --git a/kcms/info/CMakeLists.txt b/kcms/info/CMakeLists.txt index 3e4a71a7..38dc65de 100644 --- a/kcms/info/CMakeLists.txt +++ b/kcms/info/CMakeLists.txt @@ -3,7 +3,7 @@ kcmutils_add_qml_kcm(kcm_mobile_info) -target_sources(kcm_mobile_info PRIVATE +target_sources(kcm_mobile_info PRIVATE info.cpp distroinfo.cpp softwareinfo.cpp diff --git a/kcms/powermanagement/ui/Graph.qml b/kcms/powermanagement/ui/Graph.qml index 1b9f4842..594de46d 100644 --- a/kcms/powermanagement/ui/Graph.qml +++ b/kcms/powermanagement/ui/Graph.qml @@ -20,13 +20,13 @@ Canvas { id: canvas antialiasing: true - - readonly property real xTicksAtDontCare: 0 + + readonly property real xTicksAtDontCare: 0 readonly property real xTicksAtTwelveOClock: 1 readonly property real xTicksAtFullHour: 2 readonly property real xTicksAtHalfHour: 3 readonly property real xTicksAtFullSecondHour: 4 - readonly property real xTicksAtTenMinutes: 5 + readonly property real xTicksAtTenMinutes: 5 readonly property real xTicksAtFullTwoHours: 6 property int xPadding: 45 @@ -115,7 +115,7 @@ Canvas c.lineTo(point.x, point.y) } } - + c.stroke(); c.strokeStyle = 'rgba(0, 0, 0, 0)'; c.lineTo(point.x, height - yPadding); @@ -164,7 +164,7 @@ Canvas var hours = currentDateTime.getHours() var minutes = currentDateTime.getMinutes() var seconds = currentDateTime.getSeconds() - + var diff switch (xTicksAt) { @@ -188,7 +188,7 @@ Canvas } var xGridOffset = plotWidth * (diff / xDuration) - var dateChanged = false + var dateChanged = false var dashedLines = 50 var dashedLineLength = plotHeight / dashedLines @@ -197,7 +197,7 @@ Canvas for (var i = xDivisions; i >= -1; i--) { xTickPos = i * xGridDistance + xPadding - xGridOffset - if ((xTickPos > xPadding) && (xTickPos < plotWidth + xPadding)) + if ((xTickPos > xPadding) && (xTickPos < plotWidth + xPadding)) { xTickDateTime = new Date(currentUnixTime - (xDivisions - i) * xDivisionWidth - diff * 1000) xTickDateStr = xTickDateTime.toLocaleDateString(Qt.locale(), Locale.ShortFormat) @@ -206,12 +206,12 @@ Canvas if (lastDateStr != xTickDateStr) { dateChanged = true } - + if ((i % 2 == 0) || (xDivisions < 10)) { // Display the time c.fillText(xTickTimeStr, xTickPos, canvas.height - yPadding / 2) - + // If the date has changed and is not the current day in a <= 24h graph, display it // Always display the date for 48h and 1 week graphs if (dateChanged || (xDuration > (60*60*48))) { @@ -222,13 +222,13 @@ Canvas // Tick markers c.moveTo(xTickPos, canvas.height - yPadding) c.lineTo(xTickPos, canvas.height - (yPadding * 4) / 5) - + dashedLineDutyCycle = 0.5 } else { dashedLineDutyCycle = 0.1 } - - for (var j = 0; j < dashedLines; j++) { + + for (var j = 0; j < dashedLines; j++) { c.moveTo(xTickPos, yPadding + j * dashedLineLength) c.lineTo(xTickPos, yPadding + j * dashedLineLength + dashedLineDutyCycle * dashedLineLength) } diff --git a/kcms/time/ui/TimePicker.qml b/kcms/time/ui/TimePicker.qml index 9fb741d3..5b5cf829 100644 --- a/kcms/time/ui/TimePicker.qml +++ b/kcms/time/ui/TimePicker.qml @@ -10,11 +10,11 @@ import org.kde.kirigami as Kirigami RowLayout { id: root - + property int hours: 0 property int minutes: 0 readonly property bool twelveHourTime: !kcm.twentyFour // am/pm - + onHoursChanged: updateHours() onMinutesChanged: minutesSpinbox.value = minutes onTwelveHourTimeChanged: updateHours() @@ -35,7 +35,7 @@ RowLayout { hoursSpinbox.value = hours; } } - + RowLayout { spacing: Kirigami.Units.largeSpacing Layout.alignment: Qt.AlignHCenter @@ -44,7 +44,7 @@ RowLayout { // for 24-hour time, we have hours from 0-23 TimePickerSpinBox { id: hoursSpinbox - + onValueModified: { if (root.twelveHourTime) { if (root.hours >= 12) { @@ -57,22 +57,22 @@ RowLayout { } } } - + Kirigami.Heading { level: 1 text: ":" } - + TimePickerSpinBox { id: minutesSpinbox from: 0 to: 59 - + onValueModified: { root.minutes = value; } } - + Button { id: amPmToggle visible: root.twelveHourTime diff --git a/kcms/time/ui/TimePickerSpinBox.qml b/kcms/time/ui/TimePickerSpinBox.qml index e52b5edd..0657d5ad 100644 --- a/kcms/time/ui/TimePickerSpinBox.qml +++ b/kcms/time/ui/TimePickerSpinBox.qml @@ -33,15 +33,15 @@ Item { Kirigami.Theme.colorSet: Kirigami.Theme.Button Kirigami.Theme.inherit: false - + implicitWidth: Kirigami.Units.gridUnit * 4 implicitHeight: column.implicitHeight - + readonly property color buttonColor: Kirigami.Theme.backgroundColor readonly property color buttonHoverColor: Qt.darker(buttonColor, 1.05) readonly property color buttonPressedColor: Qt.darker(buttonColor, 1.2) readonly property color buttonBorderColor: Qt.alpha(Kirigami.Theme.textColor, 0.3) - + ColumnLayout { id: column spacing: 0 @@ -128,7 +128,7 @@ Item { verticalAlignment: Qt.AlignVCenter inputMethodHints: Qt.ImhFormattedNumbersOnly - + function applyTextBinding() { text = Qt.binding(function () { return spinBox.displayText.length == 1 ? '0' + spinBox.displayText : spinBox.displayText }); } diff --git a/kcms/time/ui/main.qml b/kcms/time/ui/main.qml index 0babad0f..57d14d30 100644 --- a/kcms/time/ui/main.qml +++ b/kcms/time/ui/main.qml @@ -125,7 +125,7 @@ SimpleKCM { bottomPadding: 0 leftPadding: Kirigami.Units.smallSpacing rightPadding: Kirigami.Units.smallSpacing - + background: Rectangle { color: Kirigami.Theme.backgroundColor } diff --git a/kcms/wifi/ui/ConnectDialog.qml b/kcms/wifi/ui/ConnectDialog.qml index b3b84cb2..fc56cfdd 100644 --- a/kcms/wifi/ui/ConnectDialog.qml +++ b/kcms/wifi/ui/ConnectDialog.qml @@ -14,18 +14,18 @@ Kirigami.PromptDialog { property string headingText property string devicePath property string specificPath - + signal donePressed(string password) - + function openAndClear() { warning.visible = false; this.open(); passwordField.text = ""; passwordField.focus = true; } - + standardButtons: Controls.Dialog.Ok | Controls.Dialog.Cancel - + onOpened: passwordField.forceActiveFocus() onRejected: { dialogRoot.close(); @@ -40,23 +40,23 @@ Kirigami.PromptDialog { } passwordField.focus = false; } - + ColumnLayout { id: column spacing: Kirigami.Units.largeSpacing - + PasswordField { id: passwordField Layout.fillWidth: true securityType: dialogRoot.securityType onAccepted: dialogRoot.accept() } - + Controls.Label { id: warning text: i18n("Invalid input.") visible: false } } - + } diff --git a/kcms/wifi/ui/ConnectionItemDelegate.qml b/kcms/wifi/ui/ConnectionItemDelegate.qml index 1d4878f8..3ac9035b 100644 --- a/kcms/wifi/ui/ConnectionItemDelegate.qml +++ b/kcms/wifi/ui/ConnectionItemDelegate.qml @@ -32,7 +32,7 @@ FormCard.AbstractFormDelegate { Layout.rightMargin: Kirigami.Units.gridUnit implicitWidth: Kirigami.Units.iconSizes.smallMedium implicitHeight: Kirigami.Units.iconSizes.smallMedium - + Kirigami.Icon { implicitWidth: Kirigami.Units.iconSizes.smallMedium implicitHeight: Kirigami.Units.iconSizes.smallMedium @@ -55,7 +55,7 @@ FormCard.AbstractFormDelegate { font.bold: ConnectionState === PlasmaNM.Enums.Activated Accessible.ignored: true // base class sets this text on root already } - + RowLayout { Kirigami.Icon { Layout.alignment: Qt.AlignVCenter diff --git a/kded/autodetectapn/android/README.md b/kded/autodetectapn/android/README.md index 4ad8c64a..f3970990 100644 --- a/kded/autodetectapn/android/README.md +++ b/kded/autodetectapn/android/README.md @@ -1,5 +1,5 @@ diff --git a/kwin/scripts/convergentwindows/contents/ui/main.qml b/kwin/scripts/convergentwindows/contents/ui/main.qml index 4c21cf4b..e32a659d 100644 --- a/kwin/scripts/convergentwindows/contents/ui/main.qml +++ b/kwin/scripts/convergentwindows/contents/ui/main.qml @@ -27,8 +27,8 @@ Loader { const output = window.output; const desktop = window.desktops[0]; // assume it's the first desktop that the window is on const maximizeRect = KWinComponents.Workspace.clientArea(KWinComponents.Workspace.MaximizeArea, output, desktop); - - // set the window to the maximized size and position instantly, avoiding race condition + + // set the window to the maximized size and position instantly, avoiding race condition // between maximizing and window decorations being turned off (changing window height) // see: https://invent.kde.org/teams/plasma-mobile/issues/-/issues/256 window.frameGeometry = maximizeRect; diff --git a/lookandfeel/contents/logout/Logout.qml b/lookandfeel/contents/logout/Logout.qml index 9264614f..6d269f3c 100644 --- a/lookandfeel/contents/logout/Logout.qml +++ b/lookandfeel/contents/logout/Logout.qml @@ -33,7 +33,7 @@ Item { onTriggered: root.cancelRequested() shortcut: "Escape" } - + Rectangle { id: blackOverlay anchors.fill: parent @@ -125,12 +125,12 @@ Item { } } } - + Item { id: buttons anchors.fill: parent opacity: 0 - + ColumnLayout { anchors.centerIn: parent spacing: Kirigami.Units.gridUnit @@ -162,7 +162,7 @@ Item { } } } - + ActionButton { anchors { bottom: parent.bottom diff --git a/lookandfeel/contents/systemdialog/SystemDialog.qml b/lookandfeel/contents/systemdialog/SystemDialog.qml index 677e5393..d3a35ac6 100644 --- a/lookandfeel/contents/systemdialog/SystemDialog.qml +++ b/lookandfeel/contents/systemdialog/SystemDialog.qml @@ -3,7 +3,7 @@ import QtQuick import QtQuick.Controls as QQC2 -import QtQuick.Layouts +import QtQuick.Layouts import QtQuick.Window import Qt5Compat.GraphicalEffects import QtQuick.Templates as T @@ -11,7 +11,7 @@ import org.kde.kirigami as Kirigami Item { id: root - + // -- public API: should match plasma-workspace implementation -- default property Item mainItem @@ -27,7 +27,7 @@ Item { readonly property int flags: Qt.FramelessWindowHint | Qt.Dialog property var standardButtons // footerButtonBox standardButtons readonly property int spacing: Kirigami.Units.gridUnit - + function present() { window.showMaximized(); } @@ -140,7 +140,7 @@ Item { id: footerButtonBox // ensure we never have no buttons, we always must have the cancel button available standardButtons: (root.standardButtons === QQC2.DialogButtonBox.NoButton) ? QQC2.DialogButtonBox.Cancel : root.standardButtons - + Layout.topMargin: Kirigami.Units.largeSpacing Layout.fillWidth: true Layout.maximumWidth: root.window.maximumWidth diff --git a/quicksettings/battery/contents/ui/main.qml b/quicksettings/battery/contents/ui/main.qml index 66af8f03..c6540b0d 100644 --- a/quicksettings/battery/contents/ui/main.qml +++ b/quicksettings/battery/contents/ui/main.qml @@ -6,7 +6,7 @@ import QtQuick 2.15 import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS import org.kde.plasma.private.mobileshell as MobileShell -QS.QuickSetting { +QS.QuickSetting { text: i18n("Battery") status: i18n("%1%", MobileShell.BatteryInfo.percent) icon: "battery-full" + (MobileShell.BatteryInfo.pluggedIn ? "-charging" : "") diff --git a/quicksettings/caffeine/contents/ui/main.qml b/quicksettings/caffeine/contents/ui/main.qml index 758d6c6a..f232f69c 100644 --- a/quicksettings/caffeine/contents/ui/main.qml +++ b/quicksettings/caffeine/contents/ui/main.qml @@ -28,7 +28,7 @@ QS.QuickSetting { property int cookie1: -1 property int cookie2: -1 - + function toggle() { let inhibit = !enabled; const service = pmSource.serviceForSource("PowerDevil"); diff --git a/quicksettings/keyboardtoggle/contents/ui/main.qml b/quicksettings/keyboardtoggle/contents/ui/main.qml index db80b332..97f41388 100644 --- a/quicksettings/keyboardtoggle/contents/ui/main.qml +++ b/quicksettings/keyboardtoggle/contents/ui/main.qml @@ -11,11 +11,11 @@ import org.kde.plasma.workspace.keyboardlayout 1.0 as Keyboards QS.QuickSetting { text: i18n("Virtual Keyboard") icon: "input-keyboard-virtual" - status: enabled ? i18n("On") : + status: enabled ? i18n("On") : (Keyboards.KWinVirtualKeyboard.available ? i18n("Off") : i18n("Tap to open settings")) enabled: Keyboards.KWinVirtualKeyboard.enabled && Keyboards.KWinVirtualKeyboard.available settingsCommand: "plasma-open-settings kcm_mobile_onscreenkeyboard" - + function toggle() { if (!Keyboards.KWinVirtualKeyboard.available) { // select a keyboard in the settings (none is likely set) diff --git a/quicksettings/mobiledata/contents/ui/main.qml b/quicksettings/mobiledata/contents/ui/main.qml index cc660a79..87f2060b 100644 --- a/quicksettings/mobiledata/contents/ui/main.qml +++ b/quicksettings/mobiledata/contents/ui/main.qml @@ -23,10 +23,10 @@ QS.QuickSetting { return i18n("Not Available"); } } - + settingsCommand: "plasma-open-settings kcm_cellular_network" enabled: PlasmaMM.SignalIndicator.mobileDataEnabled - + function toggle() { if (PlasmaMM.SignalIndicator.needsAPNAdded || !PlasmaMM.SignalIndicator.mobileDataSupported) { // open settings if unable to toggle mobile data diff --git a/quicksettings/nightcolor/nightcolorsettings.kcfg b/quicksettings/nightcolor/nightcolorsettings.kcfg index 7528dcb2..2c7b9910 100644 --- a/quicksettings/nightcolor/nightcolorsettings.kcfg +++ b/quicksettings/nightcolor/nightcolorsettings.kcfg @@ -1,6 +1,6 @@ - diff --git a/quicksettings/powermenu/CMakeLists.txt b/quicksettings/powermenu/CMakeLists.txt index ecd64bba..1c081e83 100644 --- a/quicksettings/powermenu/CMakeLists.txt +++ b/quicksettings/powermenu/CMakeLists.txt @@ -17,7 +17,7 @@ target_link_libraries(powermenuplugin KF6::CoreAddons PW::KWorkspace ) - + set_property(TARGET powermenuplugin PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/plasma/quicksetting/powermenu) file(COPY qmldir DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/plasma/quicksetting/powermenu) diff --git a/quicksettings/powermenu/package/contents/ui/main.qml b/quicksettings/powermenu/package/contents/ui/main.qml index 258361b1..f8305078 100644 --- a/quicksettings/powermenu/package/contents/ui/main.qml +++ b/quicksettings/powermenu/package/contents/ui/main.qml @@ -12,7 +12,7 @@ QS.QuickSetting { icon: "system-shutdown-symbolic" status: i18n("Open power menu") enabled: false - + function toggle() { PowerMenu.PowerMenuUtil.openShutdownScreen(); } diff --git a/quicksettings/record/package/contents/ui/main.qml b/quicksettings/record/package/contents/ui/main.qml index 2b2f2883..d1e7982f 100644 --- a/quicksettings/record/package/contents/ui/main.qml +++ b/quicksettings/record/package/contents/ui/main.qml @@ -48,7 +48,7 @@ QS.QuickSetting { } else { RecordUtil.showNotification(i18n("New Screen Recording"), i18n("New Screen Recording saved in %1", record.output), record.output); } - + enabled = !enabled MobileShellState.ShellDBusClient.closeActionDrawer(); } diff --git a/quicksettings/screenshot/package/contents/ui/main.qml b/quicksettings/screenshot/package/contents/ui/main.qml index 7ce58171..a5c9564c 100644 --- a/quicksettings/screenshot/package/contents/ui/main.qml +++ b/quicksettings/screenshot/package/contents/ui/main.qml @@ -12,14 +12,14 @@ QS.QuickSetting { status: i18n("Tap to screenshot") icon: "spectacle" enabled: false - + property bool screenshotRequested: false - + function toggle() { screenshotRequested = true; MobileShellState.ShellDBusClient.closeActionDrawer(); } - + Connections { target: MobileShellState.ShellDBusClient @@ -30,7 +30,7 @@ QS.QuickSetting { } } } - + // HACK: KWin's fade effect may have the window ending up being in the screenshot if taken too fast Timer { id: timer diff --git a/screenshots/homescreen-folio.png.license b/screenshots/homescreen-folio.png.license index d0edba98..cf53d2bc 100644 --- a/screenshots/homescreen-folio.png.license +++ b/screenshots/homescreen-folio.png.license @@ -1,2 +1,2 @@ SPDX-FileCopyrightText: None -SPDX-License-Identifier: CC0-1.0 +SPDX-License-Identifier: CC0-1.0 diff --git a/screenshots/homescreen-halcyon.png.license b/screenshots/homescreen-halcyon.png.license index 2fa3c6e0..cf53d2bc 100644 --- a/screenshots/homescreen-halcyon.png.license +++ b/screenshots/homescreen-halcyon.png.license @@ -1,2 +1,2 @@ SPDX-FileCopyrightText: None -SPDX-License-Identifier: CC0-1.0 +SPDX-License-Identifier: CC0-1.0 diff --git a/shell/contents/configuration/AppletConfiguration.qml b/shell/contents/configuration/AppletConfiguration.qml index a134d646..a39183a9 100644 --- a/shell/contents/configuration/AppletConfiguration.qml +++ b/shell/contents/configuration/AppletConfiguration.qml @@ -20,13 +20,13 @@ Rectangle { color: "transparent" //BEGIN properties - + property bool isContainment: false property alias app: appLoader.item property bool loadApp: true - + signal appLoaded() - + //END properties //BEGIN model @@ -44,7 +44,7 @@ Rectangle { return sourceModel.data(sourceModel.index(row, 0), ConfigModel.VisibleRole); } } - + //END model //BEGIN functions @@ -87,7 +87,7 @@ Rectangle { root.saveConfig(); } } - + function pushReplace(item, config) { let page; if (app.pageStack.depth === 0) { @@ -97,7 +97,7 @@ Rectangle { } app.currentConfigPage = page; } - + function open(item) { app.isAboutPage = false; if (item.source) { @@ -109,7 +109,7 @@ Rectangle { app.pageStack.pop(); } } - + //END functions @@ -123,7 +123,7 @@ Rectangle { } } } - + //END connections //BEGIN UI components @@ -132,7 +132,7 @@ Rectangle { id: configurationKcmPageComponent ConfigurationKcmPage {} } - + Loader { id: appLoader anchors.fill: parent @@ -146,14 +146,14 @@ Rectangle { } else { root.open(configDialog.configModel.get(0)) } - + root.appLoaded(); } - + sourceComponent: Kirigami.ApplicationItem { id: app anchors.fill: parent - + // animation on show opacity: 0 NumberAnimation on opacity { @@ -162,14 +162,14 @@ Rectangle { duration: Kirigami.Units.longDuration easing.type: Easing.InOutQuad } - + pageStack.globalToolBar.canContainHandles: true pageStack.globalToolBar.style: Kirigami.ApplicationHeaderStyle.ToolBar pageStack.globalToolBar.showNavigationButtons: Kirigami.ApplicationHeaderStyle.ShowBackButton; - + property var currentConfigPage: null property bool isAboutPage: false - + // pop pages when not in use Connections { target: app.pageStack @@ -178,7 +178,7 @@ Rectangle { timer.restart(); } } - + Timer { id: timer interval: 300 @@ -207,7 +207,7 @@ Rectangle { delegate: configCategoryDelegate } } - + Component { id: configCategoryDelegate Kirigami.NavigationTabButton { @@ -215,13 +215,13 @@ Rectangle { text: model.name width: footerBar.buttonWidth QQC2.ButtonGroup.group: footerBar.tabGroup - + onClicked: { if (checked) { root.open(model); } } - + checked: { if (app.pageStack.currentItem) { if (model.kcm && app.pageStack.currentItem.kcm) { diff --git a/shell/contents/configuration/ContainmentConfiguration.qml b/shell/contents/configuration/ContainmentConfiguration.qml index bc757a85..b31bc232 100644 --- a/shell/contents/configuration/ContainmentConfiguration.qml +++ b/shell/contents/configuration/ContainmentConfiguration.qml @@ -24,7 +24,7 @@ AppletConfiguration { app.width = root.width < root.height ? root.width : Math.min(root.width, Math.max(app.implicitWidth, Kirigami.Units.gridUnit * 45)); app.height = Math.min(root.height, Math.max(app.implicitHeight, Kirigami.Units.gridUnit * 29)); } - + //BEGIN model globalConfigModel: globalContainmentConfigModel diff --git a/tests/ActionDrawerTest.qml b/tests/ActionDrawerTest.qml index 6f7b8ed1..25269b37 100644 --- a/tests/ActionDrawerTest.qml +++ b/tests/ActionDrawerTest.qml @@ -25,50 +25,50 @@ ApplicationWindow { width: 360 height: 720 visible: true - + Image { source: "assets/background.jpg" anchors.fill: parent fillMode: Image.PreserveAspectCrop } - + MobileShell.StatusBar { id: statusBar z: 1 - + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - + height: Kirigami.Units.gridUnit * 1.25 - + Kirigami.Theme.inherit: false Kirigami.Theme.colorSet: Kirigami.Theme.Complementary backgroundColor: "transparent" - + showSecondRow: false showDropShadow: true showTime: true disableSystemTray: true // prevent SIGABRT, since loading the system tray leads to bad... things } - + MobileShell.ActionDrawerOpenSurface { anchors.fill: statusBar actionDrawer: drawer z: 1 } - + MobileShell.ActionDrawer { id: drawer z: 1 anchors.fill: parent - + notificationSettings: NotificationManager.Settings {} notificationModelType: MobileShell.NotificationsModelType.WatchedNotificationsModel notificationModel: NotificationManager.WatchedNotificationsModel {} } - + PC3.Label { anchors.bottom: parent.bottom anchors.bottomMargin: Kirigami.Units.gridUnit diff --git a/tests/LockScreenTest.qml b/tests/LockScreenTest.qml index 031fc8f2..37be1253 100644 --- a/tests/LockScreenTest.qml +++ b/tests/LockScreenTest.qml @@ -17,7 +17,7 @@ ApplicationWindow { width: 360 height: 720 visible: true - + // simulate kscreenlocker wallpaper Image { id: wallpaper // id passed in by kscreenlocker @@ -25,11 +25,11 @@ ApplicationWindow { anchors.fill: parent fillMode: Image.PreserveAspectCrop } - + // simulate kscreenlocker authenticator object QtObject { id: authenticator // id passed in by kscreenlocker - + property string infoMessage: "" property string errorMessage: "" property string prompt: "" @@ -37,11 +37,11 @@ ApplicationWindow { signal succeeded() signal failed() - + // these are not kscreenlocker properties, for test purposes only property string password: "" property bool shouldPrompt: true - + function startAuthenticating() { if (shouldPrompt) { shouldPrompt = false; @@ -55,12 +55,12 @@ ApplicationWindow { failed(); } } - + function respond(promptPassword) { password = promptPassword; } } - + // component to test LockScreen.LockScreen { anchors.fill: parent diff --git a/tests/README.md b/tests/README.md index c00ee502..669ee387 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,5 +1,5 @@