More qml cleanups

This commit is contained in:
Nicolas Werner 2023-10-26 16:43:09 +02:00
parent 1512810303
commit 2b1c9af311
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
39 changed files with 198 additions and 284 deletions

View file

@ -3,7 +3,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import "./components" import "./components"
import "./dialogs"
import Qt.labs.platform 1.1 as Platform import Qt.labs.platform 1.1 as Platform
import QtQml import QtQml
import QtQuick import QtQuick
@ -71,12 +70,13 @@ Page {
when: (communityItem.hovered || model.hidden) && !(Communities.currentTagId === model.id) when: (communityItem.hovered || model.hidden) && !(Communities.currentTagId === model.id)
PropertyChanges { PropertyChanges {
backgroundColor: palette.dark communityItem {
bubbleBackground: palette.highlight backgroundColor: palette.dark
bubbleText: palette.highlightedText bubbleBackground: palette.highlight
importantText: palette.brightText bubbleText: palette.highlightedText
target: communityItem importantText: palette.brightText
unimportantText: palette.brightText unimportantText: palette.brightText
}
} }
}, },
State { State {
@ -84,12 +84,13 @@ Page {
when: Communities.currentTagId == model.id when: Communities.currentTagId == model.id
PropertyChanges { PropertyChanges {
backgroundColor: palette.highlight communityItem {
bubbleBackground: palette.highlightedText backgroundColor: palette.highlight
bubbleText: palette.highlight bubbleBackground: palette.highlightedText
importantText: palette.highlightedText bubbleText: palette.highlight
target: communityItem importantText: palette.highlightedText
unimportantText: palette.highlightedText unimportantText: palette.highlightedText
}
} }
} }
] ]
@ -123,11 +124,9 @@ Page {
ToolTip.delay: Nheko.tooltipDelay ToolTip.delay: Nheko.tooltipDelay
ToolTip.text: model.collapsed ? qsTr("Expand") : qsTr("Collapse") ToolTip.text: model.collapsed ? qsTr("Expand") : qsTr("Collapse")
ToolTip.visible: hovered ToolTip.visible: hovered
height: fontMetrics.lineSpacing
hoverEnabled: true hoverEnabled: true
image: model.collapsed ? ":/icons/icons/ui/collapsed.svg" : ":/icons/icons/ui/expanded.svg" image: model.collapsed ? ":/icons/icons/ui/collapsed.svg" : ":/icons/icons/ui/expanded.svg"
visible: !communitySidebar.collapsed && model.collapsible visible: !communitySidebar.collapsed && model.collapsible
width: fontMetrics.lineSpacing
onClicked: model.collapsed = !model.collapsed onClicked: model.collapsed = !model.collapsed
} }
@ -142,7 +141,7 @@ Page {
color: communityItem.backgroundColor color: communityItem.backgroundColor
displayName: model.displayName displayName: model.displayName
enabled: false enabled: false
height: avatarSize Layout.preferredHeight: avatarSize
roomid: model.id roomid: model.id
textColor: model.avatarUrl?.startsWith(":/") == true ? communityItem.unimportantText : communityItem.importantText textColor: model.avatarUrl?.startsWith(":/") == true ? communityItem.unimportantText : communityItem.importantText
url: { url: {
@ -153,7 +152,7 @@ Page {
else else
return ""; return "";
} }
width: avatarSize Layout.preferredWidth: avatarSize
NotificationBubble { NotificationBubble {
anchors.bottom: avatar.bottom anchors.bottom: avatar.bottom

View file

@ -151,10 +151,10 @@ Control {
Avatar { Avatar {
displayName: model.displayName displayName: model.displayName
enabled: false enabled: false
height: popup.avatarHeight Layout.preferredHeight: popup.avatarHeight
Layout.preferredWidth: popup.avatarWidth
url: model.avatarUrl.replace("mxc://", "image://MxcImage/") url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
userid: model.userid userid: model.userid
width: popup.avatarWidth
} }
Label { Label {
color: model.index == popup.currentIndex ? palette.highlightedText : palette.text color: model.index == popup.currentIndex ? palette.highlightedText : palette.text
@ -183,11 +183,11 @@ Control {
crop: false crop: false
displayName: model.shortcode displayName: model.shortcode
enabled: false enabled: false
height: popup.avatarHeight Layout.preferredHeight: popup.avatarHeight
//userid: model.shortcode //userid: model.shortcode
url: (model.url ? model.url : "").replace("mxc://", "image://MxcImage/") url: (model.url ? model.url : "").replace("mxc://", "image://MxcImage/")
visible: !model.unicode visible: !model.unicode
width: popup.avatarWidth Layout.preferredWidth: popup.avatarWidth
} }
Label { Label {
Layout.leftMargin: Nheko.paddingSmall Layout.leftMargin: Nheko.paddingSmall
@ -229,10 +229,10 @@ Control {
Avatar { Avatar {
displayName: model.roomName displayName: model.roomName
enabled: false enabled: false
height: popup.avatarHeight Layout.preferredHeight: popup.avatarHeight
roomid: model.roomid roomid: model.roomid
url: model.avatarUrl.replace("mxc://", "image://MxcImage/") url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
width: popup.avatarWidth Layout.preferredWidth: popup.avatarWidth
} }
Label { Label {
color: model.index == popup.currentIndex ? palette.highlightedText : palette.text color: model.index == popup.currentIndex ? palette.highlightedText : palette.text
@ -253,10 +253,10 @@ Control {
Avatar { Avatar {
displayName: model.roomName displayName: model.roomName
enabled: false enabled: false
height: popup.avatarHeight Layout.preferredHeight: popup.avatarHeight
roomid: model.roomid roomid: model.roomid
url: model.avatarUrl.replace("mxc://", "image://MxcImage/") url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
width: popup.avatarWidth Layout.preferredWidth: popup.avatarWidth
} }
Label { Label {
color: model.index == popup.currentIndex ? palette.highlightedText : palette.text color: model.index == popup.currentIndex ? palette.highlightedText : palette.text

View file

@ -69,12 +69,10 @@ ColumnLayout {
name: "focused" name: "focused"
PropertyChanges { PropertyChanges {
target: labelC labelC.y: 0
y: 0
} }
PropertyChanges { PropertyChanges {
opacity: 1 input.opacity: 1
target: input
} }
} }
transitions: Transition { transitions: Transition {
@ -143,7 +141,7 @@ ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
color: palette.highlight color: palette.highlight
height: 1 Layout.preferredHeight: 1
Rectangle { Rectangle {
id: blackBar id: blackBar
@ -159,8 +157,7 @@ ColumnLayout {
when: input.activeFocus == true when: input.activeFocus == true
PropertyChanges { PropertyChanges {
target: blackBar blackBar.width: blueBar.width
width: blueBar.width
} }
} }
transitions: Transition { transitions: Transition {

View file

@ -46,12 +46,12 @@ Rectangle {
Layout.margins: 8 Layout.margins: 8
ToolTip.text: CallManager.isOnCall ? qsTr("Hang up") : (CallManager.isOnCallOnOtherDevice ? qsTr("Already on a call") : qsTr("Place a call")) ToolTip.text: CallManager.isOnCall ? qsTr("Hang up") : (CallManager.isOnCallOnOtherDevice ? qsTr("Already on a call") : qsTr("Place a call"))
ToolTip.visible: hovered ToolTip.visible: hovered
height: 22 Layout.preferredHeight: 22
hoverEnabled: true hoverEnabled: true
image: CallManager.isOnCall ? ":/icons/icons/ui/end-call.svg" : ":/icons/icons/ui/place-call.svg" image: CallManager.isOnCall ? ":/icons/icons/ui/end-call.svg" : ":/icons/icons/ui/place-call.svg"
opacity: (CallManager.haveCallInvite || CallManager.isOnCallOnOtherDevice) ? 0.3 : 1 opacity: (CallManager.haveCallInvite || CallManager.isOnCallOnOtherDevice) ? 0.3 : 1
visible: CallManager.callsSupported && showAllButtons visible: CallManager.callsSupported && showAllButtons
width: 22 Layout.preferredWidth: 22
onClicked: { onClicked: {
if (room) { if (room) {
@ -74,11 +74,11 @@ Rectangle {
Layout.margins: 8 Layout.margins: 8
ToolTip.text: qsTr("Send a file") ToolTip.text: qsTr("Send a file")
ToolTip.visible: hovered ToolTip.visible: hovered
height: 22 Layout.preferredHeight: 22
hoverEnabled: true hoverEnabled: true
image: ":/icons/icons/ui/attach.svg" image: ":/icons/icons/ui/attach.svg"
visible: showAllButtons visible: showAllButtons
width: 22 Layout.preferredWidth: 22
onClicked: room.input.openFileSelection() onClicked: room.input.openFileSelection()
@ -395,11 +395,11 @@ Rectangle {
Layout.margins: 8 Layout.margins: 8
ToolTip.text: qsTr("Stickers") ToolTip.text: qsTr("Stickers")
ToolTip.visible: hovered ToolTip.visible: hovered
height: 22 Layout.preferredHeight: 22
hoverEnabled: true hoverEnabled: true
image: ":/icons/icons/ui/sticky-note-solid.svg" image: ":/icons/icons/ui/sticky-note-solid.svg"
visible: showAllButtons visible: showAllButtons
width: 22 Layout.preferredWidth: 22
onClicked: stickerPopup.visible ? stickerPopup.close() : stickerPopup.show(stickerButton, room.roomId, function (row) { onClicked: stickerPopup.visible ? stickerPopup.close() : stickerPopup.show(stickerButton, room.roomId, function (row) {
room.input.sticker(row); room.input.sticker(row);
@ -419,10 +419,10 @@ Rectangle {
Layout.margins: 8 Layout.margins: 8
ToolTip.text: qsTr("Emoji") ToolTip.text: qsTr("Emoji")
ToolTip.visible: hovered ToolTip.visible: hovered
height: 22 Layout.preferredHeight: 22
hoverEnabled: true hoverEnabled: true
image: ":/icons/icons/ui/smile.svg" image: ":/icons/icons/ui/smile.svg"
width: 22 Layout.preferredWidth: 22
onClicked: emojiPopup.visible ? emojiPopup.close() : emojiPopup.show(emojiButton, room.roomId, function (plaintext, markdown) { onClicked: emojiPopup.visible ? emojiPopup.close() : emojiPopup.show(emojiButton, room.roomId, function (plaintext, markdown) {
messageInput.insert(messageInput.cursorPosition, markdown); messageInput.insert(messageInput.cursorPosition, markdown);
@ -441,10 +441,10 @@ Rectangle {
Layout.rightMargin: 8 Layout.rightMargin: 8
ToolTip.text: qsTr("Send") ToolTip.text: qsTr("Send")
ToolTip.visible: hovered ToolTip.visible: hovered
height: 22 Layout.preferredHeight: 22
hoverEnabled: true hoverEnabled: true
image: ":/icons/icons/ui/send.svg" image: ":/icons/icons/ui/send.svg"
width: 22 Layout.preferredWidth: 22
onClicked: { onClicked: {
room.input.send(); room.input.send();

View file

@ -2,9 +2,6 @@
// //
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import "./components"
import "./delegates"
import "./emoji"
import "./ui" import "./ui"
import "./dialogs" import "./dialogs"
import Qt.labs.platform 1.1 as Platform import Qt.labs.platform 1.1 as Platform
@ -186,8 +183,6 @@ Item {
visible: !button.showImage visible: !button.showImage
} }
Image { Image {
id: buttonImg
// Workaround, can't get icon.source working for now... // Workaround, can't get icon.source working for now...
anchors.fill: parent anchors.fill: parent
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
@ -212,7 +207,7 @@ Item {
hoverEnabled: true hoverEnabled: true
image: ":/icons/icons/ui/edit.svg" image: ":/icons/icons/ui/edit.svg"
visible: !!row.model && row.model.isEditable visible: !!row.model && row.model.isEditable
width: 16 Layout.preferredWidth: 16
onClicked: { onClicked: {
if (row.model.isEditable) if (row.model.isEditable)
@ -228,7 +223,7 @@ Item {
hoverEnabled: true hoverEnabled: true
image: ":/icons/icons/ui/smile-add.svg" image: ":/icons/icons/ui/smile-add.svg"
visible: room ? room.permissions.canSend(MtxEvent.Reaction) : false visible: room ? room.permissions.canSend(MtxEvent.Reaction) : false
width: 16 Layout.preferredWidth: 16
onClicked: emojiPopup.visible ? emojiPopup.close() : emojiPopup.show(reactButton, room.roomId, function (plaintext, markdown) { onClicked: emojiPopup.visible ? emojiPopup.close() : emojiPopup.show(reactButton, room.roomId, function (plaintext, markdown) {
var event_id = row.model ? row.model.eventId : ""; var event_id = row.model ? row.model.eventId : "";
@ -243,7 +238,7 @@ Item {
hoverEnabled: true hoverEnabled: true
image: (row.model && row.model.threadId) ? ":/icons/icons/ui/thread.svg" : ":/icons/icons/ui/new-thread.svg" image: (row.model && row.model.threadId) ? ":/icons/icons/ui/thread.svg" : ":/icons/icons/ui/new-thread.svg"
visible: room ? room.permissions.canSend(MtxEvent.TextMessage) : false visible: room ? room.permissions.canSend(MtxEvent.TextMessage) : false
width: 16 Layout.preferredWidth: 16
onClicked: room.thread = (row.model.threadId || row.model.eventId) onClicked: room.thread = (row.model.threadId || row.model.eventId)
} }
@ -254,7 +249,7 @@ Item {
hoverEnabled: true hoverEnabled: true
image: ":/icons/icons/ui/reply.svg" image: ":/icons/icons/ui/reply.svg"
visible: room ? room.permissions.canSend(MtxEvent.TextMessage) : false visible: room ? room.permissions.canSend(MtxEvent.TextMessage) : false
width: 16 Layout.preferredWidth: 16
onClicked: room.reply = row.model.eventId onClicked: room.reply = row.model.eventId
} }
@ -266,7 +261,7 @@ Item {
hoverEnabled: true hoverEnabled: true
image: ":/icons/icons/ui/go-to.svg" image: ":/icons/icons/ui/go-to.svg"
visible: !!row.model && filteredTimeline.filterByContent visible: !!row.model && filteredTimeline.filterByContent
width: 16 Layout.preferredWidth: 16
onClicked: { onClicked: {
topBar.searchString = ""; topBar.searchString = "";
@ -281,7 +276,7 @@ Item {
ToolTip.visible: hovered ToolTip.visible: hovered
hoverEnabled: true hoverEnabled: true
image: ":/icons/icons/ui/options.svg" image: ":/icons/icons/ui/options.svg"
width: 16 Layout.preferredWidth: 16
onClicked: messageContextMenuC.show(row.model.eventId, row.model.threadId, row.model.type, row.model.isSender, row.model.isEncrypted, row.model.isEditable, "", row.model.body, optionsButton) onClicked: messageContextMenuC.show(row.model.eventId, row.model.threadId, row.model.type, row.model.isSender, row.model.isEncrypted, row.model.isEditable, "", row.model.body, optionsButton)
} }
@ -624,8 +619,7 @@ Item {
name: "" name: ""
PropertyChanges { PropertyChanges {
target: toEndButton toEndButton.width: 0
width: 0
} }
}, },
State { State {
@ -633,8 +627,7 @@ Item {
when: !chat.atYEnd when: !chat.atYEnd
PropertyChanges { PropertyChanges {
target: toEndButton toEndButton.width: toEndButton.fullWidth
width: toEndButton.fullWidth
} }
} }
] ]
@ -668,8 +661,6 @@ Item {
rightMargin: Nheko.paddingMedium + (fullWidth - width) / 2 rightMargin: Nheko.paddingMedium + (fullWidth - width) / 2
} }
Image { Image {
id: buttonImg
anchors.fill: parent anchors.fill: parent
anchors.margins: Nheko.paddingMedium anchors.margins: Nheko.paddingMedium
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit

View file

@ -50,24 +50,16 @@ Item {
name: "Visible" name: "Visible"
PropertyChanges { PropertyChanges {
target: screenSaver screenSaver.visible: true
visible: true screenSaver.opacity: 1
}
PropertyChanges {
opacity: 1
target: screenSaver
} }
}, },
State { State {
name: "Invisible" name: "Invisible"
PropertyChanges { PropertyChanges {
opacity: 0 screenSaver.opacity: 0
target: screenSaver screenSaver.visible: false
}
PropertyChanges {
target: screenSaver
visible: false
} }
} }
] ]

View file

@ -2,10 +2,9 @@
// //
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.15 import QtQuick.Controls
import QtQuick.Layouts 1.15 import im.nheko
import im.nheko 1.0
Popup { Popup {
id: quickSwitcher id: quickSwitcher

View file

@ -27,7 +27,7 @@ Page {
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
color: Nheko.theme.separator color: Nheko.theme.separator
height: 1 Layout.preferredHeight: 1
} }
Pane { Pane {
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
@ -48,10 +48,10 @@ Page {
ToolTip.delay: Nheko.tooltipDelay ToolTip.delay: Nheko.tooltipDelay
ToolTip.text: qsTr("Start a new chat") ToolTip.text: qsTr("Start a new chat")
ToolTip.visible: hovered ToolTip.visible: hovered
height: 22 Layout.preferredHeight: 22
Layout.preferredWidth: 22
hoverEnabled: true hoverEnabled: true
image: ":/icons/icons/ui/add-square-button.svg" image: ":/icons/icons/ui/add-square-button.svg"
width: 22
onClicked: roomJoinCreateMenu.open(parent) onClicked: roomJoinCreateMenu.open(parent)
@ -100,11 +100,11 @@ Page {
ToolTip.delay: Nheko.tooltipDelay ToolTip.delay: Nheko.tooltipDelay
ToolTip.text: qsTr("Room directory") ToolTip.text: qsTr("Room directory")
ToolTip.visible: hovered ToolTip.visible: hovered
height: 22 Layout.preferredHeight: 22
Layout.preferredWidth: 22
hoverEnabled: true hoverEnabled: true
image: ":/icons/icons/ui/room-directory.svg" image: ":/icons/icons/ui/room-directory.svg"
visible: !collapsed visible: !collapsed
width: 22
onClicked: { onClicked: {
var win = roomDirectoryComponent.createObject(timelineRoot); var win = roomDirectoryComponent.createObject(timelineRoot);
@ -118,12 +118,12 @@ Page {
ToolTip.delay: Nheko.tooltipDelay ToolTip.delay: Nheko.tooltipDelay
ToolTip.text: qsTr("Search rooms (Ctrl+K)") ToolTip.text: qsTr("Search rooms (Ctrl+K)")
ToolTip.visible: hovered ToolTip.visible: hovered
height: 22 Layout.preferredHeight: 22
Layout.preferredWidth: 22
hoverEnabled: true hoverEnabled: true
image: ":/icons/icons/ui/search.svg" image: ":/icons/icons/ui/search.svg"
ripple: false ripple: false
visible: !collapsed visible: !collapsed
width: 22
onClicked: { onClicked: {
var component = Qt.createComponent("qrc:/resources/qml/QuickSwitcher.qml"); var component = Qt.createComponent("qrc:/resources/qml/QuickSwitcher.qml");
@ -142,12 +142,12 @@ Page {
ToolTip.delay: Nheko.tooltipDelay ToolTip.delay: Nheko.tooltipDelay
ToolTip.text: qsTr("User settings") ToolTip.text: qsTr("User settings")
ToolTip.visible: hovered ToolTip.visible: hovered
height: 22 Layout.preferredHeight: 22
Layout.preferredWidth: 22
hoverEnabled: true hoverEnabled: true
image: ":/icons/icons/ui/settings.svg" image: ":/icons/icons/ui/settings.svg"
ripple: false ripple: false
visible: !collapsed visible: !collapsed
width: 22
onClicked: mainWindow.push(userSettingsPage) onClicked: mainWindow.push(userSettingsPage)
} }
@ -191,7 +191,7 @@ Page {
spacing: Nheko.paddingMedium spacing: Nheko.paddingMedium
Avatar { Avatar {
id: avatar id: headerAvatar
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
Layout.preferredHeight: fontMetrics.lineSpacing * 2 Layout.preferredHeight: fontMetrics.lineSpacing * 2
@ -206,10 +206,9 @@ Page {
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredWidth: parent.width - avatar.width - logoutButton.width - Nheko.paddingMedium * 2 Layout.preferredWidth: parent.width - headerAvatar.width - logoutButton.width - Nheko.paddingMedium * 2
spacing: 0 spacing: 0
visible: !collapsed visible: !collapsed
width: parent.width - avatar.width - logoutButton.width - Nheko.paddingMedium * 2
ElidedLabel { ElidedLabel {
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
@ -321,7 +320,7 @@ Page {
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
color: Nheko.theme.separator color: Nheko.theme.separator
height: 2 Layout.preferredHeight: 2
} }
Rectangle { Rectangle {
id: unverifiedStuffBubble id: unverifiedStuffBubble
@ -371,10 +370,10 @@ Page {
ToolTip.delay: Nheko.tooltipDelay ToolTip.delay: Nheko.tooltipDelay
ToolTip.text: qsTr("Close") ToolTip.text: qsTr("Close")
ToolTip.visible: closeUnverifiedBubble.hovered ToolTip.visible: closeUnverifiedBubble.hovered
height: fontMetrics.font.pixelSize Layout.preferredHeight: fontMetrics.font.pixelSize
hoverEnabled: true hoverEnabled: true
image: ":/icons/icons/ui/dismiss.svg" image: ":/icons/icons/ui/dismiss.svg"
width: fontMetrics.font.pixelSize Layout.preferredWidth: fontMetrics.font.pixelSize
onClicked: unverifiedStuffBubble.visible = false onClicked: unverifiedStuffBubble.visible = false
} }
@ -400,7 +399,7 @@ Page {
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
color: Nheko.theme.separator color: Nheko.theme.separator
height: 1 Layout.preferredHeight: 1
visible: unverifiedStuffBubble.visible visible: unverifiedStuffBubble.visible
} }
} }
@ -485,12 +484,13 @@ Page {
when: roomItem.hovered && !((Rooms.currentRoom && roomId == Rooms.currentRoom.roomId) || Rooms.currentRoomPreview.roomid == roomId) when: roomItem.hovered && !((Rooms.currentRoom && roomId == Rooms.currentRoom.roomId) || Rooms.currentRoomPreview.roomid == roomId)
PropertyChanges { PropertyChanges {
backgroundColor: palette.dark roomItem {
bubbleBackground: palette.highlight backgroundColor: palette.dark
bubbleText: palette.highlightedText bubbleBackground: palette.highlight
importantText: palette.brightText bubbleText: palette.highlightedText
target: roomItem importantText: palette.brightText
unimportantText: palette.brightText unimportantText: palette.brightText
}
} }
}, },
State { State {
@ -498,12 +498,13 @@ Page {
when: (Rooms.currentRoom && roomId == Rooms.currentRoom.roomId) || Rooms.currentRoomPreview.roomid == roomId when: (Rooms.currentRoom && roomId == Rooms.currentRoom.roomId) || Rooms.currentRoomPreview.roomid == roomId
PropertyChanges { PropertyChanges {
backgroundColor: palette.highlight roomItem {
bubbleBackground: palette.highlightedText backgroundColor: palette.highlight
bubbleText: palette.highlight bubbleBackground: palette.highlightedText
importantText: palette.highlightedText bubbleText: palette.highlight
target: roomItem importantText: palette.highlightedText
unimportantText: palette.highlightedText unimportantText: palette.highlightedText
}
} }
} }
] ]
@ -551,11 +552,11 @@ Page {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
displayName: roomName displayName: roomName
enabled: false enabled: false
height: avatarSize
roomid: roomId roomid: roomId
url: avatarUrl.replace("mxc://", "image://MxcImage/") url: avatarUrl.replace("mxc://", "image://MxcImage/")
userid: isDirect ? directChatOtherUserId : "" userid: isDirect ? directChatOtherUserId : ""
width: avatarSize Layout.preferredWidth: avatarSize
Layout.preferredHeight: avatarSize
NotificationBubble { NotificationBubble {
id: collapsedNotificationBubble id: collapsedNotificationBubble
@ -575,11 +576,10 @@ Page {
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
Layout.minimumWidth: 100 Layout.minimumWidth: 100
Layout.preferredWidth: parent.width - avatar.width Layout.preferredWidth: roomItem.width - avatar.width
height: avatar.height Layout.preferredHeight: avatar.height
spacing: Nheko.paddingSmall spacing: Nheko.paddingSmall
visible: !collapsed visible: !collapsed
width: roomItem.width - avatar.width
Item { Item {
id: titleRow id: titleRow

View file

@ -2,17 +2,12 @@
// //
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import "./delegates"
import "./device-verification"
import "./dialogs" import "./dialogs"
import "./emoji"
import "./pages" import "./pages"
import "./voip"
import "./ui" import "./ui"
import Qt.labs.platform 1.1 as Platform import Qt.labs.platform 1.1 as Platform
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import im.nheko import im.nheko

View file

@ -2,15 +2,8 @@
// //
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import "./components"
import "./delegates"
import "./emoji"
import "./ui"
import "./dialogs"
import Qt.labs.platform 1.1 as Platform
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import im.nheko import im.nheko
@ -165,7 +158,7 @@ TimelineEvent {
AbstractButton { AbstractButton {
id: messageBubble id: messageBubble
anchors.left: (wrapper.isStateEvent || wrapper.isSender) ? undefined : parent.left anchors.left: (wrapper.isStateEvent || wrapper.isSender) ? undefined : parent.left // qmllint disable Quick.anchor-combinations
anchors.right: (wrapper.isStateEvent || !wrapper.isSender) ? undefined : parent.right anchors.right: (wrapper.isStateEvent || !wrapper.isSender) ? undefined : parent.right
anchors.horizontalCenter: wrapper.isStateEvent ? parent.horizontalCenter : undefined anchors.horizontalCenter: wrapper.isStateEvent ? parent.horizontalCenter : undefined

View file

@ -2,15 +2,8 @@
// //
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import "./components"
import "./delegates"
import "./emoji"
import "./ui"
import "./dialogs"
import Qt.labs.platform 1.1 as Platform
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import im.nheko import im.nheko

View file

@ -2,12 +2,7 @@
// //
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import "./components"
import "./delegates" import "./delegates"
import "./emoji"
import "./ui"
import "./dialogs"
import Qt.labs.platform 1.1 as Platform
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import QtQuick.Layouts 1.2 import QtQuick.Layouts 1.2

View file

@ -2,12 +2,6 @@
// //
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import "./components"
import "./delegates"
import "./emoji"
import "./ui"
import "./dialogs"
import Qt.labs.platform 1.1 as Platform
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
@ -33,24 +27,22 @@ RowLayout {
StatusIndicator { StatusIndicator {
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Layout.preferredHeight: parent.iconSize
Layout.preferredWidth: parent.iconSize
eventId: metadata.eventId eventId: metadata.eventId
height: parent.iconSize
status: metadata.status status: metadata.status
width: parent.iconSize
} }
Image { Image {
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Layout.preferredHeight: parent.iconSize
Layout.preferredWidth: parent.iconSize
ToolTip.delay: Nheko.tooltipDelay ToolTip.delay: Nheko.tooltipDelay
ToolTip.text: qsTr("Edited") ToolTip.text: qsTr("Edited")
ToolTip.visible: editHovered.hovered ToolTip.visible: editHovered.hovered
height: parent.iconSize
source: "image://colorimage/:/icons/icons/ui/edit.svg?" + ((metadata.eventId == metadata.room.edit) ? palette.highlight : palette.buttonText) source: "image://colorimage/:/icons/icons/ui/edit.svg?" + ((metadata.eventId == metadata.room.edit) ? palette.highlight : palette.buttonText)
sourceSize.height: parent.iconSize * Screen.devicePixelRatio sourceSize.height: parent.iconSize * Screen.devicePixelRatio
sourceSize.width: parent.iconSize * Screen.devicePixelRatio sourceSize.width: parent.iconSize * Screen.devicePixelRatio
visible: metadata.isEdited || metadata.eventId == metadata.room.edit visible: metadata.isEdited || metadata.eventId == metadata.room.edit
width: parent.iconSize
Layout.preferredWidth: parent.iconSize
Layout.preferredHeight: parent.iconSize
HoverHandler { HoverHandler {
id: editHovered id: editHovered
@ -58,28 +50,26 @@ RowLayout {
} }
ImageButton { ImageButton {
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Layout.preferredHeight: parent.iconSize
Layout.preferredWidth: parent.iconSize
ToolTip.delay: Nheko.tooltipDelay ToolTip.delay: Nheko.tooltipDelay
ToolTip.text: qsTr("Part of a thread") ToolTip.text: qsTr("Part of a thread")
ToolTip.visible: hovered ToolTip.visible: hovered
buttonTextColor: TimelineManager.userColor(metadata.threadId, palette.base) buttonTextColor: TimelineManager.userColor(metadata.threadId, palette.base)
height: parent.iconSize
image: ":/icons/icons/ui/thread.svg" image: ":/icons/icons/ui/thread.svg"
visible: metadata.threadId visible: metadata.threadId
width: parent.iconSize
onClicked: metadata.room.thread = threadId onClicked: metadata.room.thread = threadId
} }
EncryptionIndicator { EncryptionIndicator {
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Layout.preferredHeight: parent.iconSize
Layout.preferredWidth: parent.iconSize
encrypted: metadata.isEncrypted encrypted: metadata.isEncrypted
height: parent.iconSize
sourceSize.height: parent.iconSize * Screen.devicePixelRatio sourceSize.height: parent.iconSize * Screen.devicePixelRatio
sourceSize.width: parent.iconSize * Screen.devicePixelRatio sourceSize.width: parent.iconSize * Screen.devicePixelRatio
trust: metadata.trustlevel trust: metadata.trustlevel
visible: metadata.room.isEncrypted visible: metadata.room.isEncrypted
width: parent.iconSize
Layout.preferredWidth: parent.iconSize
Layout.preferredHeight: parent.iconSize
} }
Label { Label {
id: ts id: ts

View file

@ -2,10 +2,8 @@
// //
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import Qt.labs.platform as Platform
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Window import QtQuick.Window
import im.nheko import im.nheko

View file

@ -3,16 +3,12 @@
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import "./components" import "./components"
import "./delegates"
import "./device-verification"
import "./emoji" import "./emoji"
import "./ui" import "./ui"
import "./voip" import "./voip"
import Qt.labs.platform as Platform
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Particles
import QtQuick.Window import QtQuick.Window
import im.nheko import im.nheko
@ -90,7 +86,7 @@ Item {
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
color: Nheko.theme.separator color: Nheko.theme.separator
height: 1 implicitHeight: 1
z: 3 z: 3
} }
Rectangle { Rectangle {
@ -146,7 +142,7 @@ Item {
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
color: Nheko.theme.separator color: Nheko.theme.separator
height: 1 implicitHeight: 1
z: 3 z: 3
} }
UploadBox { UploadBox {
@ -191,10 +187,10 @@ Item {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
displayName: parent.roomName displayName: parent.roomName
enabled: false enabled: false
height: 130 implicitHeight: 130
roomid: parent.roomId roomid: parent.roomId
url: parent.avatarUrl.replace("mxc://", "image://MxcImage/") url: parent.avatarUrl.replace("mxc://", "image://MxcImage/")
width: 130 implicitWidth: 130
} }
RowLayout { RowLayout {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
@ -296,11 +292,11 @@ Item {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
displayName: roomPreview?.inviterDisplayName ?? "" displayName: roomPreview?.inviterDisplayName ?? ""
enabled: true enabled: true
height: 48 implicitHeight: 48
roomid: preview.roomId roomid: preview.roomId
url: (roomPreview?.inviterAvatarUrl ?? "").replace("mxc://", "image://MxcImage/") url: (roomPreview?.inviterAvatarUrl ?? "").replace("mxc://", "image://MxcImage/")
userid: roomPreview?.inviterUserId ?? "" userid: roomPreview?.inviterUserId ?? ""
width: 48 implicitWidth: 48
onClicked: TimelineManager.openGlobalUserProfile(roomPreview.inviterUserId) onClicked: TimelineManager.openGlobalUserProfile(roomPreview.inviterUserId)
} }

View file

@ -46,24 +46,20 @@ Switch {
name: "off" name: "off"
PropertyChanges { PropertyChanges {
border.color: "#767676" track.border.color: "#767676"
target: track
} }
PropertyChanges { PropertyChanges {
target: handle handle.x: 0
x: 0
} }
}, },
State { State {
name: "on" name: "on"
PropertyChanges { PropertyChanges {
border.color: palette.highlight track.border.color: palette.highlight
target: track
} }
PropertyChanges { PropertyChanges {
target: handle handle.x: indicatorItem.width - handle.width
x: indicatorItem.width - handle.width
} }
} }
] ]

View file

@ -2,9 +2,9 @@
// //
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick 2.3 import QtQuick
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQuick.Layouts 1.10 import QtQuick.Layouts
Rectangle { Rectangle {
color: "red" color: "red"
@ -21,7 +21,7 @@ Rectangle {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
Label { Label {
height: font.pixelSize * 2 Layout.preferredHeight: font.pixelSize * 2
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
text: col.emoji.emoji text: col.emoji.emoji
font.pixelSize: Qt.application.font.pixelSize * 2 font.pixelSize: Qt.application.font.pixelSize * 2

View file

@ -3,7 +3,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import ".." import ".."
import "../components"
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts

View file

@ -3,13 +3,11 @@
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import ".." import ".."
import "../ui" import QtQuick
import Qt.labs.platform 1.1 as Platform import QtQuick.Controls
import QtQuick 2.15 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Window
import QtQuick.Layouts 1.2 import im.nheko
import QtQuick.Window 2.13
import im.nheko 1.0
ApplicationWindow { ApplicationWindow {
id: allowedDialog id: allowedDialog

View file

@ -4,7 +4,6 @@
import ".." import ".."
import "../ui" import "../ui"
import Qt.labs.platform 1.1 as Platform
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Layouts 1.2 import QtQuick.Layouts 1.2
@ -39,8 +38,8 @@ ApplicationWindow {
url: summary.roomAvatarUrl.replace("mxc://", "image://MxcImage/") url: summary.roomAvatarUrl.replace("mxc://", "image://MxcImage/")
roomid: summary.roomid roomid: summary.roomid
displayName: summary.roomName displayName: summary.roomName
height: 130 Layout.preferredHeight: 130
width: 130 Layout.preferredWidth: 130
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
} }

View file

@ -3,12 +3,11 @@
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import ".." import ".."
import QtQuick 2.15 import QtQuick
import QtQuick.Window 2.13 import QtQuick.Window
import QtQuick.Layouts 1.3 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Controls
import QtQml.Models 2.15 import im.nheko
import im.nheko 1.0
ApplicationWindow { ApplicationWindow {
id: createDirectRoot id: createDirectRoot

View file

@ -137,8 +137,8 @@ ApplicationWindow {
url: imagePack.avatarUrl.replace("mxc://", "image://MxcImage/") url: imagePack.avatarUrl.replace("mxc://", "image://MxcImage/")
displayName: imagePack.packname displayName: imagePack.packname
roomid: imagePack.statekey roomid: imagePack.statekey
height: 130 Layout.preferredHeight: 130
width: 130 Layout.preferredWidth: 130
crop: false crop: false
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
@ -238,8 +238,8 @@ ApplicationWindow {
url: imagePack.data(imagePack.index(currentImageIndex, 0), SingleImagePackModel.Url).replace("mxc://", "image://MxcImage/") + "?scale" url: imagePack.data(imagePack.index(currentImageIndex, 0), SingleImagePackModel.Url).replace("mxc://", "image://MxcImage/") + "?scale"
displayName: imagePack.data(imagePack.index(currentImageIndex, 0), SingleImagePackModel.ShortCode) displayName: imagePack.data(imagePack.index(currentImageIndex, 0), SingleImagePackModel.ShortCode)
roomid: displayName roomid: displayName
height: 130 Layout.preferredHeight: 130
width: 130 Layout.preferredWidth: 130
crop: false crop: false
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
} }

View file

@ -66,7 +66,7 @@ ApplicationWindow {
dialog.show(); dialog.show();
timelineRoot.destroyOnClose(dialog); timelineRoot.destroyOnClose(dialog);
} }
width: packlistC.width Layout.preferredWidth: packlistC.width
visible: !packlist.containsAccountPack visible: !packlist.containsAccountPack
text: qsTr("Create account pack") text: qsTr("Create account pack")
} }
@ -79,7 +79,7 @@ ApplicationWindow {
dialog.show(); dialog.show();
timelineRoot.destroyOnClose(dialog); timelineRoot.destroyOnClose(dialog);
} }
width: packlistC.width Layout.preferredWidth: packlistC.width
visible: room.permissions.canChange(MtxEvent.ImagePackInRoom) visible: room.permissions.canChange(MtxEvent.ImagePackInRoom)
text: qsTr("New room pack") text: qsTr("New room pack")
} }
@ -146,8 +146,8 @@ ApplicationWindow {
url: packinfo.avatarUrl.replace("mxc://", "image://MxcImage/") url: packinfo.avatarUrl.replace("mxc://", "image://MxcImage/")
displayName: packinfo.packName displayName: packinfo.packName
roomid: packinfo.statekey roomid: packinfo.statekey
height: 100 Layout.preferredHeight: 100
width: 100 Layout.preferredWidth: 100
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
enabled: false enabled: false
} }

View file

@ -4,10 +4,10 @@
import ".." import ".."
import "../components" import "../components"
import QtQuick 2.12 import QtQuick
import QtQuick.Controls 2.12 import QtQuick.Controls
import QtQuick.Layouts 1.12 import QtQuick.Layouts
import im.nheko 1.0 import im.nheko
ApplicationWindow { ApplicationWindow {
id: inviteDialogRoot id: inviteDialogRoot
@ -180,7 +180,7 @@ ApplicationWindow {
Rectangle { Rectangle {
Layout.fillHeight: true Layout.fillHeight: true
visible: inviteesList.visible visible: inviteesList.visible
width: 1 Layout.preferredWidth: 1
color: Nheko.theme.separator color: Nheko.theme.separator
} }
ListView { ListView {

View file

@ -3,10 +3,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import Qt.labs.platform 1.1 as P import Qt.labs.platform 1.1 as P
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.15 import im.nheko
import im.nheko 1.0
import "../voip"
P.MessageDialog { P.MessageDialog {
id: leaveRoomRoot id: leaveRoomRoot

View file

@ -3,9 +3,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import Qt.labs.platform 1.1 as P import Qt.labs.platform 1.1 as P
import QtQuick 2.15 import QtQuick
import QtQuick.Controls 2.15 import im.nheko
import im.nheko 1.0
P.MessageDialog { P.MessageDialog {
id: logoutRoot id: logoutRoot

View file

@ -47,7 +47,7 @@ ApplicationWindow {
TabBar { TabBar {
id: bar id: bar
width: parent.width Layout.preferredWidth: parent.width
NhekoTabButton { NhekoTabButton {
text: qsTr("Roles") text: qsTr("Roles")

View file

@ -3,13 +3,11 @@
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import ".." import ".."
import "../ui" import QtQuick
import Qt.labs.platform 1.1 as Platform import QtQuick.Controls
import QtQuick 2.15 import QtQuick.Layouts
import QtQuick.Controls 2.3 import QtQuick.Window
import QtQuick.Layouts 1.2 import im.nheko
import QtQuick.Window 2.13
import im.nheko 1.0
ApplicationWindow { ApplicationWindow {
id: applyDialog id: applyDialog

View file

@ -78,8 +78,8 @@ ApplicationWindow {
Avatar { Avatar {
id: avatar id: avatar
width: Nheko.avatarSize Layout.preferredWidth: Nheko.avatarSize
height: Nheko.avatarSize Layout.preferredHeight: Nheko.avatarSize
userid: model.mxid userid: model.mxid
url: model.avatarUrl.replace("mxc://", "image://MxcImage/") url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
displayName: model.displayName displayName: model.displayName

View file

@ -57,8 +57,9 @@ ApplicationWindow {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
Layout.rightMargin: Nheko.paddingMedium Layout.rightMargin: Nheko.paddingMedium
width: avatarSize Layout.preferredWidth: roomDirDelegate.avatarSize
height: avatarSize Layout.preferredHeight: roomDirDelegate.avatarSize
url: model.avatarUrl.replace("mxc://", "image://MxcImage/") url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
roomid: model.roomid roomid: model.roomid
displayName: model.name displayName: model.name
@ -70,8 +71,7 @@ ApplicationWindow {
columns: 2 columns: 2
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
width: parent.width - avatar.width Layout.preferredWidth: parent.width - roomAvatar.width
Layout.preferredWidth: parent.width - avatar.width
ElidedLabel { ElidedLabel {
Layout.row: 0 Layout.row: 0

View file

@ -37,8 +37,9 @@ ApplicationWindow {
Avatar { Avatar {
id: roomAvatar id: roomAvatar
width: 130 Layout.preferredHeight: 130
height: width Layout.preferredWidth: 130
roomid: members.roomId roomid: members.roomId
displayName: members.roomName displayName: members.roomName
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
@ -130,8 +131,8 @@ ApplicationWindow {
Avatar { Avatar {
id: avatar id: avatar
width: Nheko.avatarSize Layout.preferredWidth: Nheko.avatarSize
height: Nheko.avatarSize Layout.preferredHeight: Nheko.avatarSize
userid: model.mxid userid: model.mxid
url: model.avatarUrl.replace("mxc://", "image://MxcImage/") url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
displayName: model.displayName displayName: model.displayName

View file

@ -50,8 +50,8 @@ ApplicationWindow {
url: roomSettings.roomAvatarUrl.replace("mxc://", "image://MxcImage/") url: roomSettings.roomAvatarUrl.replace("mxc://", "image://MxcImage/")
roomid: roomSettings.roomId roomid: roomSettings.roomId
displayName: roomSettings.roomName displayName: roomSettings.roomName
height: 130 Layout.preferredHeight: 130
width: 130 Layout.preferredWidth: 130
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
onClicked: TimelineManager.openImageOverlay(null, roomSettings.roomAvatarUrl, "", 0, 0) onClicked: TimelineManager.openImageOverlay(null, roomSettings.roomAvatarUrl, "", 0, 0)

View file

@ -3,7 +3,6 @@
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import ".." import ".."
import "../device-verification"
import "../ui" import "../ui"
import "../components" import "../components"
import QtQuick 2.15 import QtQuick 2.15
@ -56,8 +55,8 @@ ApplicationWindow {
id: displayAvatar id: displayAvatar
url: profile.avatarUrl.replace("mxc://", "image://MxcImage/") url: profile.avatarUrl.replace("mxc://", "image://MxcImage/")
height: 130 Layout.preferredHeight: 130
width: 130 Layout.preferredWidth: 130
displayName: profile.displayName displayName: profile.displayName
userid: profile.userid userid: profile.userid
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
@ -498,8 +497,8 @@ ApplicationWindow {
Layout.leftMargin: Nheko.paddingMedium Layout.leftMargin: Nheko.paddingMedium
property int avatarSize: Math.ceil(fontMetrics.lineSpacing * 1.6) property int avatarSize: Math.ceil(fontMetrics.lineSpacing * 1.6)
height: avatarSize Layout.preferredHeight: avatarSize
width: avatarSize Layout.preferredWidth: avatarSize
url: avatarUrl.replace("mxc://", "image://MxcImage/") url: avatarUrl.replace("mxc://", "image://MxcImage/")
roomid: roomId roomid: roomId
displayName: roomName displayName: roomName

View file

@ -45,8 +45,8 @@ Item {
Image { Image {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
source: "qrc:/logos/login.png" source: "qrc:/logos/login.png"
height: 128 Layout.preferredHeight: 128
width: 128 Layout.preferredWidth: 128
} }
RowLayout { RowLayout {
@ -65,7 +65,7 @@ Item {
Spinner { Spinner {
height: matrixIdLabel.height/2 Layout.preferredHeight: matrixIdLabel.height/2
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
visible: running visible: running
@ -117,7 +117,7 @@ Item {
} }
Item { Item {
height: Nheko.avatarSize Layout.preferredHeight: Nheko.avatarSize
Layout.fillWidth: true Layout.fillWidth: true
Spinner { Spinner {

View file

@ -45,8 +45,8 @@ Item {
Image { Image {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
source: "qrc:/logos/login.png" source: "qrc:/logos/login.png"
height: 128 Layout.preferredHeight: 128
width: 128 Layout.preferredWidth: 128
} }
RowLayout { RowLayout {
@ -64,7 +64,7 @@ Item {
Spinner { Spinner {
height: hsLabel.height/2 Layout.preferredHeight: hsLabel.height/2
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
visible: running visible: running
@ -96,7 +96,7 @@ Item {
onEditingFinished: regis.checkUsername(text) onEditingFinished: regis.checkUsername(text)
} }
Spinner { Spinner {
height: usernameLabel.height/2 Layout.preferredHeight: usernameLabel.height/2
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
visible: running visible: running
@ -105,8 +105,6 @@ Item {
} }
Image { Image {
width: usernameLabel.height/2
height: width
Layout.preferredHeight: usernameLabel.height/2 Layout.preferredHeight: usernameLabel.height/2
Layout.preferredWidth: usernameLabel.height/2 Layout.preferredWidth: usernameLabel.height/2
Layout.alignment: Qt.AlignBottom Layout.alignment: Qt.AlignBottom
@ -168,7 +166,7 @@ Item {
} }
Item { Item {
height: Nheko.avatarSize Layout.preferredHeight: Nheko.avatarSize
Layout.fillWidth: true Layout.fillWidth: true
Spinner { Spinner {

View file

@ -4,9 +4,7 @@
pragma ComponentBehavior: Bound pragma ComponentBehavior: Bound
import ".." import ".."
import "../ui"
import "../dialogs" import "../dialogs"
import Qt.labs.platform as Platform
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts

View file

@ -18,8 +18,8 @@ ColumnLayout {
Image { Image {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
source: "qrc:/logos/splash.png" source: "qrc:/logos/splash.png"
height: 256 Layout.preferredHeight: 256
width: 256 Layout.preferredWidth: 256
} }
Label { Label {

View file

@ -31,8 +31,8 @@ Rectangle {
anchors.leftMargin: 8 anchors.leftMargin: 8
Avatar { Avatar {
width: Nheko.avatarSize implicitWidth: Nheko.avatarSize
height: Nheko.avatarSize implicitHeight: Nheko.avatarSize
url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/") url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/")
userid: CallManager.callParty userid: CallManager.callParty
displayName: CallManager.callPartyDisplayName displayName: CallManager.callPartyDisplayName
@ -61,8 +61,7 @@ Rectangle {
when: CallManager.callType == Voip.VOICE when: CallManager.callType == Voip.VOICE
PropertyChanges { PropertyChanges {
target: callTypeIcon callTypeIcon.source: "qrc:/icons/icons/ui/place-call.svg"
source: "qrc:/icons/icons/ui/place-call.svg"
} }
}, },
@ -71,8 +70,7 @@ Rectangle {
when: CallManager.callType == Voip.VIDEO when: CallManager.callType == Voip.VIDEO
PropertyChanges { PropertyChanges {
target: callTypeIcon callTypeIcon.source: "qrc:/icons/icons/ui/video.svg"
source: "qrc:/icons/icons/ui/video.svg"
} }
}, },
@ -81,8 +79,7 @@ Rectangle {
when: CallManager.callType == Voip.SCREEN when: CallManager.callType == Voip.SCREEN
PropertyChanges { PropertyChanges {
target: callTypeIcon callTypeIcon.source: "qrc:/icons/icons/ui/screen-share.svg"
source: "qrc:/icons/icons/ui/screen-share.svg"
} }
} }
@ -103,8 +100,7 @@ Rectangle {
when: CallManager.callState == Voip.OFFERSENT when: CallManager.callState == Voip.OFFERSENT
PropertyChanges { PropertyChanges {
target: callStateLabel callStateLabel.text: qsTr("Calling...")
text: qsTr("Calling...")
} }
}, },
@ -113,8 +109,7 @@ Rectangle {
when: CallManager.callState == Voip.CONNECTING when: CallManager.callState == Voip.CONNECTING
PropertyChanges { PropertyChanges {
target: callStateLabel callStateLabel.text: qsTr("Connecting...")
text: qsTr("Connecting...")
} }
}, },
@ -123,8 +118,7 @@ Rectangle {
when: CallManager.callState == Voip.ANSWERSENT when: CallManager.callState == Voip.ANSWERSENT
PropertyChanges { PropertyChanges {
target: callStateLabel callStateLabel.text: qsTr("Connecting...")
text: qsTr("Connecting...")
} }
}, },
@ -133,18 +127,15 @@ Rectangle {
when: CallManager.callState == Voip.CONNECTED when: CallManager.callState == Voip.CONNECTED
PropertyChanges { PropertyChanges {
target: callStateLabel callStateLabel.text: "00:00"
text: "00:00"
} }
PropertyChanges { PropertyChanges {
target: callTimer callTimer.startTime: Math.floor((new Date()).getTime() / 1000)
startTime: Math.floor((new Date()).getTime() / 1000)
} }
PropertyChanges { PropertyChanges {
target: stackLayout stackLayout.currentIndex: CallManager.callType != Voip.VOICE ? 1 : 0
currentIndex: CallManager.callType != Voip.VOICE ? 1 : 0
} }
}, },
@ -153,13 +144,16 @@ Rectangle {
when: CallManager.callState == Voip.DISCONNECTED when: CallManager.callState == Voip.DISCONNECTED
PropertyChanges { PropertyChanges {
target: callStateLabel callStateLabel.text: ""
text: ""
} }
// HACK(Nico): Somehow this causes a crash when not using the custom parser for that property change...
//PropertyChanges {
// stackLayout.currentIndex: 0
//}
PropertyChanges { PropertyChanges {
target: stackLayout target: stackLayout
currentIndex: 0 currentIndex: 0 // qmllint disable Quick.property-changes-parsed
} }
} }
@ -202,8 +196,8 @@ Rectangle {
ImageButton { ImageButton {
visible: CallManager.haveLocalPiP visible: CallManager.haveLocalPiP
width: 24 Layout.preferredWidth: 24
height: 24 Layout.preferredHeight: 24
buttonTextColor: "#000000" buttonTextColor: "#000000"
image: ":/icons/icons/ui/picture-in-picture.svg" image: ":/icons/icons/ui/picture-in-picture.svg"
hoverEnabled: true hoverEnabled: true
@ -215,8 +209,8 @@ Rectangle {
ImageButton { ImageButton {
Layout.leftMargin: 8 Layout.leftMargin: 8
Layout.rightMargin: 16 Layout.rightMargin: 16
width: 24 Layout.preferredWidth: 24
height: 24 Layout.preferredHeight: 24
buttonTextColor: "#000000" buttonTextColor: "#000000"
image: CallManager.isMicMuted ? ":/icons/icons/ui/microphone-unmute.svg" : ":/icons/icons/ui/microphone-mute.svg" image: CallManager.isMicMuted ? ":/icons/icons/ui/microphone-unmute.svg" : ":/icons/icons/ui/microphone-mute.svg"
hoverEnabled: true hoverEnabled: true

View file

@ -38,8 +38,8 @@ Rectangle {
anchors.leftMargin: 8 anchors.leftMargin: 8
Avatar { Avatar {
width: Nheko.avatarSize implicitWidth: Nheko.avatarSize
height: Nheko.avatarSize implicitHeight: Nheko.avatarSize
url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/") url: CallManager.callPartyAvatarUrl.replace("mxc://", "image://MxcImage/")
userid: CallManager.callParty userid: CallManager.callParty
displayName: CallManager.callPartyDisplayName displayName: CallManager.callPartyDisplayName
@ -72,8 +72,8 @@ Rectangle {
ImageButton { ImageButton {
Layout.rightMargin: 16 Layout.rightMargin: 16
width: 20 Layout.preferredWidth: 20
height: 20 Layout.preferredHeight: 20
buttonTextColor: "#000000" buttonTextColor: "#000000"
image: ":/icons/icons/ui/settings.svg" image: ":/icons/icons/ui/settings.svg"
hoverEnabled: true hoverEnabled: true
@ -82,7 +82,7 @@ Rectangle {
onClicked: { onClicked: {
var dialog = devicesDialog.createObject(timelineRoot); var dialog = devicesDialog.createObject(timelineRoot);
dialog.open(); dialog.open();
timelineRoot.destroyOnClose(dialog); timelineRoot.destroyOnClose(dialog);
} }
} }