2023-03-20 12:29:05 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2024-02-23 11:28:19 +00:00
|
|
|
import QtGraphicalEffects 1.0
|
|
|
|
import QtQml 2.15
|
2023-03-20 12:29:05 +00:00
|
|
|
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2024-02-09 13:31:36 +00:00
|
|
|
import AppLayouts.Wallet.controls 1.0
|
|
|
|
|
2023-03-20 12:29:05 +00:00
|
|
|
import utils 1.0
|
2024-03-03 11:02:30 +00:00
|
|
|
import shared.controls 1.0
|
2023-03-20 12:29:05 +00:00
|
|
|
|
|
|
|
StatusDraggableListItem {
|
|
|
|
id: root
|
|
|
|
|
2024-03-04 22:07:09 +00:00
|
|
|
property alias actionComponent: additionalActionsLoader.sourceComponent
|
2024-03-10 21:31:48 +00:00
|
|
|
|
2023-03-20 12:29:05 +00:00
|
|
|
property int showcaseVisibility: Constants.ShowcaseVisibility.NoOne
|
2024-03-10 21:31:48 +00:00
|
|
|
property int showcaseMaxVisibility: Constants.ShowcaseVisibility.Everyone
|
|
|
|
|
2024-02-23 11:28:19 +00:00
|
|
|
property bool blurState: false
|
2024-03-03 11:02:30 +00:00
|
|
|
property bool contextMenuEnabled: true
|
|
|
|
property string tooltipTextWhenContextMenuDisabled
|
2023-03-20 12:29:05 +00:00
|
|
|
|
|
|
|
signal showcaseVisibilityRequested(int value)
|
|
|
|
|
|
|
|
component ShowcaseVisibilityAction: StatusMenuItem {
|
2024-03-10 21:31:48 +00:00
|
|
|
id: menuItem
|
|
|
|
required property int showcaseVisibility
|
|
|
|
|
|
|
|
ButtonGroup.group: showcaseVisibilityGroup
|
2023-03-20 12:29:05 +00:00
|
|
|
icon.name: ProfileUtils.visibilityIcon(showcaseVisibility)
|
|
|
|
icon.color: Theme.palette.primaryColor1
|
2024-03-10 21:31:48 +00:00
|
|
|
checked: root.showcaseVisibility === showcaseVisibility
|
|
|
|
|
|
|
|
enabled: root.showcaseMaxVisibility >= showcaseVisibility
|
2023-03-20 12:29:05 +00:00
|
|
|
}
|
|
|
|
|
2024-02-23 11:28:19 +00:00
|
|
|
layer.enabled: root.blurState
|
|
|
|
layer.effect: fastBlur
|
|
|
|
|
2024-02-23 07:14:55 +00:00
|
|
|
height: ProfileUtils.defaultDelegateHeight
|
|
|
|
topInset: 0
|
|
|
|
bottomInset: 0
|
|
|
|
changeColorOnDragActive: false
|
|
|
|
bgColor: Theme.palette.getColor(Theme.palette.statusAppLayout.rightPanelBackgroundColor, 0.7)
|
|
|
|
|
2023-03-20 12:29:05 +00:00
|
|
|
icon.width: 40
|
|
|
|
icon.height: 40
|
|
|
|
|
|
|
|
draggable: true
|
|
|
|
dragAxis: Drag.XAndYAxis
|
|
|
|
|
|
|
|
actions: [
|
2024-03-04 22:07:09 +00:00
|
|
|
Loader {
|
|
|
|
id: additionalActionsLoader
|
2023-03-20 12:29:05 +00:00
|
|
|
|
2024-03-03 11:02:30 +00:00
|
|
|
Layout.maximumWidth: root.width *.4
|
|
|
|
},
|
|
|
|
DisabledTooltipButton {
|
|
|
|
interactive: root.contextMenuEnabled
|
|
|
|
tooltipText: root.tooltipTextWhenContextMenuDisabled
|
|
|
|
buttonComponent: StatusRoundButton {
|
|
|
|
enabled: root.contextMenuEnabled
|
|
|
|
icon.name: ProfileUtils.visibilityIcon(root.showcaseVisibility)
|
|
|
|
width: 58
|
|
|
|
height: 30
|
|
|
|
border.width: 1
|
|
|
|
border.color: Theme.palette.directColor7
|
|
|
|
radius: 14
|
|
|
|
highlighted: menuLoader.item && menuLoader.item.opened
|
|
|
|
onClicked: {
|
|
|
|
menuLoader.active = true
|
|
|
|
menuLoader.item.popup(width - menuLoader.item.width, height)
|
2023-03-20 12:29:05 +00:00
|
|
|
}
|
|
|
|
|
2024-03-03 11:02:30 +00:00
|
|
|
ButtonGroup {
|
|
|
|
id: showcaseVisibilityGroup
|
|
|
|
exclusive: true
|
|
|
|
onClicked: function(button) {
|
|
|
|
const newVisibility = (button as ShowcaseVisibilityAction).showcaseVisibility
|
|
|
|
if (newVisibility !== root.showcaseVisibility)
|
|
|
|
root.showcaseVisibilityRequested(newVisibility)
|
2023-03-20 12:29:05 +00:00
|
|
|
}
|
2024-03-03 11:02:30 +00:00
|
|
|
}
|
2023-03-20 12:29:05 +00:00
|
|
|
|
2024-03-03 11:02:30 +00:00
|
|
|
Loader {
|
|
|
|
id: menuLoader
|
|
|
|
active: false
|
|
|
|
sourceComponent: StatusMenu {
|
|
|
|
onClosed: menuLoader.active = false
|
|
|
|
StatusMenuHeadline { text: qsTr("Show to") }
|
|
|
|
|
2024-03-10 21:31:48 +00:00
|
|
|
Binding on width {
|
|
|
|
value: Math.max(implicitWidth, everyoneAction.implicitWidth, contactsAction.implicitWidth, idVerifiedContactsAction.implicitWidth) + margins * 2
|
|
|
|
delayed: true
|
|
|
|
}
|
|
|
|
|
2024-03-03 11:02:30 +00:00
|
|
|
ShowcaseVisibilityAction {
|
2024-03-10 21:31:48 +00:00
|
|
|
id: everyoneAction
|
2024-03-03 11:02:30 +00:00
|
|
|
showcaseVisibility: Constants.ShowcaseVisibility.Everyone
|
2024-03-10 21:31:48 +00:00
|
|
|
text: enabled ? qsTr("Everyone") : qsTr("Everyone (set account to Everyone)")
|
2024-03-03 11:02:30 +00:00
|
|
|
}
|
|
|
|
ShowcaseVisibilityAction {
|
2024-03-10 21:31:48 +00:00
|
|
|
id: contactsAction
|
2024-03-03 11:02:30 +00:00
|
|
|
showcaseVisibility: Constants.ShowcaseVisibility.Contacts
|
2024-03-10 21:31:48 +00:00
|
|
|
text: enabled ? qsTr("Contacts") : qsTr("Contacts (set account to Contacts)")
|
2024-03-03 11:02:30 +00:00
|
|
|
}
|
|
|
|
ShowcaseVisibilityAction {
|
2024-03-10 21:31:48 +00:00
|
|
|
id: idVerifiedContactsAction
|
2024-03-03 11:02:30 +00:00
|
|
|
showcaseVisibility: Constants.ShowcaseVisibility.IdVerifiedContacts
|
2024-03-10 21:31:48 +00:00
|
|
|
text: enabled ? qsTr("ID verified contacts") : qsTr("ID verified contacts (set account to ID verified contacts)")
|
2024-03-03 11:02:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
|
|
|
ShowcaseVisibilityAction {
|
|
|
|
showcaseVisibility: Constants.ShowcaseVisibility.NoOne
|
|
|
|
text: qsTr("No one")
|
|
|
|
}
|
2023-03-20 12:29:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2024-02-23 11:28:19 +00:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: fastBlur
|
|
|
|
|
|
|
|
FastBlur {
|
|
|
|
radius: 32
|
|
|
|
transparentBorder: true
|
|
|
|
}
|
|
|
|
}
|
2023-03-20 12:29:05 +00:00
|
|
|
}
|