mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
Remove trailing whitespace
This commit is contained in:
parent
5d84e6e47d
commit
eb9509ce68
79 changed files with 647 additions and 647 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -2,9 +2,9 @@
|
|||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
build
|
||||
*.config
|
||||
*.creator
|
||||
*.files
|
||||
*.config
|
||||
*.creator
|
||||
*.files
|
||||
*.includes
|
||||
*.user
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
Copyright (c) <year> <owner>.
|
||||
Copyright (c) <year> <owner>.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<!--
|
||||
- SPDX-FileCopyrightText: None
|
||||
- SPDX-FileCopyrightText: None
|
||||
- SPDX-License-Identifier: CC0-1.0
|
||||
-->
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,5 +96,5 @@ NanoShell.FullScreenOverlay {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@ QtObject {
|
|||
property bool visible: true
|
||||
property string iconSource
|
||||
property real iconSizeFactor
|
||||
|
||||
|
||||
signal triggered()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import org.kde.plasma.private.mobileshell as MobileShell
|
|||
|
||||
Kirigami.Icon {
|
||||
id: connectionIcon
|
||||
|
||||
|
||||
source: MobileShell.BluetoothInfo.icon
|
||||
|
||||
visible: MobileShell.BluetoothInfo.isVisible
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import org.kde.plasma.private.mobileshell as MobileShell
|
|||
|
||||
Kirigami.Icon {
|
||||
id: paIcon
|
||||
|
||||
|
||||
source: MobileShell.AudioInfo.icon
|
||||
|
||||
visible: MobileShell.AudioInfo.isVisible
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
||||
* SPDX-FileCopyrightText: 2018-2019 Kai Uwe Broulik <kde@privat.broulik.de>
|
||||
*
|
||||
*
|
||||
* 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()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
|
||||
* SPDX-FileCopyrightText: 2018-2019 Kai Uwe Broulik <kde@privat.broulik.de>
|
||||
*
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2016 Kai Uwe Broulik <kde@privat.broulik.de>
|
||||
*
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.0-or-later
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ SimpleKCM {
|
|||
bottomPadding: 0
|
||||
leftPadding: Kirigami.Units.smallSpacing
|
||||
rightPadding: Kirigami.Units.smallSpacing
|
||||
|
||||
|
||||
background: Rectangle {
|
||||
color: Kirigami.Theme.backgroundColor
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<!--
|
||||
- SPDX-FileCopyrightText: None
|
||||
- SPDX-FileCopyrightText: None
|
||||
- SPDX-License-Identifier: CC0-1.0
|
||||
-->
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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" : "")
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ QS.QuickSetting {
|
|||
|
||||
property int cookie1: -1
|
||||
property int cookie2: -1
|
||||
|
||||
|
||||
function toggle() {
|
||||
let inhibit = !enabled;
|
||||
const service = pmSource.serviceForSource("PowerDevil");
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!--
|
||||
<!--
|
||||
- SPDX-FileCopyrightText: 2020 Vlad Zahorodnii
|
||||
- SPDX-License-Identifier: GPL-2.0-or-later
|
||||
-->
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ QS.QuickSetting {
|
|||
icon: "system-shutdown-symbolic"
|
||||
status: i18n("Open power menu")
|
||||
enabled: false
|
||||
|
||||
|
||||
function toggle() {
|
||||
PowerMenu.PowerMenuUtil.openShutdownScreen();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
SPDX-FileCopyrightText: None
|
||||
SPDX-License-Identifier: CC0-1.0
|
||||
SPDX-License-Identifier: CC0-1.0
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
SPDX-FileCopyrightText: None
|
||||
SPDX-License-Identifier: CC0-1.0
|
||||
SPDX-License-Identifier: CC0-1.0
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<!--
|
||||
- SPDX-FileCopyrightText: None
|
||||
- SPDX-FileCopyrightText: None
|
||||
- SPDX-License-Identifier: CC0-1.0
|
||||
-->
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue