Use ItemDelegate in RoomList instead of a Rectangle with handlers

fixes #683
relates to #571
This commit is contained in:
Nicolas Werner 2021-11-03 23:01:36 +01:00
parent 1a163f49e2
commit 1e22274d8c
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
9 changed files with 1895 additions and 498 deletions

View file

@ -114,10 +114,10 @@ Page {
} }
delegate: Rectangle { delegate: ItemDelegate {
id: roomItem id: roomItem
property color background: Nheko.colors.window property color backgroundColor: Nheko.colors.window
property color importantText: Nheko.colors.text property color importantText: Nheko.colors.text
property color unimportantText: Nheko.colors.buttonText property color unimportantText: Nheko.colors.buttonText
property color bubbleBackground: Nheko.colors.highlight property color bubbleBackground: Nheko.colors.highlight
@ -136,20 +136,31 @@ Page {
required property bool isDirect required property bool isDirect
required property string directChatOtherUserId required property string directChatOtherUserId
color: background
height: avatarSize + 2 * Nheko.paddingMedium height: avatarSize + 2 * Nheko.paddingMedium
width: ListView.view.width width: ListView.view.width
state: "normal" state: "normal"
ToolTip.visible: hovered.hovered && collapsed ToolTip.visible: hovered && collapsed
ToolTip.text: roomName ToolTip.text: roomName
onClicked: {
console.log("tapped " + roomId);
if (!Rooms.currentRoom || Rooms.currentRoom.roomId !== roomId)
Rooms.setCurrentRoom(roomId);
else
Rooms.resetCurrentRoom();
}
onPressAndHold: {
if (!isInvite)
roomContextMenu.show(roomId, tags);
}
states: [ states: [
State { State {
name: "highlight" name: "highlight"
when: hovered.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 {
target: roomItem target: roomItem
background: Nheko.colors.dark backgroundColor: Nheko.colors.dark
importantText: Nheko.colors.brightText importantText: Nheko.colors.brightText
unimportantText: Nheko.colors.brightText unimportantText: Nheko.colors.brightText
bubbleBackground: Nheko.colors.highlight bubbleBackground: Nheko.colors.highlight
@ -163,7 +174,7 @@ Page {
PropertyChanges { PropertyChanges {
target: roomItem target: roomItem
background: Nheko.colors.highlight backgroundColor: Nheko.colors.highlight
importantText: Nheko.colors.highlightedText importantText: Nheko.colors.highlightedText
unimportantText: Nheko.colors.highlightedText unimportantText: Nheko.colors.highlightedText
bubbleBackground: Nheko.colors.highlightedText bubbleBackground: Nheko.colors.highlightedText
@ -189,28 +200,6 @@ Page {
acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad
} }
TapHandler {
margin: -Nheko.paddingSmall
onSingleTapped: {
console.log("tapped "+roomId);
if (!Rooms.currentRoom || Rooms.currentRoom.roomId !== roomId)
Rooms.setCurrentRoom(roomId);
else
Rooms.resetCurrentRoom();
}
onLongPressed: {
if (!isInvite)
roomContextMenu.show(roomId, tags);
}
}
HoverHandler {
id: hovered
acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad
}
} }
RowLayout { RowLayout {
@ -362,6 +351,10 @@ Page {
visible: hasUnreadMessages visible: hasUnreadMessages
} }
background: Rectangle {
color: backgroundColor
}
} }
} }
@ -505,35 +498,40 @@ Page {
Rectangle { Rectangle {
id: unverifiedStuffBubble id: unverifiedStuffBubble
color: Qt.lighter(Nheko.theme.orange, verifyButtonHovered.hovered ? 1.2 : 1.0)
color: Qt.lighter(Nheko.theme.orange, verifyButtonHovered.hovered ? 1.2 : 1)
Layout.fillWidth: true Layout.fillWidth: true
implicitHeight: explanation.height + Nheko.paddingMedium * 2 implicitHeight: explanation.height + Nheko.paddingMedium * 2
visible: SelfVerificationStatus.status != SelfVerificationStatus.AllVerified visible: SelfVerificationStatus.status != SelfVerificationStatus.AllVerified
RowLayout { RowLayout {
id: unverifiedStuffBubbleContainer id: unverifiedStuffBubbleContainer
width: parent.width width: parent.width
height: explanation.height + Nheko.paddingMedium * 2 height: explanation.height + Nheko.paddingMedium * 2
spacing: 0 spacing: 0
Label { Label {
id: explanation id: explanation
Layout.margins: Nheko.paddingMedium Layout.margins: Nheko.paddingMedium
Layout.rightMargin: Nheko.paddingSmall Layout.rightMargin: Nheko.paddingSmall
color: Nheko.colors.buttonText color: Nheko.colors.buttonText
Layout.fillWidth: true Layout.fillWidth: true
text: switch(SelfVerificationStatus.status) { text: {
switch (SelfVerificationStatus.status) {
case SelfVerificationStatus.NoMasterKey: case SelfVerificationStatus.NoMasterKey:
//: Cross-signing setup has not run yet. //: Cross-signing setup has not run yet.
return qsTr("Encryption not set up"); return qsTr("Encryption not set up");
case SelfVerificationStatus.UnverifiedMasterKey: case SelfVerificationStatus.UnverifiedMasterKey:
//: The user just signed in with this device and hasn't verified their master key. //: The user just signed in with this device and hasn't verified their master key.
return qsTr("Unverified login"); return qsTr("Unverified login");
case SelfVerificationStatus.UnverifiedDevices: case SelfVerificationStatus.UnverifiedDevices:
//: There are unverified devices signed in to this account. //: There are unverified devices signed in to this account.
return qsTr("Please verify your other devices"); return qsTr("Please verify your other devices");
default: default:
return "" return "";
}
} }
textFormat: Text.PlainText textFormat: Text.PlainText
wrapMode: Text.Wrap wrapMode: Text.Wrap
@ -558,8 +556,8 @@ Page {
HoverHandler { HoverHandler {
id: verifyButtonHovered id: verifyButtonHovered
enabled: !closeUnverifiedBubble.hovered
enabled: !closeUnverifiedBubble.hovered
acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus | PointerDevice.TouchPad
} }
@ -567,13 +565,13 @@ Page {
enabled: !closeUnverifiedBubble.hovered enabled: !closeUnverifiedBubble.hovered
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
onSingleTapped: { onSingleTapped: {
if (SelfVerificationStatus.status == SelfVerificationStatus.UnverifiedDevices) { if (SelfVerificationStatus.status == SelfVerificationStatus.UnverifiedDevices)
SelfVerificationStatus.verifyUnverifiedDevices(); SelfVerificationStatus.verifyUnverifiedDevices();
} else { else
SelfVerificationStatus.statusChanged(); SelfVerificationStatus.statusChanged();
}
} }
} }
} }
Rectangle { Rectangle {

View file

@ -116,6 +116,7 @@ Page {
LogoutDialog { LogoutDialog {
} }
} }
Component { Component {
@ -123,6 +124,7 @@ Page {
JoinRoomDialog { JoinRoomDialog {
} }
} }
Component { Component {
@ -130,6 +132,7 @@ Page {
LeaveRoomDialog { LeaveRoomDialog {
} }
} }
Shortcut { Shortcut {
@ -222,8 +225,8 @@ Page {
function onOpenLeaveRoomDialog(roomid) { function onOpenLeaveRoomDialog(roomid) {
var dialog = leaveRoomComponent.createObject(timelineRoot, { var dialog = leaveRoomComponent.createObject(timelineRoot, {
"roomId": roomid "roomId": roomid
}); });
dialog.open(); dialog.open();
} }
@ -296,28 +299,31 @@ Page {
buttons: Platform.MessageDialog.Ok buttons: Platform.MessageDialog.Ok
text: qsTr("Wait for the confirmation link to arrive, then continue.") text: qsTr("Wait for the confirmation link to arrive, then continue.")
onAccepted: UIA.continue3pidReceived() onAccepted: UIA.continue3pidReceived()
} }
Connections { Connections {
function onPassword() { function onPassword() {
console.log("UIA: password needed"); console.log("UIA: password needed");
uiaPassPrompt.show(); uiaPassPrompt.show();
} }
function onEmail() { function onEmail() {
uiaEmailPrompt.show(); uiaEmailPrompt.show();
} }
function onPhoneNumber() { function onPhoneNumber() {
uiaPhoneNumberPrompt.show(); uiaPhoneNumberPrompt.show();
} }
function onPrompt3pidToken() { function onPrompt3pidToken() {
uiaTokenPrompt.show(); uiaTokenPrompt.show();
} }
function onConfirm3pidToken() { function onConfirm3pidToken() {
uiaConfirmationLinkDialog.open(); uiaConfirmationLinkDialog.open();
} }
function onError(msg) { function onError(msg) {
uiaErrorDialog.text = msg; uiaErrorDialog.text = msg;
uiaErrorDialog.open(); uiaErrorDialog.open();

View file

@ -2,12 +2,12 @@
// //
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
import "./components/"
import Qt.labs.platform 1.1 as P import Qt.labs.platform 1.1 as P
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import im.nheko 1.0 import im.nheko 1.0
import "./components/"
Item { Item {
visible: false visible: false
@ -86,128 +86,127 @@ Item {
onAccepted: SelfVerificationStatus.setupCrosssigning(storeSecretsOnline.checked, usePassword.checked ? passwordField.text : "", useOnlineKeyBackup.checked) onAccepted: SelfVerificationStatus.setupCrosssigning(storeSecretsOnline.checked, usePassword.checked ? passwordField.text : "", useOnlineKeyBackup.checked)
GridLayout { GridLayout {
id: grid id: grid
width: bootstrapCrosssigning.useableWidth width: bootstrapCrosssigning.useableWidth
columns: 2 columns: 2
rowSpacing: 0 rowSpacing: 0
columnSpacing: 0 columnSpacing: 0
z: 1 z: 1
Label { Label {
Layout.margins: Nheko.paddingMedium Layout.margins: Nheko.paddingMedium
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.columnSpan: 2 Layout.columnSpan: 2
font.pointSize: fontMetrics.font.pointSize * 2 font.pointSize: fontMetrics.font.pointSize * 2
text: qsTr("Setup Encryption") text: qsTr("Setup Encryption")
color: Nheko.colors.text color: Nheko.colors.text
wrapMode: Text.Wrap wrapMode: Text.Wrap
} }
Label { Label {
Layout.margins: Nheko.paddingMedium Layout.margins: Nheko.paddingMedium
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.maximumWidth: grid.width - Nheko.paddingMedium * 2 Layout.maximumWidth: grid.width - Nheko.paddingMedium * 2
text: qsTr("Hello and welcome to Matrix!\nIt seems like you are new. Before you can securely encrypt your messages, we need to setup a few small things. You can either press accept immediately or adjust a few basic options. We also try to explain a few of the basics. You can skip those parts, but they might prove to be helpful!") text: qsTr("Hello and welcome to Matrix!\nIt seems like you are new. Before you can securely encrypt your messages, we need to setup a few small things. You can either press accept immediately or adjust a few basic options. We also try to explain a few of the basics. You can skip those parts, but they might prove to be helpful!")
color: Nheko.colors.text color: Nheko.colors.text
wrapMode: Text.Wrap wrapMode: Text.Wrap
} }
Label { Label {
Layout.margins: Nheko.paddingMedium Layout.margins: Nheko.paddingMedium
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
Layout.columnSpan: 1 Layout.columnSpan: 1
Layout.maximumWidth: Math.floor(grid.width / 2) - Nheko.paddingMedium * 2 Layout.maximumWidth: Math.floor(grid.width / 2) - Nheko.paddingMedium * 2
text: "Store secrets online.\nYou have a few secrets to make all the encryption magic work. While you can keep them stored only locally, we recommend storing them encrypted on the server. Otherwise it will be painful to recover them. Only disable this if you are paranoid and like losing your data!" text: "Store secrets online.\nYou have a few secrets to make all the encryption magic work. While you can keep them stored only locally, we recommend storing them encrypted on the server. Otherwise it will be painful to recover them. Only disable this if you are paranoid and like losing your data!"
color: Nheko.colors.text color: Nheko.colors.text
wrapMode: Text.Wrap wrapMode: Text.Wrap
} }
Item { Item {
Layout.margins: Nheko.paddingMedium Layout.margins: Nheko.paddingMedium
Layout.preferredHeight: storeSecretsOnline.height Layout.preferredHeight: storeSecretsOnline.height
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.fillWidth: true Layout.fillWidth: true
ToggleButton { ToggleButton {
id: storeSecretsOnline id: storeSecretsOnline
checked: true
onClicked: console.log("Store secrets toggled: " + checked)
}
}
Label {
Layout.margins: Nheko.paddingMedium
Layout.alignment: Qt.AlignLeft
Layout.columnSpan: 1
Layout.rowSpan: 2
Layout.maximumWidth: Math.floor(grid.width / 2) - Nheko.paddingMedium * 2
visible: storeSecretsOnline.checked
text: "Set an online backup password.\nWe recommend you DON'T set a password and instead only rely on the recovery key. You will get a recovery key in any case when storing the cross-signing secrets online, but passwords are usually not very random, so they are easier to attack than a completely random recovery key. If you choose to use a password, DON'T make it the same as your login password, otherwise your server can read all your encrypted messages. (You don't want that.)"
color: Nheko.colors.text
wrapMode: Text.Wrap
}
Item {
Layout.margins: Nheko.paddingMedium
Layout.topMargin: Nheko.paddingLarge
Layout.preferredHeight: storeSecretsOnline.height
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.rowSpan: usePassword.checked ? 1 : 2
Layout.fillWidth: true
visible: storeSecretsOnline.checked
ToggleButton {
id: usePassword
checked: false
}
}
MatrixTextField {
id: passwordField
Layout.margins: Nheko.paddingMedium
Layout.maximumWidth: Math.floor(grid.width / 2) - Nheko.paddingMedium * 2
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.columnSpan: 1
Layout.fillWidth: true
visible: storeSecretsOnline.checked && usePassword.checked
echoMode: TextInput.Password
}
Label {
Layout.margins: Nheko.paddingMedium
Layout.alignment: Qt.AlignLeft
Layout.columnSpan: 1
Layout.maximumWidth: Math.floor(grid.width / 2) - Nheko.paddingMedium * 2
text: "Use online key backup.\nStore the keys for your messages securely encrypted online. In general you do want this, because it protects your messages from becoming unreadable, if you log out by accident. It does however carry a small security risk, if you ever share your recovery key by accident. Currently this also has some other weaknesses, that might allow the server to insert new keys into your backup. The server will however never be able to read your messages."
color: Nheko.colors.text
wrapMode: Text.Wrap
}
Item {
Layout.margins: Nheko.paddingMedium
Layout.preferredHeight: storeSecretsOnline.height
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.fillWidth: true
ToggleButton {
id: useOnlineKeyBackup
checked: true
onClicked: console.log("Online key backup toggled: " + checked)
}
checked: true
onClicked: console.log("Store secrets toggled: " + checked)
} }
} }
Label {
Layout.margins: Nheko.paddingMedium
Layout.alignment: Qt.AlignLeft
Layout.columnSpan: 1
Layout.rowSpan: 2
Layout.maximumWidth: Math.floor(grid.width / 2) - Nheko.paddingMedium * 2
visible: storeSecretsOnline.checked
text: "Set an online backup password.\nWe recommend you DON'T set a password and instead only rely on the recovery key. You will get a recovery key in any case when storing the cross-signing secrets online, but passwords are usually not very random, so they are easier to attack than a completely random recovery key. If you choose to use a password, DON'T make it the same as your login password, otherwise your server can read all your encrypted messages. (You don't want that.)"
color: Nheko.colors.text
wrapMode: Text.Wrap
}
Item {
Layout.margins: Nheko.paddingMedium
Layout.topMargin: Nheko.paddingLarge
Layout.preferredHeight: storeSecretsOnline.height
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.rowSpan: usePassword.checked ? 1 : 2
Layout.fillWidth: true
visible: storeSecretsOnline.checked
ToggleButton {
id: usePassword
checked: false
}
}
MatrixTextField {
id: passwordField
Layout.margins: Nheko.paddingMedium
Layout.maximumWidth: Math.floor(grid.width / 2) - Nheko.paddingMedium * 2
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.columnSpan: 1
Layout.fillWidth: true
visible: storeSecretsOnline.checked && usePassword.checked
echoMode: TextInput.Password
}
Label {
Layout.margins: Nheko.paddingMedium
Layout.alignment: Qt.AlignLeft
Layout.columnSpan: 1
Layout.maximumWidth: Math.floor(grid.width / 2) - Nheko.paddingMedium * 2
text: "Use online key backup.\nStore the keys for your messages securely encrypted online. In general you do want this, because it protects your messages from becoming unreadable, if you log out by accident. It does however carry a small security risk, if you ever share your recovery key by accident. Currently this also has some other weaknesses, that might allow the server to insert new keys into your backup. The server will however never be able to read your messages."
color: Nheko.colors.text
wrapMode: Text.Wrap
}
Item {
Layout.margins: Nheko.paddingMedium
Layout.preferredHeight: storeSecretsOnline.height
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.fillWidth: true
ToggleButton {
id: useOnlineKeyBackup
checked: true
onClicked: console.log("Online key backup toggled: " + checked)
}
}
}
background: Rectangle { background: Rectangle {
color: Nheko.colors.window color: Nheko.colors.window
@ -230,58 +229,60 @@ Item {
columns: 1 columns: 1
z: 1 z: 1
Label { Label {
Layout.margins: Nheko.paddingMedium Layout.margins: Nheko.paddingMedium
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
//Layout.columnSpan: 2 //Layout.columnSpan: 2
font.pointSize: fontMetrics.font.pointSize * 2 font.pointSize: fontMetrics.font.pointSize * 2
text: qsTr("Activate Encryption") text: qsTr("Activate Encryption")
color: Nheko.colors.text color: Nheko.colors.text
wrapMode: Text.Wrap wrapMode: Text.Wrap
}
Label {
Layout.margins: Nheko.paddingMedium
Layout.alignment: Qt.AlignLeft
//Layout.columnSpan: 2
Layout.maximumWidth: grid.width - Nheko.paddingMedium * 2
text: qsTr("It seems like you have encryption already configured for this account. To be able to access your encrypted messages and make this device appear as trusted, you can either verify an existing device or (if you have one) enter your recovery passphrase. Please select one of the options below.\nIf you choose verify, you need to have the other device available. If you choose \"enter passphrase\", you will need your recovery key or passphrase. If you click cancel, you can choose to verify yourself at a later point.")
color: Nheko.colors.text
wrapMode: Text.Wrap
}
FlatButton {
Layout.alignment: Qt.AlignHCenter
text: qsTr("verify")
onClicked: {
SelfVerificationStatus.verifyMasterKey();
verifyMasterKey.close();
} }
}
FlatButton { Label {
visible: SelfVerificationStatus.hasSSSS Layout.margins: Nheko.paddingMedium
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignLeft
text: qsTr("enter passphrase") //Layout.columnSpan: 2
onClicked: { Layout.maximumWidth: grid.width - Nheko.paddingMedium * 2
SelfVerificationStatus.verifyMasterKeyWithPassphrase() text: qsTr("It seems like you have encryption already configured for this account. To be able to access your encrypted messages and make this device appear as trusted, you can either verify an existing device or (if you have one) enter your recovery passphrase. Please select one of the options below.\nIf you choose verify, you need to have the other device available. If you choose \"enter passphrase\", you will need your recovery key or passphrase. If you click cancel, you can choose to verify yourself at a later point.")
verifyMasterKey.close(); color: Nheko.colors.text
wrapMode: Text.Wrap
} }
FlatButton {
Layout.alignment: Qt.AlignHCenter
text: qsTr("verify")
onClicked: {
SelfVerificationStatus.verifyMasterKey();
verifyMasterKey.close();
}
}
FlatButton {
visible: SelfVerificationStatus.hasSSSS
Layout.alignment: Qt.AlignHCenter
text: qsTr("enter passphrase")
onClicked: {
SelfVerificationStatus.verifyMasterKeyWithPassphrase();
verifyMasterKey.close();
}
}
} }
}
} }
Connections { Connections {
function onStatusChanged() { function onStatusChanged() {
console.log("STATUS CHANGED: " + SelfVerificationStatus.status); console.log("STATUS CHANGED: " + SelfVerificationStatus.status);
if (SelfVerificationStatus.status == SelfVerificationStatus.NoMasterKey) if (SelfVerificationStatus.status == SelfVerificationStatus.NoMasterKey) {
bootstrapCrosssigning.open(); bootstrapCrosssigning.open();
else if (SelfVerificationStatus.status == SelfVerificationStatus.UnverifiedMasterKey) } else if (SelfVerificationStatus.status == SelfVerificationStatus.UnverifiedMasterKey) {
verifyMasterKey.open(); verifyMasterKey.open();
else { } else {
bootstrapCrosssigning.close(); bootstrapCrosssigning.close();
verifyMasterKey.close(); verifyMasterKey.close();
} }
} }
function onShowRecoveryKey(key) { function onShowRecoveryKey(key) {

View file

@ -9,6 +9,9 @@ import QtQuick.Layouts 1.3
import im.nheko 1.0 import im.nheko 1.0
Dialog { Dialog {
default property alias inner: scroll.data
property int useableWidth: scroll.width - scroll.ScrollBar.vertical.width
parent: Overlay.overlay parent: Overlay.overlay
anchors.centerIn: parent anchors.centerIn: parent
height: (Math.floor(parent.height / 2) - Nheko.paddingLarge) * 2 height: (Math.floor(parent.height / 2) - Nheko.paddingLarge) * 2
@ -17,10 +20,6 @@ Dialog {
modal: true modal: true
standardButtons: Dialog.Ok | Dialog.Cancel standardButtons: Dialog.Ok | Dialog.Cancel
closePolicy: Popup.NoAutoClose closePolicy: Popup.NoAutoClose
default property alias inner: scroll.data
property int useableWidth: scroll.width - scroll.ScrollBar.vertical.width
contentChildren: [ contentChildren: [
ScrollView { ScrollView {
id: scroll id: scroll

View file

@ -45,6 +45,7 @@ ApplicationWindow {
onAccepted: { onAccepted: {
if (input.text.match("#.+?:.{3,}")) if (input.text.match("#.+?:.{3,}"))
dbb.accepted(); dbb.accepted();
} }
} }
@ -71,6 +72,7 @@ ApplicationWindow {
text: "Cancel" text: "Cancel"
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
} }
} }
} }

View file

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

View file

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

File diff suppressed because it is too large Load diff

View file

@ -319,22 +319,25 @@ ApplicationWindow {
} }
ImageButton { ImageButton {
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
image: ":/icons/icons/ui/power-button-off.png" image: ":/icons/icons/ui/power-button-off.png"
hoverEnabled: true hoverEnabled: true
ToolTip.visible: hovered ToolTip.visible: hovered
ToolTip.text: qsTr("Sign out this device.") ToolTip.text: qsTr("Sign out this device.")
onClicked: profile.signOutDevice(deviceId) onClicked: profile.signOutDevice(deviceId)
visible: profile.isSelf visible: profile.isSelf
} }
} }
RowLayout { RowLayout {
id: deviceNameRow id: deviceNameRow
property bool isEditingAllowed property bool isEditingAllowed
TextInput { TextInput {
id: deviceNameField id: deviceNameField
readOnly: !deviceNameRow.isEditingAllowed readOnly: !deviceNameRow.isEditingAllowed
text: deviceName text: deviceName
color: Nheko.colors.text color: Nheko.colors.text
@ -373,7 +376,7 @@ ApplicationWindow {
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
elide: Text.ElideRight elide: Text.ElideRight
color: Nheko.colors.text color: Nheko.colors.text
text: qsTr("Last seen %1 from %2").arg(new Date(lastTs).toLocaleString(Locale.ShortFormat)).arg(lastIp?lastIp:"???") text: qsTr("Last seen %1 from %2").arg(new Date(lastTs).toLocaleString(Locale.ShortFormat)).arg(lastIp ? lastIp : "???")
} }
} }
@ -409,8 +412,6 @@ ApplicationWindow {
} }
} }
} }
footer: DialogButtonBox { footer: DialogButtonBox {