From c3835b9a3bf6fc9e8b8f5694679b5ee501a9f1b6 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Wed, 22 Jun 2022 11:14:30 -0400 Subject: [PATCH] components: Use consistent documentation --- components/mobileshell/qml/components/BaseItem.qml | 7 ++----- components/mobileshell/qml/components/Haptics.qml | 10 ++++++---- .../qml/components/HapticsEffectWrapper.qml | 6 ++---- .../mobileshell/qml/components/MarqueeLabel.qml | 8 +++----- .../mobileshell/qml/components/StartupFeedback.qml | 10 ++++------ .../qml/components/VelocityCalculator.qml | 13 +++++++------ .../default/package/contents/ui/HomeDelegate.qml | 4 ++-- .../contents/ui/appdrawer/DrawerGridDelegate.qml | 4 ++-- .../contents/ui/appdrawer/DrawerListDelegate.qml | 4 ++-- 9 files changed, 30 insertions(+), 36 deletions(-) diff --git a/components/mobileshell/qml/components/BaseItem.qml b/components/mobileshell/qml/components/BaseItem.qml index 43c4cf11..314e206e 100644 --- a/components/mobileshell/qml/components/BaseItem.qml +++ b/components/mobileshell/qml/components/BaseItem.qml @@ -1,8 +1,5 @@ -/* - * SPDX-FileCopyrightText: 2021 Devin Lin - * - * SPDX-License-Identifier: GPL-2.0-or-later - */ +// SPDX-FileCopyrightText: 2021 Devin Lin +// SPDX-License-Identifier: GPL-2.0-or-later import QtQuick 2.15 diff --git a/components/mobileshell/qml/components/Haptics.qml b/components/mobileshell/qml/components/Haptics.qml index 9bfec952..a6c4f7c3 100644 --- a/components/mobileshell/qml/components/Haptics.qml +++ b/components/mobileshell/qml/components/Haptics.qml @@ -1,7 +1,5 @@ -/* - * SPDX-FileCopyrightText: 2022 Devin Lin - * SPDX-License-Identifier: GPL-2.0-or-later - */ +// SPDX-FileCopyrightText: 2022 Devin Lin +// SPDX-License-Identifier: GPL-2.0-or-later import QtQuick 2.15 import QtFeedback 5.0 @@ -10,6 +8,10 @@ import org.kde.plasma.private.mobileshell 1.0 as MobileShell pragma Singleton +/** + * Singleton object for triggering vibrations in the shell. + */ + QtObject { id: root diff --git a/components/mobileshell/qml/components/HapticsEffectWrapper.qml b/components/mobileshell/qml/components/HapticsEffectWrapper.qml index 6ac4b46c..07c671c5 100644 --- a/components/mobileshell/qml/components/HapticsEffectWrapper.qml +++ b/components/mobileshell/qml/components/HapticsEffectWrapper.qml @@ -1,7 +1,5 @@ -/* - * SPDX-FileCopyrightText: 2022 Devin Lin - * SPDX-License-Identifier: GPL-2.0-or-later - */ +// SPDX-FileCopyrightText: 2022 Devin Lin +// SPDX-License-Identifier: GPL-2.0-or-later import QtQuick 2.15 import QtFeedback 5.0 diff --git a/components/mobileshell/qml/components/MarqueeLabel.qml b/components/mobileshell/qml/components/MarqueeLabel.qml index e4288bcf..4f3359e7 100644 --- a/components/mobileshell/qml/components/MarqueeLabel.qml +++ b/components/mobileshell/qml/components/MarqueeLabel.qml @@ -1,8 +1,5 @@ -/* - * SPDX-FileCopyrightText: 2022 Yari Polla - * - * SPDX-License-Identifier: LGPL-2.0-or-later - */ +// SPDX-FileCopyrightText: 2022 Yari Polla +// SPDX-License-Identifier: LGPL-2.0-or-later import QtQuick 2.15 @@ -12,6 +9,7 @@ import org.kde.plasma.components 3.0 as PlasmaComponents /** * This is a simple marquee (flowing) label based on PlasmaComponents Label. */ + PlasmaComponents.Label { id: root diff --git a/components/mobileshell/qml/components/StartupFeedback.qml b/components/mobileshell/qml/components/StartupFeedback.qml index 38516ff8..54e4262e 100644 --- a/components/mobileshell/qml/components/StartupFeedback.qml +++ b/components/mobileshell/qml/components/StartupFeedback.qml @@ -1,9 +1,6 @@ -/* - * SPDX-FileCopyrightText: 2015 Marco Martin - * SPDX-FileCopyrightText: 2021 Devin Lin - * - * SPDX-License-Identifier: LGPL-2.0-or-later - */ +// SPDX-FileCopyrightText: 2015 Marco Martin +// SPDX-FileCopyrightText: 2021 Devin Lin +// SPDX-License-Identifier: LGPL-2.0-or-later import QtQuick 2.12 import QtQuick.Layouts 1.1 @@ -19,6 +16,7 @@ import org.kde.plasma.private.mobileshell 1.0 as MobileShell /** * Component that animates an app opening from a location. */ + MouseArea { // use mousearea to ensure clicks don't go behind id: root visible: false diff --git a/components/mobileshell/qml/components/VelocityCalculator.qml b/components/mobileshell/qml/components/VelocityCalculator.qml index f9b2003a..8f4b55c0 100644 --- a/components/mobileshell/qml/components/VelocityCalculator.qml +++ b/components/mobileshell/qml/components/VelocityCalculator.qml @@ -1,12 +1,13 @@ -/* - * SPDX-FileCopyrightText: 2013 Canonical Ltd. - * SPDX-FileCopyrightText: 2021 Devin Lin - * - * SPDX-License-Identifier: GPL-3.0-only - */ +// SPDX-FileCopyrightText: 2013 Canonical Ltd. +// SPDX-FileCopyrightText: 2021 Devin Lin +// SPDX-License-Identifier: GPL-3.0-only import QtQuick 2.15 +/** + * Component that is able to measure velocity based on position change events. + */ + QtObject { id: root diff --git a/containments/homescreens/default/package/contents/ui/HomeDelegate.qml b/containments/homescreens/default/package/contents/ui/HomeDelegate.qml index 3cd3756a..ac268166 100644 --- a/containments/homescreens/default/package/contents/ui/HomeDelegate.qml +++ b/containments/homescreens/default/package/contents/ui/HomeDelegate.qml @@ -100,7 +100,7 @@ ContainmentLayoutManager.ItemContainer { } } - contentItem: MobileShell.ExtendedAbstractButton { + contentItem: MouseArea { id: mouseArea // grow/shrink animation @@ -187,7 +187,7 @@ ContainmentLayoutManager.ItemContainer { // darken effect when hovered/pressed layer { - enabled: mouseArea.pressed || mouseArea.hovered + enabled: mouseArea.pressed || mouseArea.containsMouse effect: ColorOverlay { color: Qt.rgba(0, 0, 0, 0.3) } diff --git a/containments/homescreens/default/package/contents/ui/appdrawer/DrawerGridDelegate.qml b/containments/homescreens/default/package/contents/ui/appdrawer/DrawerGridDelegate.qml index 9f8d1497..3b777d07 100644 --- a/containments/homescreens/default/package/contents/ui/appdrawer/DrawerGridDelegate.qml +++ b/containments/homescreens/default/package/contents/ui/appdrawer/DrawerGridDelegate.qml @@ -17,7 +17,7 @@ import org.kde.kquickcontrolsaddons 2.0 import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager import org.kde.plasma.private.mobileshell 1.0 as MobileShell -MobileShell.ExtendedAbstractButton { +MouseArea { id: delegate width: GridView.view.cellWidth height: GridView.view.cellHeight @@ -129,7 +129,7 @@ MobileShell.ExtendedAbstractButton { // darken effect when hovered/pressed layer { - enabled: delegate.pressed || delegate.hovered + enabled: delegate.pressed || delegate.containsMouse effect: ColorOverlay { color: Qt.rgba(0, 0, 0, 0.3) } diff --git a/containments/homescreens/default/package/contents/ui/appdrawer/DrawerListDelegate.qml b/containments/homescreens/default/package/contents/ui/appdrawer/DrawerListDelegate.qml index 2444e788..e3a02b45 100644 --- a/containments/homescreens/default/package/contents/ui/appdrawer/DrawerListDelegate.qml +++ b/containments/homescreens/default/package/contents/ui/appdrawer/DrawerListDelegate.qml @@ -18,7 +18,7 @@ import org.kde.kquickcontrolsaddons 2.0 import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutManager import org.kde.plasma.private.mobileshell 1.0 as MobileShell -MobileShell.ExtendedAbstractButton { +MouseArea { id: delegate property int reservedSpaceForLabel property alias iconItem: icon @@ -45,7 +45,7 @@ MobileShell.ExtendedAbstractButton { Rectangle { anchors.fill: parent - color: delegate.pressed ? Qt.rgba(255, 255, 255, 0.2) : (delegate.hovered ? Qt.rgba(255, 255, 255, 0.05) : "transparent") + color: delegate.pressed ? Qt.rgba(255, 255, 255, 0.2) : (delegate.containsMouse ? Qt.rgba(255, 255, 255, 0.05) : "transparent") Behavior on color { ColorAnimation { duration: PlasmaCore.Units.shortDuration } }