diff options
Diffstat (limited to 'resources/qml')
24 files changed, 101 insertions, 120 deletions
diff --git a/resources/qml/EncryptionIndicator.qml b/resources/qml/EncryptionIndicator.qml index 347220d7..b606a531 100644 --- a/resources/qml/EncryptionIndicator.qml +++ b/resources/qml/EncryptionIndicator.qml @@ -2,10 +2,10 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.12 -import QtQuick.Controls 2.1 -import QtQuick.Window 2.15 -import im.nheko 1.0 +import QtQuick +import QtQuick.Controls +import QtQuick.Window +import im.nheko Image { id: stateImg diff --git a/resources/qml/ImageButton.qml b/resources/qml/ImageButton.qml index ddc0b7d8..783a01d0 100644 --- a/resources/qml/ImageButton.qml +++ b/resources/qml/ImageButton.qml @@ -4,9 +4,9 @@ pragma ComponentBehavior: Bound import "./ui" -import QtQuick 2.3 -import QtQuick.Controls 2.3 -import im.nheko 1.0 // for cursor shape +import QtQuick +import QtQuick.Controls +import im.nheko // for cursor shape AbstractButton { id: button diff --git a/resources/qml/Root.qml b/resources/qml/Root.qml index 09a8f442..2b1454e4 100644 --- a/resources/qml/Root.qml +++ b/resources/qml/Root.qml @@ -245,7 +245,7 @@ Pane { } } function onOpenRoomSettingsDialog(settings) { - var component = Qt.createComponent("qrc:/resources/qml/dialogs/RoomSettings.qml"); + var component = Qt.createComponent("qrc:/resources/qml/dialogs/RoomSettingsDialog.qml"); if (component.status == Component.Ready) { var roomSettings = component.createObject(timelineRoot, { "roomSettings": settings diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml index b7cd3ff0..6d1cc445 100644 --- a/resources/qml/TopBar.qml +++ b/resources/qml/TopBar.qml @@ -56,11 +56,11 @@ Pane { Layout.row: 0 displayName: communityName enabled: false - height: fontMetrics.lineSpacing + implicitHeight: fontMetrics.lineSpacing + implicitWidth: fontMetrics.lineSpacing roomid: communityId url: avatarUrl.replace("mxc://", "image://MxcImage/") visible: roomid && room.parentSpace.isLoaded && ("space:" + room.parentSpace.roomid != Communities.currentTagId) - width: fontMetrics.lineSpacing } Label { id: communityLabel @@ -98,11 +98,11 @@ Pane { Layout.rowSpan: 2 displayName: roomName enabled: false - height: Nheko.avatarSize + implicitHeight: Nheko.avatarSize + implicitWidth: Nheko.avatarSize roomid: roomId url: avatarUrl.replace("mxc://", "image://MxcImage/") userid: isDirect ? directChatOtherUserId : "" - width: Nheko.avatarSize } Label { Layout.column: 2 diff --git a/resources/qml/UploadBox.qml b/resources/qml/UploadBox.qml index 990fa422..1d9415e5 100644 --- a/resources/qml/UploadBox.qml +++ b/resources/qml/UploadBox.qml @@ -2,8 +2,6 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import "./components" -import "./ui" import QtQuick 2.9 import QtQuick.Controls 2.5 import QtQuick.Layouts 1.3 diff --git a/resources/qml/components/AdaptiveLayout.qml b/resources/qml/components/AdaptiveLayout.qml index eea74006..86a0d4b6 100644 --- a/resources/qml/components/AdaptiveLayout.qml +++ b/resources/qml/components/AdaptiveLayout.qml @@ -2,10 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.12 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.12 -import im.nheko 1.0 +import QtQuick +import QtQuick.Controls +import im.nheko Container { //Component.onCompleted: { diff --git a/resources/qml/components/AdaptiveLayoutElement.qml b/resources/qml/components/AdaptiveLayoutElement.qml index 5d003f05..9c8d4622 100644 --- a/resources/qml/components/AdaptiveLayoutElement.qml +++ b/resources/qml/components/AdaptiveLayoutElement.qml @@ -2,9 +2,7 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.12 -import QtQuick.Controls 2.5 -import QtQuick.Layouts 1.12 +import QtQuick Item { property int minimumWidth: 100 diff --git a/resources/qml/components/AvatarListTile.qml b/resources/qml/components/AvatarListTile.qml index dad20e52..75c69098 100644 --- a/resources/qml/components/AvatarListTile.qml +++ b/resources/qml/components/AvatarListTile.qml @@ -3,10 +3,9 @@ // SPDX-License-Identifier: GPL-3.0-or-later import ".." -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 1.15 -import im.nheko 1.0 +import QtQuick +import QtQuick.Layouts +import im.nheko Rectangle { id: tile @@ -36,12 +35,13 @@ Rectangle { when: hovered.hovered && !(index == selectedIndex) PropertyChanges { - target: tile - background: palette.dark - importantText: palette.brightText - unimportantText: palette.brightText - bubbleBackground: palette.highlight - bubbleText: palette.highlightedText + tile { + background: palette.dark + importantText: palette.brightText + unimportantText: palette.brightText + bubbleBackground: palette.highlight + bubbleText: palette.highlightedText + } } }, @@ -50,12 +50,13 @@ Rectangle { when: index == selectedIndex PropertyChanges { - target: tile - background: palette.highlight - importantText: palette.highlightedText - unimportantText: palette.highlightedText - bubbleBackground: palette.highlightedText - bubbleText: palette.highlight + tile { + background: palette.highlight + importantText: palette.highlightedText + unimportantText: palette.highlightedText + bubbleBackground: palette.highlightedText + bubbleText: palette.highlight + } } } @@ -75,8 +76,8 @@ Rectangle { enabled: false Layout.alignment: Qt.AlignVCenter - height: avatarSize - width: avatarSize + implicitHeight: avatarSize + implicitWidth: avatarSize url: tile.avatarUrl.replace("mxc://", "image://MxcImage/") displayName: title crop: tile.crop @@ -88,7 +89,6 @@ Rectangle { Layout.alignment: Qt.AlignLeft Layout.fillWidth: true Layout.minimumWidth: 100 - width: parent.width - avatar.width Layout.preferredWidth: parent.width - avatar.width spacing: Nheko.paddingSmall diff --git a/resources/qml/components/MainWindowDialog.qml b/resources/qml/components/MainWindowDialog.qml index 10c07aae..3372d429 100644 --- a/resources/qml/components/MainWindowDialog.qml +++ b/resources/qml/components/MainWindowDialog.qml @@ -2,11 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import Qt.labs.platform 1.1 as P -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 1.3 -import im.nheko 1.0 +import QtQuick +import QtQuick.Controls +import im.nheko Dialog { default property alias inner: scroll.data diff --git a/resources/qml/components/ReorderableListview.qml b/resources/qml/components/ReorderableListview.qml index 1e8ab7b0..689f8267 100644 --- a/resources/qml/components/ReorderableListview.qml +++ b/resources/qml/components/ReorderableListview.qml @@ -2,10 +2,9 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.15 -import QtQml.Models 2.1 -import im.nheko 1.0 -import ".." +import QtQuick +import QtQml.Models +import im.nheko Item { id: root diff --git a/resources/qml/delegates/Encrypted.qml b/resources/qml/delegates/Encrypted.qml index 7aeeb28a..42a61918 100644 --- a/resources/qml/delegates/Encrypted.qml +++ b/resources/qml/delegates/Encrypted.qml @@ -2,7 +2,6 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import ".." import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 @@ -38,7 +37,7 @@ Control { Label { id: encryptedText text: { - switch (encryptionError) { + switch (r.encryptionError) { case Olm.MissingSession: return qsTr("There is no key to unlock this message. We requested the key automatically, but you can try requesting it again if you are impatient."); case Olm.MissingSessionIndex: @@ -63,7 +62,7 @@ Control { } Button { - visible: encryptionError == Olm.MissingSession || encryptionError == Olm.MissingSessionIndex + visible: r.encryptionError == Olm.MissingSession || encryptionError == Olm.MissingSessionIndex text: qsTr("Request key") onClicked: room.requestKeyForEvent(eventId) } diff --git a/resources/qml/delegates/FileMessage.qml b/resources/qml/delegates/FileMessage.qml index 9f350123..3f31e7ed 100644 --- a/resources/qml/delegates/FileMessage.qml +++ b/resources/qml/delegates/FileMessage.qml @@ -32,8 +32,8 @@ Control { color: palette.light radius: 22 - height: 44 - width: 44 + Layout.preferredHeight: 44 + Layout.preferredWidth: 44 Image { id: img @@ -68,7 +68,7 @@ Control { Layout.fillWidth: true Layout.maximumWidth: implicitWidth + 1 - text: filename + text: evRoot.filename textFormat: Text.PlainText elide: Text.ElideRight color: palette.text @@ -79,7 +79,7 @@ Control { Layout.fillWidth: true Layout.maximumWidth: implicitWidth + 1 - text: filesize + text: evRoot.filesize textFormat: Text.PlainText elide: Text.ElideRight color: palette.text diff --git a/resources/qml/delegates/ImageMessage.qml b/resources/qml/delegates/ImageMessage.qml index 9c93c25b..18ff11d2 100644 --- a/resources/qml/delegates/ImageMessage.qml +++ b/resources/qml/delegates/ImageMessage.qml @@ -34,38 +34,36 @@ AbstractButton { name: "BlurhashVisible" PropertyChanges { - target: blurhash_ - opacity: (img.status != Image.Ready) || (timeline.privacyScreen.active && blurhash) ? 1 : 0 - visible: (img.status != Image.Ready) || (timeline.privacyScreen.active && blurhash) + blurhash_ { + opacity: (img.status != Image.Ready) || (timeline.privacyScreen.active && blurhash) ? 1 : 0 + visible: (img.status != Image.Ready) || (timeline.privacyScreen.active && blurhash) + } } PropertyChanges { - target: img - opacity: 0 + img.opacity: 0 } PropertyChanges { - target: mxcimage - opacity: 0 + mxcimage.opacity: 0 } }, State { name: "ImageVisible" PropertyChanges { - target: blurhash_ - opacity: 0 - visible: false + blurhash_ { + opacity: 0 + visible: false + } } PropertyChanges { - target: img - opacity: 1 + img.opacity: 1 } PropertyChanges { - target: mxcimage - opacity: 1 + mxcimage.opacity: 1 } } ] diff --git a/resources/qml/delegates/PlayableMediaMessage.qml b/resources/qml/delegates/PlayableMediaMessage.qml index 99928369..2a47d275 100644 --- a/resources/qml/delegates/PlayableMediaMessage.qml +++ b/resources/qml/delegates/PlayableMediaMessage.qml @@ -2,12 +2,10 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import "../" import "../ui/media" import QtMultimedia import QtQuick import QtQuick.Controls -import QtQuick.Layouts import im.nheko Item { @@ -47,7 +45,7 @@ Item { Rectangle { id: videoContainer - color: type == MtxEvent.VideoMessage ? palette.window : "transparent" + color: content.type == MtxEvent.VideoMessage ? palette.window : "transparent" width: parent.width height: parent.height - fileInfoLabel.height @@ -57,14 +55,14 @@ Item { Image { anchors.fill: parent - source: thumbnailUrl ? thumbnailUrl.replace("mxc://", "image://MxcImage/") + "?scale" : "image://colorimage/:/icons/icons/ui/video-file.svg?" + palette.windowText + source: content.thumbnailUrl ? thumbnailUrl.replace("mxc://", "image://MxcImage/") + "?scale" : "image://colorimage/:/icons/icons/ui/video-file.svg?" + palette.windowText asynchronous: true fillMode: Image.PreserveAspectFit VideoOutput { id: videoOutput - visible: type == MtxEvent.VideoMessage + visible: content.type == MtxEvent.VideoMessage clip: true anchors.fill: parent fillMode: VideoOutput.PreserveAspectFit @@ -79,7 +77,7 @@ Item { anchors.left: videoContainer.left anchors.right: videoContainer.right anchors.bottom: videoContainer.bottom - playingVideo: type == MtxEvent.VideoMessage + playingVideo: content.type == MtxEvent.VideoMessage positionValue: mxcmedia.position duration: mediaLoaded ? mxcmedia.duration : content.duration mediaLoaded: mxcmedia.loaded @@ -95,7 +93,7 @@ Item { id: fileInfoLabel anchors.top: videoContainer.bottom - text: body + " [" + filesize + "]" + text: content.body + " [" + filesize + "]" textFormat: Text.RichText elide: Text.ElideRight color: palette.text diff --git a/resources/qml/delegates/Redacted.qml b/resources/qml/delegates/Redacted.qml index 3c496f08..1bf87f91 100644 --- a/resources/qml/delegates/Redacted.qml +++ b/resources/qml/delegates/Redacted.qml @@ -33,7 +33,7 @@ Control { Layout.alignment: Qt.AlignVCenter | Qt.AlignRight Layout.maximumWidth: implicitWidth + 1 Layout.fillWidth: true - property var redactedPair: room.formatRedactedEvent(msgRoot.eventId) + property var redactedPair: msgRoot.room.formatRedactedEvent(msgRoot.eventId) text: redactedPair["first"] wrapMode: Label.WordWrap diff --git a/resources/qml/delegates/Reply.qml b/resources/qml/delegates/Reply.qml index ece838b7..ff46347f 100644 --- a/resources/qml/delegates/Reply.qml +++ b/resources/qml/delegates/Reply.qml @@ -2,12 +2,10 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import Qt.labs.platform 1.1 as Platform -import QtQuick 2.12 -import QtQuick.Controls 2.3 -import QtQuick.Layouts 1.2 -import QtQuick.Window 2.13 -import im.nheko 1.0 +import QtQuick +import QtQuick.Controls +import QtQuick.Window +import im.nheko import "../" AbstractButton { @@ -45,7 +43,7 @@ AbstractButton { id: timelineEvent isStateEvent: false - room: room_ + room: r.room_ eventId: r.eventId replyTo: "" mainInset: 4 + Nheko.paddingMedium diff --git a/resources/qml/delegates/TextMessage.qml b/resources/qml/delegates/TextMessage.qml index d17e61d2..3625aea1 100644 --- a/resources/qml/delegates/TextMessage.qml +++ b/resources/qml/delegates/TextMessage.qml @@ -3,7 +3,6 @@ // SPDX-License-Identifier: GPL-3.0-or-later import ".." -import QtQuick.Controls import im.nheko MatrixText { @@ -18,28 +17,28 @@ MatrixText { property bool fitsMetadata: false //positionAt(width,height-4) == positionAt(width-metadataWidth-10, height-4) // table border-collapse doesn't seem to work - text: " - <style type=\"text/css\"> - code { background-color: " + palette.alternateBase + "; white-space: pre-wrap; } - pre { background-color: " + palette.alternateBase + "; white-space: pre-wrap; } + text: ` + <style type="text/css"> + code { background-color: ` + palette.alternateBase + `; white-space: pre-wrap; } + pre { background-color: ` + palette.alternateBase + `; white-space: pre-wrap; } table { border-width: 1px; border-collapse: collapse; border-style: solid; - border-color: " + palette.text + "; - background-color: " + palette.alternateBase + "; + border-color: ` + palette.text + `; + background-color: ` + palette.alternateBase + `; } table th, table td { - padding: " + Math.ceil(fontMetrics.lineSpacing/2) + "px; + padding: ` + Math.ceil(fontMetrics.lineSpacing/2) + `px; } blockquote { margin-left: 1em; } - " + (!Settings.mobileMode ? "span[data-mx-spoiler] { + ` + (!Settings.mobileMode ? `span[data-mx-spoiler] { color: transparent; - background-color: " + palette.text + "; - }" : "") + // TODO(Nico): Figure out how to support mobile - "</style> - " + formatted.replace(/<del>/g, "<s>").replace(/<\/del>/g, "</s>").replace(/<strike>/g, "<s>").replace(/<\/strike>/g, "</s>") + background-color: ` + palette.text + `; + }` : "") + // TODO(Nico): Figure out how to support mobile + `</style> + ` + formatted.replace(/<del>/g, "<s>").replace(/<\/del>/g, "</s>").replace(/<strike>/g, "<s>").replace(/<\/strike>/g, "</s>") enabled: !isReply font.pointSize: (Settings.enlargeEmojiOnlyMessages && isOnlyEmoji > 0 && isOnlyEmoji < 4) ? Settings.fontSize * 3 : Settings.fontSize diff --git a/resources/qml/dialogs/IgnoredUsers.qml b/resources/qml/dialogs/IgnoredUsers.qml index 2d8cc920..6d6585f0 100644 --- a/resources/qml/dialogs/IgnoredUsers.qml +++ b/resources/qml/dialogs/IgnoredUsers.qml @@ -2,12 +2,13 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQml 2.15 -import QtQuick 2.15 -import QtQuick.Controls 2.15 -import QtQuick.Layouts 2.15 -import QtQuick.Window 2.15 -import im.nheko 1.0 +import QtQml +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtQuick.Window +import im.nheko +import "../" Window { id: ignoredUsers diff --git a/resources/qml/dialogs/RoomSettings.qml b/resources/qml/dialogs/RoomSettingsDialog.qml index 1ff6876e..73dcac8c 100644 --- a/resources/qml/dialogs/RoomSettings.qml +++ b/resources/qml/dialogs/RoomSettingsDialog.qml @@ -551,8 +551,8 @@ ApplicationWindow { id: confirmEncryptionDialog title: qsTr("End-to-End Encryption") - text: qsTr("Encryption is currently experimental and things might break unexpectedly. <br> - Please take note that it can't be disabled afterwards.") + text: qsTr(`Encryption is currently experimental and things might break unexpectedly. <br> + Please take note that it can't be disabled afterwards.`) modality: Qt.NonModal onAccepted: { if (roomSettings.isEncryptionEnabled) diff --git a/resources/qml/ui/Ripple.qml b/resources/qml/ui/Ripple.qml index 911b88cf..9d871419 100644 --- a/resources/qml/ui/Ripple.qml +++ b/resources/qml/ui/Ripple.qml @@ -3,7 +3,6 @@ // SPDX-License-Identifier: GPL-3.0-or-later import QtQuick -import QtQuick.Controls Item { id: ripple diff --git a/resources/qml/ui/media/MediaControls.qml b/resources/qml/ui/media/MediaControls.qml index bd5f6ddc..0519a194 100644 --- a/resources/qml/ui/media/MediaControls.qml +++ b/resources/qml/ui/media/MediaControls.qml @@ -198,13 +198,11 @@ Rectangle { when: Settings.mobileMode || volumeButton.hovered || volumeSlider.hovered || volumeSlider.pressed PropertyChanges { - target: volumeSlider - Layout.preferredWidth: 100 + volumeSlider.implicitWidth: 100 } PropertyChanges { - target: volumeSlider - opacity: 1 + volumeSlider.opacity: 1 } } diff --git a/resources/qml/voip/CallInviteBar.qml b/resources/qml/voip/CallInviteBar.qml index d82bd143..419181ca 100644 --- a/resources/qml/voip/CallInviteBar.qml +++ b/resources/qml/voip/CallInviteBar.qml @@ -3,10 +3,10 @@ // SPDX-License-Identifier: GPL-3.0-or-later import "../" -import QtQuick 2.9 -import QtQuick.Controls 2.3 -import QtQuick.Layouts 1.2 -import im.nheko 1.0 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import im.nheko Rectangle { visible: CallManager.haveCallInvite && !Settings.mobileMode diff --git a/resources/qml/voip/ScreenShare.qml b/resources/qml/voip/ScreenShare.qml index 7f8665bc..d3661933 100644 --- a/resources/qml/voip/ScreenShare.qml +++ b/resources/qml/voip/ScreenShare.qml @@ -3,10 +3,10 @@ // SPDX-License-Identifier: GPL-3.0-or-later import "../" -import QtQuick 2.9 -import QtQuick.Controls 2.3 -import QtQuick.Layouts 1.2 -import im.nheko 1.0 +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import im.nheko Popup { modal: true diff --git a/resources/qml/voip/VideoCall.qml b/resources/qml/voip/VideoCall.qml index bd160d3e..f083d998 100644 --- a/resources/qml/voip/VideoCall.qml +++ b/resources/qml/voip/VideoCall.qml @@ -2,7 +2,6 @@ // // SPDX-License-Identifier: GPL-3.0-or-later -import QtQuick 2.9 import org.freedesktop.gstreamer.GLVideoItem 1.0 GstGLVideoItem { |