Various small unused components removed

This commit is contained in:
Michał Cieślak 2024-10-14 17:32:18 +02:00 committed by Michał
parent 1f61b77739
commit fe08742cc3
15 changed files with 4 additions and 415 deletions

View File

@ -1,4 +1,4 @@
import QtQuick 2.14 import QtQuick 2.15
/*! /*!
\qmltype StatusCenteredFlow \qmltype StatusCenteredFlow

View File

@ -1,58 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import utils 1.0
Rectangle {
id: root
property var isValid: true
property var isPending: false
property var validate: function() {
let isValid = true
for (let i=0; i<children.length; i++) {
const component = children[i]
if (component.hasOwnProperty("validate") && typeof component.validate === "function") {
isValid = component.validate()
}
if (component.hasOwnProperty("isPending")) {
isPending = component.isPending
}
}
root.isValid = isValid
root.isPending = isPending
return { isValid, isPending }
}
color: Style.current.background
StackView.onActivated: {
// parent refers to the StackView
parent.groupActivated(this)
}
Component.onCompleted: {
for (let i=0; i<children.length; i++) {
const component = children[i]
if (component.hasOwnProperty("isValid")) {
component.isValidChanged.connect(updateGroupValidityAndPendingStatus)
root.isValid = root.isValid && component.isValid // set the initial state
}
if (component.hasOwnProperty("isPending")) {
component.isPendingChanged.connect(updateGroupValidityAndPendingStatus)
root.isPending = component.isPending
}
}
}
function updateGroupValidityAndPendingStatus() {
let isValid = true
let isPending = false
for (let i=0; i<children.length; i++) {
const component = children[i]
if (component.hasOwnProperty("isValid")) {
isValid = isValid && component.isValid
}
if (component.hasOwnProperty("isPending")) {
isPending = component.isPending
}
}
root.isValid = isValid
root.isPending = isPending
}
}

View File

@ -1,17 +0,0 @@
import QtQuick 2.3
// This rectangle's only job is to mask the corner to make it less rounded... yep
Rectangle {
color: parent.color
width: 18
height: 18
property bool isCurrentUser: false
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
anchors.left: !isCurrentUser ? parent.left : undefined
anchors.leftMargin: 0
anchors.right: !isCurrentUser ? undefined : parent.right
anchors.rightMargin: 0
radius: 4
z: -1
}

View File

@ -13,7 +13,6 @@ LinkPreviewSettingsCardMenu 1.0 LinkPreviewSettingsCardMenu.qml
MessageMouseArea 1.0 MessageMouseArea.qml MessageMouseArea 1.0 MessageMouseArea.qml
MessageReactionsRow 1.0 MessageReactionsRow.qml MessageReactionsRow 1.0 MessageReactionsRow.qml
ProfileHeader 1.0 ProfileHeader.qml ProfileHeader 1.0 ProfileHeader.qml
RectangleCorner 1.0 RectangleCorner.qml
Retry 1.0 Retry.qml Retry 1.0 Retry.qml
SentMessage 1.0 SentMessage.qml SentMessage 1.0 SentMessage.qml
StateBubble 1.0 StateBubble.qml StateBubble 1.0 StateBubble.qml

View File

@ -17,7 +17,6 @@ ErrorDetails 1.0 ErrorDetails.qml
ErrorTag 1.0 ErrorTag.qml ErrorTag 1.0 ErrorTag.qml
ExpandableTag 1.0 ExpandableTag.qml ExpandableTag 1.0 ExpandableTag.qml
FoldableHeader 1.0 FoldableHeader.qml FoldableHeader 1.0 FoldableHeader.qml
FormGroup 1.0 FormGroup.qml
GetSyncCodeDesktopInstructions 1.0 GetSyncCodeDesktopInstructions.qml GetSyncCodeDesktopInstructions 1.0 GetSyncCodeDesktopInstructions.qml
GetSyncCodeMobileInstructions 1.0 GetSyncCodeMobileInstructions.qml GetSyncCodeMobileInstructions 1.0 GetSyncCodeMobileInstructions.qml
ImportKeypairInfo 1.0 ImportKeypairInfo.qml ImportKeypairInfo 1.0 ImportKeypairInfo.qml

View File

@ -1,40 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import utils 1.0
import StatusQ.Core 0.1
import StatusQ.Core.Theme 0.1
Column {
id: root
anchors.horizontalCenter: parent.horizontalCenter
spacing: 5
visible: !isValid || isWarn
property bool isValid: true
property bool isWarn: address == Constants.zeroAddress
property alias errorMessage: txtValidationError.text
property string address: ""
StatusIcon {
width: 13.33
height: 13.33
anchors.horizontalCenter: parent.horizontalCenter
icon: "warning"
color: Theme.palette.dangerColor1
}
StatusBaseText {
id: txtValidationError
text: qsTr("You need to request the recipients address first.\nAssets wont be sent yet.")
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
font.pixelSize: 13
height: 18
color: Theme.palette.dangerColor1
}
}

View File

@ -1,48 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import utils 1.0
import "../"
import "."
// TODO: use StatusQ components
Item {
id: root
property string name: ""
property string description: ""
property string letter: ""
height: glossaryEntryTitle.height + Style.current.smallPadding + glossaryEntryDescription.height
width: parent.width
GlossaryLetter {
id: glossaryLetter
text: root.letter
anchors.left: parent.left
anchors.top: glossaryEntryTitle.top
visible: !!root.letter
}
StyledText {
id: glossaryEntryTitle
text: root.name
font.pixelSize: 17
color: Style.current.textColor
font.weight: Font.Bold
anchors.left: parent.left
anchors.leftMargin: Style.current.bigPadding
}
StyledText {
id: glossaryEntryDescription
text: root.description
color: Style.current.textColor
font.pixelSize: 15
anchors.top: glossaryEntryTitle.bottom
anchors.topMargin: Style.current.smallPadding
anchors.left: parent.left
anchors.leftMargin: Style.current.bigPadding
anchors.right: parent.right
wrapMode: Text.WordWrap
}
}

View File

@ -1,12 +0,0 @@
import QtQuick 2.13
import utils 1.0
import "./"
// TODO: replace with StatusBaseText
StyledText {
id: glossaryLetterA
font.pixelSize: 17
font.weight: Font.Bold
color: Style.current.blue
}

View File

@ -1,34 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import utils 1.0
import "../"
import "./"
Item {
id: itmFrom
property alias label: txtLabel.text
property alias value: itmValue.children
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
Layout.preferredWidth: parent.width
width: parent.width
height: 52
StyledText {
id: txtLabel
font.pixelSize: 15
height: parent.height
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
verticalAlignment: Text.AlignVCenter
width: 105
}
Item {
id: itmValue
anchors.left: txtLabel.right
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
height: parent.height
}
}

View File

@ -1,115 +0,0 @@
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
import QtQml.Models 2.14
import utils 1.0
import StatusQ.Core 0.1
import StatusQ.Controls 0.1
import "../controls"
import SortFilterProxyModel 0.2
Control {
id: root
property string bio
property string userSocialLinksJson
onUserSocialLinksJsonChanged: d.buildSocialLinksModel()
QtObject {
id: d
// Unfortunately, nim can't expose temporary QObjects thorugh slots
// The only way to expose static models on demand is through json strings (see getContactDetailsAsJson)
// Model is built here manually, which I know is completely wrong..
function buildSocialLinksModel() {
socialLinksModel.clear()
if (root.userSocialLinksJson == "") return
try {
let links = JSON.parse(root.userSocialLinksJson)
for (let i=0; i<links.length; i++) {
let obj = links[i]
const url = obj.url
const type = ProfileUtils.linkTextToType(obj.text)
socialLinksModel.append({
"text": type === Constants.socialLinkType.custom ? obj.text : ProfileUtils.stripSocialLinkPrefix(url, type),
"url": url,
"linkType": type,
"icon": obj.icon
})
}
}
catch (e) {
console.warn("can't parse userSocialLinksJson", e)
}
}
}
ListModel {
id: socialLinksModel
}
SortFilterProxyModel {
id: sortedSocialLinksModel
sourceModel: socialLinksModel
filters: ExpressionFilter {
expression: model.text !== "" && model.url !== ""
}
}
contentItem: ColumnLayout {
spacing: 20
StatusScrollView {
id: scrollView
visible: root.bio
padding: 0
rightPadding: ScrollBar.vertical.visible ? 16 : 0
Layout.maximumHeight: 108
Layout.fillWidth: true
contentWidth: availableWidth
ScrollBar.vertical.policy: bioText.height > scrollView.availableHeight
? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
StatusBaseText {
id: bioText
text: root.bio.trim()
wrapMode: Text.Wrap
font.weight: Font.Medium
lineHeight: 1.2
width: scrollView.availableWidth
}
}
StatusCenteredFlow {
Layout.fillWidth: true
Layout.fillHeight: true
spacing: Style.current.halfPadding
visible: repeater.count > 0
Repeater {
id: repeater
model: sortedSocialLinksModel
delegate: SocialLinkPreview {
height: 32
text: model.text
url: model.url
icon: model.icon
}
}
}
}
}

View File

@ -1,49 +0,0 @@
import QtQuick 2.13
import QtGraphicalEffects 1.13
import utils 1.0
import "."
Item {
property int iconMargin: Style.current.padding
property alias icon: icon
readonly property int separatorWidth: (parent.width / 2) - (icon.height / 2) - iconMargin
width: parent.width
height: icon.height
Separator {
id: separatorLeft
width: separatorWidth
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.topMargin: undefined
}
SVGImage {
id: icon
height: 14
width: 18
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
fillMode: Image.PreserveAspectFit
source: Style.svg("arrow-right")
rotation: 90
ColorOverlay {
anchors.fill: parent
source: parent
color: Style.current.textColor
antialiasing: true
}
}
Separator {
id: separatorRight
width: separatorWidth
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.topMargin: undefined
}
}

View File

@ -1,10 +0,0 @@
import QtQuick 2.13
import QtQuick.Controls 2.13
import utils 1.0
Rectangle {
implicitWidth: 0
color: SplitHandle.pressed ? Style.current.darkGrey
: (SplitHandle.hovered ? Qt.darker(Style.current.border, 1.1) : Style.current.transparent)
}

View File

@ -1,28 +1,21 @@
AcceptRejectOptionsButtonsPanel 1.0 AcceptRejectOptionsButtonsPanel.qml AcceptRejectOptionsButtonsPanel 1.0 AcceptRejectOptionsButtonsPanel.qml
Address 1.0 Address.qml Address 1.0 Address.qml
AddressRequiredValidator 1.0 AddressRequiredValidator.qml
ChatsLoadingPanel 1.0 ChatsLoadingPanel.qml ChatsLoadingPanel 1.0 ChatsLoadingPanel.qml
ConnectionWarnings 1.0 ConnectionWarnings.qml ConnectionWarnings 1.0 ConnectionWarnings.qml
DidYouKnowSplashScreen 1.0 DidYouKnowSplashScreen.qml DidYouKnowSplashScreen 1.0 DidYouKnowSplashScreen.qml
DropAndEditImagePanel 1.0 DropAndEditImagePanel.qml
EditCroppedImagePanel 1.0 EditCroppedImagePanel.qml EditCroppedImagePanel 1.0 EditCroppedImagePanel.qml
EnterSeedPhrase 1.0 EnterSeedPhrase.qml EnterSeedPhrase 1.0 EnterSeedPhrase.qml
GlossaryEntry 1.0 GlossaryEntry.qml
GlossaryLetter 1.0 GlossaryLetter.qml
ImageLoader 1.0 ImageLoader.qml ImageLoader 1.0 ImageLoader.qml
LabelValueRow 1.0 LabelValueRow.qml MockedKeycardLibControllerWindow 1.0 MockedKeycardLibControllerWindow.qml
ModuleWarning 1.0 ModuleWarning.qml ModuleWarning 1.0 ModuleWarning.qml
NoImageUploadedPanel 1.0 NoImageUploadedPanel.qml NoImageUploadedPanel 1.0 NoImageUploadedPanel.qml
ProfileBioSocialsPanel 1.0 ProfileBioSocialsPanel.qml
RoundedIcon 1.0 RoundedIcon.qml RoundedIcon 1.0 RoundedIcon.qml
RoundedImage 1.0 RoundedImage.qml RoundedImage 1.0 RoundedImage.qml
SVGImage 1.0 SVGImage.qml SVGImage 1.0 SVGImage.qml
SeedPhrase 1.0 SeedPhrase.qml SeedPhrase 1.0 SeedPhrase.qml
Separator 1.0 Separator.qml Separator 1.0 Separator.qml
SeparatorWithIcon 1.0 SeparatorWithIcon.qml
SequenceColumnLayout 1.0 SequenceColumnLayout.qml SequenceColumnLayout 1.0 SequenceColumnLayout.qml
SplitViewHandle 1.0 SplitViewHandle.qml
StatusAssetSelector 1.0 StatusAssetSelector.qml StatusAssetSelector 1.0 StatusAssetSelector.qml
StyledText 1.0 StyledText.qml StyledText 1.0 StyledText.qml
TextWithLabel 1.0 TextWithLabel.qml TextWithLabel 1.0 TextWithLabel.qml
DropAndEditImagePanel 1.0 DropAndEditImagePanel.qml
MockedKeycardLibControllerWindow 1.0 MockedKeycardLibControllerWindow.qml

View File

@ -1,18 +0,0 @@
pragma Singleton
import QtQuick 2.13
QtObject {
property string messageId: ""
property string author: ""
function reset(){
messageId = "";
author = "";
}
function set(_messageId, _author){
messageId = _messageId;
author = _author;
}
}

View File

@ -2,7 +2,6 @@ Audio 1.0 Audio.qml
Tracer 1.0 Tracer.qml Tracer 1.0 Tracer.qml
singleton Constants 1.0 Constants.qml singleton Constants 1.0 Constants.qml
singleton Global 1.0 Global.qml singleton Global 1.0 Global.qml
singleton SelectedMessage 1.0 SelectedMessage.qml singleton ProfileUtils 1.0 ProfileUtils.qml
singleton Style 1.0 Style.qml singleton Style 1.0 Style.qml
singleton Utils 1.0 Utils.qml singleton Utils 1.0 Utils.qml
singleton ProfileUtils 1.0 ProfileUtils.qml