feat: Simulate right click on long press

This commit is contained in:
Alex Jbanca
2025-04-08 18:03:13 +03:00
committed by Alex Jbanca
parent 92fa95f5b8
commit c983f2c8a0
180 changed files with 379 additions and 247 deletions
+4 -2
View File
@@ -3,6 +3,8 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import Monitoring 1.0
import StatusQ.Core 0.1
import StatusQ.Core.Utils 0.1
Item {
@@ -164,7 +166,7 @@ Item {
color: "gray"
}
MouseArea {
StatusMouseArea {
id: labelMouseArea
anchors.fill: parent
@@ -237,7 +239,7 @@ Item {
elide: Text.ElideRight
maximumLineCount: 1
MouseArea {
StatusMouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
+4 -3
View File
@@ -4,9 +4,10 @@ import QtQuick.Layouts 1.15
import Monitoring 1.0
import Qt.labs.settings 1.0
import AppLayouts.Wallet.stores 1.0 as WalletStores
import StatusQ.Core 0.1
Component {
ColumnLayout {
spacing: 0
@@ -91,7 +92,7 @@ Component {
}
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: {
@@ -229,7 +230,7 @@ Component {
}
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: {
+1 -1
View File
@@ -26,7 +26,7 @@ Item {
initialItem: backupSeedIntroPage
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
acceptedButtons: Qt.BackButton
enabled: backButton.visible
@@ -5,6 +5,8 @@ import QtQuick.Layouts 1.14
import Storybook 1.0
import Models 1.0
import StatusQ.Core 0.1
ListView {
id: root
@@ -115,7 +117,7 @@ ListView {
source: model.icon
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: iconSelector.open()
@@ -149,7 +151,7 @@ ListView {
source: model.banner
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: bannerSelector.open()
+3 -2
View File
@@ -3,6 +3,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StatusQ 0.1
import StatusQ.Core 0.1
import Qt.labs.qmlmodels 1.0
@@ -99,7 +100,7 @@ Item {
font.bold: true
text: model.name
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: {
@@ -152,7 +153,7 @@ Item {
font.bold: true
text: model.name
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: secondModel.setProperty(
+1 -1
View File
@@ -57,7 +57,7 @@ SplitView {
icon: "chevron-down"
color: Theme.palette.baseColor1
MouseArea {
StatusMouseArea {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
@@ -100,7 +100,7 @@ SplitView {
+ " Community"
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: doubleFlickable.flip1Folding()
@@ -175,7 +175,7 @@ SplitView {
+ " Others"
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: doubleFlickable.flip2Folding()
+2 -1
View File
@@ -3,6 +3,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StatusQ 0.1
import StatusQ.Core 0.1
Item {
id: root
@@ -147,7 +148,7 @@ Item {
color: model.color
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: {
+3 -1
View File
@@ -9,6 +9,8 @@ import SortFilterProxyModel 0.2
import Storybook 1.0
import StatusQ.Core 0.1
SplitView {
id: root
@@ -75,7 +77,7 @@ SplitView {
Drag.active: dragArea.drag.active
MouseArea {
StatusMouseArea {
id: dragArea
anchors.fill: parent
+2 -1
View File
@@ -3,6 +3,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StatusQ 0.1
import StatusQ.Core 0.1
Item {
id: root
@@ -137,7 +138,7 @@ Item {
ScrollBar.vertical: ScrollBar {}
delegate: MouseArea {
delegate: StatusMouseArea {
id: dragArea
property bool held: false
+3 -2
View File
@@ -3,6 +3,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StatusQ 0.1
import StatusQ.Core 0.1
import SortFilterProxyModel 0.2
@@ -127,7 +128,7 @@ Item {
text: "↕️"
}
MouseArea {
StatusMouseArea {
id: sourceDragArea
property bool held: false
@@ -308,7 +309,7 @@ Item {
text: "↕️"
}
MouseArea {
StatusMouseArea {
id: dragArea
property bool held: false
+2 -1
View File
@@ -3,6 +3,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StatusQ 0.1
import StatusQ.Core 0.1
import StatusQ.Core.Utils 0.1
import SortFilterProxyModel 0.2
@@ -287,7 +288,7 @@ Item {
font.pixelSize: 10
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: {
+2 -1
View File
@@ -3,6 +3,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import QtQml 2.15
import StatusQ.Core 0.1
Item {
id: root
@@ -120,7 +121,7 @@ Item {
Drag.active: dragArea.drag.active
MouseArea {
StatusMouseArea {
id: dragArea
anchors.fill: parent
+1 -1
View File
@@ -207,7 +207,7 @@ SplitView {
Qt.openUrlExternally(link)
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
visible: !!slidesLabel.hoveredLink
+2 -1
View File
@@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import StatusQ 0.1
import StatusQ.Controls 0.1
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import Storybook 1.0
@@ -57,7 +58,7 @@ SplitView {
// needs to be on top of the stack
// we're here only to provide the Back button feature
MouseArea {
StatusMouseArea {
anchors.fill: parent
acceptedButtons: Qt.BackButton
cursorShape: undefined // don't override the cursor coming from the stack
+3 -2
View File
@@ -2,6 +2,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StatusQ.Core 0.1
import StatusQ.Core.Utils 0.1
import utils 1.0
@@ -124,7 +125,7 @@ ListView {
text: "↕️"
visible: root.movable
MouseArea {
StatusMouseArea {
id: dragArea
property bool held: pressed
@@ -167,7 +168,7 @@ ListView {
text: `<u>${roleName}</u>: ${mayBeImage ? `<img src="${value}" width="15" height="15">`
: valueSanitized}${separator}`
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: root.rowClicked(
+3 -1
View File
@@ -1,6 +1,8 @@
import QtQuick 2.14
import QtQuick.Controls 2.14
import StatusQ.Core 0.1
Popup {
id: root
@@ -46,7 +48,7 @@ Popup {
anchors.centerIn: parent
asynchronous: true
MouseArea {
StatusMouseArea {
id: ma
anchors.fill: parent
onClicked: root.selected(model.image)
+3 -1
View File
@@ -2,6 +2,8 @@ import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQml.Models 2.15
import StatusQ.Core 0.1
GridView {
id: root
@@ -33,7 +35,7 @@ GridView {
running: image.status !== Image.Ready
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: root.clicked(model.index)
+3 -1
View File
@@ -2,6 +2,8 @@ import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StatusQ.Core 0.1
Rectangle {
id: root
@@ -162,7 +164,7 @@ Rectangle {
}
}
MouseArea {
StatusMouseArea {
id: mouseArea
visible: isVisual || showNonVisual
@@ -1,6 +1,7 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import StatusQ.Core 0.1
ListView {
ScrollBar.vertical: ScrollBar {}
@@ -28,7 +29,7 @@ ListView {
value: mouseArea.containsMouse
}
MouseArea {
StatusMouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
+4 -2
View File
@@ -3,6 +3,8 @@ import QtQuick.Controls 2.15
import Storybook 1.0
import StatusQ.Core 0.1
ListView {
id: root
@@ -52,14 +54,14 @@ ListView {
return "gray"
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: root.statusClicked()
}
}
MouseArea {
StatusMouseArea {
id: dragArea
anchors.fill: parent
@@ -1,6 +1,8 @@
#pragma once
#include <QObject>
#include <QQuickItem>
#include <QMouseEvent>
class SystemUtilsInternal : public QObject
{
@@ -11,4 +13,5 @@ public:
Q_INVOKABLE QString qtRuntimeVersion() const;
Q_INVOKABLE void restartApplication() const;
Q_INVOKABLE void downloadImageByUrl(const QUrl& url, const QString& path) const;
Q_INVOKABLE void synthetizeRightClick(QQuickItem* item, qreal x, qreal y, Qt::KeyboardModifiers modifiers) const;
};
+2 -1
View File
@@ -1,6 +1,7 @@
import QtQuick 2.14
import QtQuick.Controls 2.14
import StatusQ.Core 0.1
import StatusQ.Controls 0.1
Item {
@@ -12,7 +13,7 @@ Item {
width: themeSwitch.width
height: themeSwitch.height
MouseArea {
StatusMouseArea {
id: sensor
hoverEnabled: true
anchors.fill: parent
@@ -69,7 +69,7 @@ GridLayout {
}
// Outsite area
MouseArea {
StatusMouseArea {
height: root.height
width: root.width
onClicked: {
@@ -35,7 +35,7 @@ Rectangle {
Qt.openUrlExternally(link)
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
visible: !!docs.hoveredLink
cursorShape: Qt.PointingHandCursor
@@ -22,7 +22,7 @@ StatusBaseText {
expanded = actualWidth <= maxWidth
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: root.expandable ? Qt.PointingHandCursor : Qt.arrowCursor
enabled: root.expandable
@@ -132,7 +132,7 @@ Item {
color: Theme.palette.baseColor1
MouseArea {
StatusMouseArea {
id: copyMouseArea
anchors.fill: parent
@@ -174,7 +174,7 @@ Item {
radius: 36
}
MouseArea {
StatusMouseArea {
id: mainMouseArea
anchors.fill: parent
@@ -219,7 +219,7 @@ Rectangle {
z: root.z - 1
}
MouseArea {
StatusMouseArea {
id: sensor
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
@@ -31,7 +31,7 @@ Item {
signal categoryAddButtonClicked(string id)
signal toggleCollapsedCommunityCategory(string categoryId, bool collapsed)
MouseArea {
StatusMouseArea {
id: sensor
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
@@ -70,7 +70,7 @@ Rectangle {
opacity: dragged ? 0.7 : 1
MouseArea {
StatusMouseArea {
id: sensor
HoverHandler {
@@ -178,7 +178,7 @@ Rectangle {
icon: Theme.palette.name === "light" ? "tiny/muted" : "tiny/muted-white"
visible: root.muted
MouseArea {
StatusMouseArea {
id: mutedIconSensor
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
@@ -89,7 +89,7 @@ Item {
}
}
MouseArea {
StatusMouseArea {
id: hueArea
property bool hoverOnGauge: false
@@ -151,7 +151,7 @@ Item {
}
}
MouseArea {
StatusMouseArea {
id: satValArea
anchors.fill: parent
hoverEnabled: true
@@ -24,7 +24,7 @@ Rectangle {
color: Theme.palette.statusListItem.backgroundColor
MouseArea {
StatusMouseArea {
id: sensor
anchors.fill: parent
hoverEnabled: true
@@ -279,7 +279,7 @@ ItemDelegate {
border.color: Theme.palette.baseColor2
radius: root.customizable ? 0 : 8
MouseArea {
StatusMouseArea {
id: dragHandler
anchors.fill: parent
drag.target: root.dragEnabled ? root : null
@@ -159,7 +159,7 @@ Rectangle {
Theme.palette.directColor1
}
MouseArea {
StatusMouseArea {
id: sensor
objectName: "ExpandableItem"
anchors.fill: parent
@@ -212,7 +212,7 @@ Item {
}
// Drag and zoom
MouseArea {
StatusMouseArea {
anchors.fill: parent
enabled: root.interactive
@@ -129,7 +129,7 @@ StatusFlowSelector {
text: OperatorsUtils.setOperatorTextFormat(model.operator)
color: Theme.palette.primaryColor1
font.pixelSize: 17
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
@@ -159,7 +159,7 @@ StatusFlowSelector {
titleText.font.pixelSize: Theme.primaryTextFontSize
leftPadding: root.tagLeftPadding
MouseArea {
StatusMouseArea {
anchors.fill: parent
enabled: root.itemsClickable
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
@@ -102,7 +102,7 @@ Rectangle {
property int subTitleBadgeLoaderAlignment: Qt.AlignVCenter
signal clicked(string itemId, var mouse)
signal titleClicked(string titleId)
signal titleClicked(string titleId, var mouse)
signal iconClicked(var mouse)
enum Type {
@@ -121,7 +121,7 @@ Rectangle {
color: bgColor
property color bgColor: {
if (sensor.containsMouse || root.highlighted) {
if (sensor.containsMouse || statusListItemTitleMouseArea.containsMouse || root.highlighted) {
switch(type) {
case StatusListItem.Type.Primary:
return Theme.palette.baseColor2
@@ -143,7 +143,7 @@ Rectangle {
}
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: (mouse) => {
@@ -151,7 +151,7 @@ Rectangle {
}
}
MouseArea {
StatusMouseArea {
id: sensor
objectName: root.objectName + "_sensor"
@@ -243,15 +243,16 @@ Rectangle {
visible: statusListItemTitle.truncated && statusListItemTitleMouseArea.containsMouse
}
MouseArea {
StatusMouseArea {
id: statusListItemTitleMouseArea
anchors.fill: parent
enabled: root.enabled
cursorShape: !root.forceDefaultCursor && sensor.enabled && containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
hoverEnabled: true
acceptedButtons: Qt.LeftButton | Qt.RightButton
propagateComposedEvents: root.propagateTitleClicks
onClicked: (mouse) => {
root.titleClicked(root.titleId)
root.titleClicked(root.titleId, mouse)
mouse.accepted = false
}
}
@@ -48,7 +48,7 @@ Control {
border.color: root.bgBorderColor
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: (mouse) => {
@@ -82,7 +82,7 @@ Control {
color: Theme.palette.primaryColor1
icon: "close-circle"
visible: root.closeButtonVisible
MouseArea {
StatusMouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: (mouse) => {
@@ -133,10 +133,10 @@ Item {
/*
\qmlmethod StatusListPicker::close()
It can be used to force to close the drop-down picker list whenever the consumer needs it. For example by adding an outside MouseArea to close the picker when user clicks outsite the component:
It can be used to force to close the drop-down picker list whenever the consumer needs it. For example by adding an outside StatusMouseArea to close the picker when user clicks outsite the component:
\qml
// Outsite area
MouseArea {
StatusMouseArea {
height: root.height
width: root.width
onClicked: { currencyPicker.close() }
@@ -326,7 +326,7 @@ Item {
itemPickerChanged(root.proxy.key(model), checked)
}
MouseArea {
StatusMouseArea {
id: mouseArea
enabled: root.enableSelectableItem
anchors.fill: parent
@@ -177,7 +177,7 @@ ItemDelegate {
color: root.color
radius: Theme.radius
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: root.enabled && root.hoverEnabled && root.hovered ? Qt.PointingHandCursor : undefined
acceptedButtons: Qt.LeftButton | Qt.RightButton
@@ -190,7 +190,7 @@ Control {
implicitWidth: messageLayout.implicitWidth
implicitHeight: messageLayout.implicitHeight
MouseArea {
StatusMouseArea {
id: mouseArea
anchors.fill: parent
}
@@ -235,7 +235,7 @@ Control {
bridgeBadge.visible: root.messageDetails.contentType === StatusMessage.ContentType.BridgeMessage
bridgeBadge.image.source: root.messageDetails.sender.badgeImage
MouseArea {
StatusMouseArea {
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton
anchors.fill: parent
@@ -169,7 +169,7 @@ StatusRoundedComponent {
else return root.manualMaxDimension
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
enabled: root.enabled && root.interactive && mediaLoader.visible && mediaLoader.item
cursorShape: root.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
@@ -96,7 +96,7 @@ Loader {
readonly property alias hovered: mouseArea.containsMouse
MouseArea {
StatusMouseArea {
id: mouseArea
anchors.fill: parent
@@ -139,7 +139,7 @@ Control {
StatusToastMessage {
id: toastMessage
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: {
toastMessage.open(qsTr("Verification Request Sent"), "", "checkmark-circle", 1, false,"");
@@ -274,7 +274,7 @@ Control {
contentItem: Item {
implicitWidth: layout.implicitWidth
implicitHeight: layout.implicitHeight
MouseArea {
StatusMouseArea {
anchors.fill: parent
onMouseXChanged: {
root.open = (mouseX < (root.width/3));
@@ -1,5 +1,7 @@
import QtQuick 2.15
import StatusQ.Core 0.1
import "./Library/Library.js" as Lib
Canvas {
@@ -97,7 +99,7 @@ Canvas {
}
}
MouseArea {
StatusMouseArea {
id: mouse
anchors.fill: parent
hoverEnabled: enabled
@@ -77,7 +77,7 @@ Item {
}
}
MouseArea {
StatusMouseArea {
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton
anchors.fill: parent
@@ -133,7 +133,7 @@ Item {
text: d.showReactionAuthors(model.jsonArrayOfUsersReactedWithThisEmoji, model.emojiId)
}
MouseArea {
StatusMouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
@@ -171,7 +171,7 @@ Item {
color: addEmojiButton.isHovered ? Theme.palette.primaryColor1 : Theme.palette.baseColor1
}
MouseArea {
StatusMouseArea {
id: addEmojiButtonMouseArea
anchors.fill: addEmojiButton
cursorShape: Qt.PointingHandCursor
@@ -75,7 +75,7 @@ Item {
name: replyDetails.sender.displayName
asset: replyDetails.sender.profileImage.assetSettings
ringSettings: replyDetails.sender.profileImage.ringSettings
MouseArea {
StatusMouseArea {
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton
anchors.fill: parent
@@ -91,7 +91,7 @@ Item {
text: replyDetails.amISender ? qsTr("You") : replyDetails.sender.displayName
font.underline: mouseArea.containsMouse
MouseArea {
StatusMouseArea {
id: mouseArea
anchors.fill: parent
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
@@ -157,7 +157,7 @@ Item {
}
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
enabled: !root.replyDetails.messageDeleted && root.replyDetails.sender.id
hoverEnabled: true
@@ -56,7 +56,7 @@ Loader {
statusSticker.stickerLoaded()
}
}
MouseArea {
StatusMouseArea {
enabled: !noMouseArea && (sticker.status === Image.Ready)
cursorShape: noHover ? Qt.ArrowCursor : Qt.PointingHandCursor
anchors.fill: parent
@@ -78,7 +78,7 @@ Loader {
StatusIcon {
icon: "refresh"
color: Theme.palette.directColor1
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: root.reload()
@@ -216,7 +216,7 @@ Button {
// stop the mouse clicks in the "loading" or non-interactive state w/o disabling the whole button
// as this would make it impossible to have hover events or a tooltip
MouseArea {
StatusMouseArea {
id: mouseArea
anchors.fill: parent
acceptedButtons: Qt.AllButtons
@@ -309,7 +309,7 @@ Item {
return sensor.containsMouse ? Theme.palette.primaryColor2 : "transparent"
}
MouseArea {
StatusMouseArea {
id: sensor
anchors.fill: parent
enabled: edit.enabled
@@ -495,7 +495,7 @@ Item {
asset.isLetterIdenticon: root.asset.isLetterIdenticon
name: root.letterIconName
MouseArea {
StatusMouseArea {
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton
anchors.fill: parent
@@ -139,7 +139,7 @@ Button {
color: mutedIconSensor.containsMouse ? Theme.palette.directColor1 : Theme.palette.baseColor1
visible: root.muted
MouseArea {
StatusMouseArea {
id: mutedIconSensor
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
@@ -21,7 +21,7 @@ Rectangle {
border.width: 1
color: root.highlighted || mouseArea.containsMouse ? Theme.palette.primaryColor2 : "transparent"
MouseArea {
StatusMouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
@@ -169,7 +169,7 @@ Control {
}
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: root.hovered? Qt.PointingHandCursor : undefined
onClicked: root.clicked()
@@ -120,7 +120,7 @@ Rectangle {
return backgroundSettings.disabledColor
}
}
MouseArea {
StatusMouseArea {
id: sensor
anchors.fill: parent
@@ -46,7 +46,7 @@ TabButton {
radius: statusIconTabButton.width / 2
}
MouseArea {
StatusMouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
acceptedButtons: Qt.NoButton
@@ -76,7 +76,7 @@ AbstractButton {
}
// TODO: To remove when switch to Qt 5.15
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.NoButton
@@ -475,7 +475,7 @@ Control {
icon: root.labelIcon
color: root.labelIconColor
MouseArea {
StatusMouseArea {
anchors.fill: parent
enabled: root.labelIconClickable
hoverEnabled: root.labelIconClickable
@@ -52,7 +52,7 @@ StatusBaseText {
font.weight: Font.Medium
font.underline: root.containsMouse
MouseArea {
StatusMouseArea {
id: textMouseArea
anchors.fill: parent
hoverEnabled: true
@@ -49,7 +49,7 @@ StatusIconTabButton {
anchors.topMargin: 4
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton
@@ -34,7 +34,7 @@ Button {
// otherwise there is no pointing hand cursor when button is hovered
MouseArea {
StatusMouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: Qt.PointingHandCursor
@@ -1,6 +1,7 @@
import QtQuick 2.15
import StatusQ 0.1
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Controls.Validators 0.1
@@ -13,7 +14,7 @@ import StatusQ.Controls.Validators 0.1
The \c StatusPinInput displays N visual circles corresponging with the pin length to introduce.
It runs a blinking animation when the control is focused and ready to introduce the pin, as well as, an hovering feedback when user is in the MouseArea where is able to click into the control.
It runs a blinking animation when the control is focused and ready to introduce the pin, as well as, an hovering feedback when user is in the StatusMouseArea where is able to click into the control.
This pin input control allows introducing validators.
@@ -314,12 +315,12 @@ Item {
}
}
MouseArea {
StatusMouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
// MouseArea behavior:
// StatusMouseArea behavior:
onClicked: forceFocus()
onContainsMouseChanged: { if(containsMouse) { cursorShape = Qt.PointingHandCursor } }
}
@@ -149,7 +149,7 @@ Rectangle {
return backgroundSettings.disabledColor
}
MouseArea {
StatusMouseArea {
id: sensor
anchors.fill: parent
@@ -252,7 +252,7 @@ Item {
font.pixelSize: 13
elide: Text.ElideRight
}
MouseArea {
StatusMouseArea {
id: mouseArea
width: seedSuggestionsList.width
height: parent.height
@@ -152,7 +152,7 @@ Item {
wrapMode: Text.WordWrap
}
MouseArea {
StatusMouseArea {
id: mouseArea
anchors.fill: inputRectangle
cursorShape: Qt.PointingHandCursor
@@ -34,7 +34,7 @@ Item {
clip:true
MouseArea {
StatusMouseArea {
id: sensor
enabled: !edit.activeFocus
hoverEnabled: true
@@ -19,7 +19,7 @@ Item {
implicitWidth: 40
implicitHeight: 40
MouseArea {
StatusMouseArea {
id: sensor
enabled: root.enabled
cursorShape: root.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
@@ -97,7 +97,7 @@ Control {
width: d.tagIconsSize
height: d.tagIconsSize
icon: "close"
MouseArea {
StatusMouseArea {
enabled: !root.isReadonly
anchors.fill: parent
hoverEnabled: true
@@ -136,7 +136,7 @@ RowLayout {
}
}
MouseArea {
StatusMouseArea {
id: mouseArea
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
@@ -1,6 +1,7 @@
import QtQuick 2.13
import QtQuick.Controls 2.15
import StatusQ.Core 0.1
import StatusQ.Controls 0.1
StatusIcon {
@@ -8,7 +9,7 @@ StatusIcon {
property string tooltipText
MouseArea {
StatusMouseArea {
id: tooltipSensor
anchors.fill: parent
hoverEnabled: true
@@ -0,0 +1,54 @@
import QtQuick 2.15
import StatusQ.Core 0.1
/*!
\qmltype StatusMouseArea
\inherits StatusMouseArea
\inqmlmodule StatusQ.Components
\since StatusQ.Components 0.1
\brief Mouse area that emits right click event on long press.
Example:
\qml
StatusMouseArea {
anchors.fill: parent
buttons: Qt.LeftButton | Qt.RightButton
onClicked: {
if (mouse.button === Qt.RightButton) {
console.log("Right button clicked")
mouse.accepted = true
}
if (mouse.button === Qt.LeftButton) {
console.log("Left button clicked")
mouse.accepted = true
}
}
}
\endqml
*/
MouseArea {
id: root
onPressAndHold: (mouse) => {
if (mouse.button === Qt.LeftButton) {
SystemUtils.synthetizeRightClick(root, mouse.x, mouse.y, mouse.modifiers)
}
}
Loader {
id: tapLoader
anchors.fill: parent
active: root.acceptedButtons === Qt.RightButton
sourceComponent: TapHandler {
gesturePolicy: TapHandler.ReleaseWithinBounds // exclusive grab on press
acceptedButtons: Qt.LeftButton
acceptedDevices: PointerDevice.TouchScreen
onLongPressed: () => {
SystemUtils.synthetizeRightClick(root, point.position.x, point.position.y, point.modifiers)
}
}
}
}
+1
View File
@@ -11,6 +11,7 @@ StatusIconWithTooltip 0.1 StatusIconWithTooltip.qml
StatusIdenticonRingSettings 0.1 StatusIdenticonRingSettings.qml
StatusListView 0.1 StatusListView.qml
StatusModalHeaderSettings 0.1 StatusModalHeaderSettings.qml
StatusMouseArea 0.1 StatusMouseArea.qml
StatusProfileImageSettings 0.1 StatusProfileImageSettings.qml
StatusRollArea 0.1 StatusRollArea.qml
StatusScrollView 0.1 StatusScrollView.qml
@@ -3,7 +3,7 @@ import QtQuick 2.13
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
MouseArea {
StatusMouseArea {
id: statusMacTrafficLights
signal close()
@@ -47,7 +47,7 @@ MouseArea {
}
MouseArea {
StatusMouseArea {
id: closeSensor
anchors.fill: parent
@@ -76,7 +76,7 @@ MouseArea {
scale: 0.27
}
MouseArea {
StatusMouseArea {
id: miniSensor
anchors.fill: parent
@@ -104,7 +104,7 @@ MouseArea {
scale: 0.25
}
MouseArea {
StatusMouseArea {
id: maxiSensor
anchors.fill: parent
@@ -61,7 +61,7 @@ Rectangle {
color: Theme.palette.directColor1
}
MouseArea {
StatusMouseArea {
id: minimizeSensor
anchors.fill: parent
hoverEnabled: true
@@ -84,7 +84,7 @@ Rectangle {
color: Theme.palette.directColor1
}
MouseArea {
StatusMouseArea {
id: maximizeSensor
anchors.fill: parent
hoverEnabled: true
@@ -107,7 +107,7 @@ Rectangle {
color: closeSensor.containsMouse ? Theme.palette.white : Theme.palette.directColor1
}
MouseArea {
StatusMouseArea {
id: closeSensor
anchors.fill: parent
hoverEnabled: true
@@ -89,7 +89,7 @@ Rectangle {
radius: root.radius
color: root.internalOverlayColor
MouseArea {
StatusMouseArea {
anchors.fill: parent
anchors.bottomMargin: popupLoader.height
onClicked: {
@@ -178,7 +178,7 @@ MenuItem {
}
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.NoButton
@@ -157,7 +157,7 @@ StatusModal {
contentItem: Item {
anchors.fill: parent
MouseArea {
StatusMouseArea {
id: sensor
anchors.fill: parent
hoverEnabled: true
@@ -297,7 +297,7 @@ StatusModal {
}
propagateTitleClicks: !root.acceptsTitleClick(titleId)
onTitleClicked: {
onTitleClicked: (titleId, mouse) => {
if (root.acceptsTitleClick(titleId)) {
root.resultItemTitleClicked(titleId)
}
@@ -1,5 +1,6 @@
import QtQuick 2.15
import StatusQ.Core 0.1
import StatusQ.Popups 0.1
/*!
@@ -74,7 +75,7 @@ StatusMenuItem {
type: root.success ? StatusAction.Type.Success : StatusAction.Type.Normal
icon.name: root.success ? root.successIconName : root.icon.name
}
MouseArea {
StatusMouseArea {
// NOTE Using mouse area to block menu auto closing
anchors.fill: parent
hoverEnabled: true
@@ -96,7 +96,7 @@ Row {
}
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: enabled ? Qt.PointingHandCursor
@@ -64,7 +64,7 @@ Rectangle {
onEditButtonClicked: statusModalHeader.editButtonClicked()
}
MouseArea {
StatusMouseArea {
anchors.fill: imageWithTitle
visible: !!statusModalHeader.popupMenu
cursorShape: Qt.PointingHandCursor
+1
View File
@@ -184,6 +184,7 @@
<file>StatusQ/Core/StatusIdenticonRingSettings.qml</file>
<file>StatusQ/Core/StatusListView.qml</file>
<file>StatusQ/Core/StatusModalHeaderSettings.qml</file>
<file>StatusQ/Core/StatusMouseArea.qml</file>
<file>StatusQ/Core/StatusProfileImageSettings.qml</file>
<file>StatusQ/Core/StatusRollArea.qml</file>
<file>StatusQ/Core/StatusScrollView.qml</file>
+16
View File
@@ -6,6 +6,7 @@
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QProcess>
#include <QQuickItem>
#include <QSaveFile>
SystemUtilsInternal::SystemUtilsInternal(QObject *parent)
@@ -80,3 +81,18 @@ void SystemUtilsInternal::downloadImageByUrl(
<< targetFile;
});
}
void SystemUtilsInternal::synthetizeRightClick(QQuickItem* item, qreal x, qreal y, Qt::KeyboardModifiers modifiers) const
{
if (!item)
return;
// Synthesize a right click event on the given item
auto leftClickRelease = new QMouseEvent(QEvent::MouseButtonRelease, {x, y}, Qt::LeftButton, Qt::NoButton, modifiers);
auto rightClickPress = new QMouseEvent(QEvent::MouseButtonPress, {x, y}, Qt::RightButton, Qt::NoButton, modifiers);
auto rightClickRelease = new QMouseEvent(QEvent::MouseButtonRelease, {x, y}, Qt::RightButton, Qt::NoButton, modifiers);
QCoreApplication::postEvent(item, leftClickRelease);
QCoreApplication::postEvent(item, rightClickPress);
QCoreApplication::postEvent(item, rightClickRelease);
}
@@ -1,5 +1,6 @@
import QtQuick 2.15
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import utils 1.0
@@ -30,7 +31,7 @@ Rectangle {
font.pixelSize: 15
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: {
root.clicked(channel);
@@ -2,6 +2,7 @@ import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
import shared 1.0
@@ -38,7 +39,7 @@ Item {
font.pixelSize: 15
color: Theme.palette.primaryColor1
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
@@ -71,7 +72,7 @@ Item {
anchors.leftMargin: 2
anchors.bottom: shareKeyLink.bottom
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
@@ -197,7 +197,7 @@ Item {
}
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
propagateComposedEvents: true
onPressed: {
@@ -161,7 +161,7 @@ Rectangle {
anchors.leftMargin: Theme.smallPadding
}
MouseArea {
StatusMouseArea {
id: mouseArea
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
@@ -132,7 +132,7 @@ StatusDialog {
shouldRepeatHeader: true
}
MouseArea {
StatusMouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
@@ -183,7 +183,7 @@ StatusDialog {
anchors.rightMargin: Theme.bigPadding
anchors.verticalCenter: parent.verticalCenter
ButtonGroup.group: pinButtonGroup
onCheckedChanged: { // NB this should be `onToggled` but MouseArea above handles the whole delegate
onCheckedChanged: { // NB this should be `onToggled` but StatusMouseArea above handles the whole delegate
root.messageToUnpin = checked ? model.id : ""
}
}
@@ -99,7 +99,7 @@ Item {
Layout.preferredHeight: 40
input.topPadding: 4
input.bottomPadding: 4
MouseArea {
StatusMouseArea {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
@@ -155,7 +155,7 @@ Control {
icon: "delete"
color: Theme.palette.directColor1
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
@@ -60,7 +60,7 @@ StatusFlowSelector {
: Theme.palette.dangerColor3
radius: root.placeholderItemHeight / 2
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: root.itemClicked(model.index, mouse, delegateRoot)
@@ -2,6 +2,7 @@ import QtQuick 2.14
import StatusQ.Components 0.1
import StatusQ.Controls 0.1
import StatusQ.Core 0.1
StatusListItem {
property alias checked: checkBox.checked
@@ -32,9 +33,9 @@ StatusListItem {
}
]
// using MouseArea instead of build-in 'clicked' signal to avoid
// using StatusMouseArea instead of build-in 'clicked' signal to avoid
// intercepting event by the StatusCheckBox
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: {
checkBox.toggle()
@@ -338,7 +338,7 @@ Item {
radioButtonSize: StatusRadioButton.Size.Small
selected: model.selected
MouseArea {
StatusMouseArea {
id: sensor1
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
@@ -380,7 +380,7 @@ Item {
radioButtonSize: StatusRadioButton.Size.Small
selected: model.selected
MouseArea {
StatusMouseArea {
id: sensor2
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
@@ -189,7 +189,7 @@ StatusListView {
height: 16
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
@@ -89,7 +89,7 @@ Control {
icon: "delete"
color: Theme.palette.directColor1
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
@@ -47,9 +47,9 @@ StatusListItem {
}
]
// using MouseArea instead of build-in 'clicked' signal to avoid
// using StatusMouseArea instead of build-in 'clicked' signal to avoid
// intercepting event by the StatusRadioButton
MouseArea {
StatusMouseArea {
anchors.fill: parent
onClicked: {
if (!radioButton.checked)
@@ -88,7 +88,7 @@ StatusScrollView {
}
}
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
hoverEnabled: true
@@ -190,7 +190,7 @@ ItemDelegate {
}
}
MouseArea {
StatusMouseArea {
anchors.fill: parent
acceptedButtons: Qt.AllButtons
@@ -26,7 +26,7 @@ Control {
color: mouseArea.containsMouse ? Theme.palette.statusListItem.highlightColor : "transparent"
radius: 8
MouseArea {
StatusMouseArea {
id: mouseArea
anchors.fill: parent
cursorShape: root.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
@@ -25,7 +25,7 @@ Rectangle {
signal buttonClicked()
MouseArea {
StatusMouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
propagateComposedEvents: true
@@ -109,7 +109,7 @@ StatusDialog {
shouldRepeatHeader: true
}
MouseArea {
StatusMouseArea {
id: mouseArea
acceptedButtons: Qt.LeftButton
cursorShape: Qt.PointingHandCursor

Some files were not shown because too many files have changed in this diff Show More