From ed030f7dd96ca20adea541f4ab91a78f3ba4a2d8 Mon Sep 17 00:00:00 2001 From: miruka Date: Sat, 11 Jul 2020 22:52:14 -0400 Subject: [PATCH] Refactor ButtonLayout module components - Rename ButtonLayout module to just Buttons - Rename ButtonLayout into AutoDirectionLayout and move it to Base, it's useful not just for buttons - Rename OtherButton into GroupButton, which is now the base of all other Buttons buttons - Add generic (Positive|Middle|Negative)Button components, which are now the base for (Apply|Cancel)Button --- .../ButtonLayout.qml => AutoDirectionLayout.qml} | 1 - src/gui/Base/ButtonLayout/ApplyButton.qml | 14 -------------- src/gui/Base/ButtonLayout/CancelButton.qml | 14 -------------- src/gui/Base/Buttons/ApplyButton.qml | 6 ++++++ src/gui/Base/Buttons/CancelButton.qml | 6 ++++++ .../OtherButton.qml => Buttons/GroupButton.qml} | 1 - src/gui/Base/Buttons/MiddleButton.qml | 5 +++++ src/gui/Base/Buttons/NegativeButton.qml | 5 +++++ src/gui/Base/Buttons/PositiveButton.qml | 5 +++++ src/gui/Pages/AccountSettings/Account.qml | 4 ++-- src/gui/Pages/AccountSettings/DeviceDelegate.qml | 8 ++++---- src/gui/Pages/AccountSettings/Encryption.qml | 8 ++++---- src/gui/Pages/AccountSettings/Sessions.qml | 9 ++++----- src/gui/Pages/AddAccount/Register.qml | 4 ++-- src/gui/Pages/AddAccount/Reset.qml | 4 ++-- src/gui/Pages/AddAccount/SignIn.qml | 4 ++-- src/gui/Pages/AddChat/CreateRoom.qml | 4 ++-- src/gui/Pages/AddChat/DirectChat.qml | 4 ++-- src/gui/Pages/AddChat/JoinRoom.qml | 4 ++-- .../RoomPane/MemberView/DeviceVerification.qml | 8 ++++---- .../RoomPane/MemberView/MemberDeviceDelegate.qml | 2 +- src/gui/Pages/Chat/RoomPane/SettingsView.qml | 4 ++-- src/gui/Popups/ClearMessagesPopup.qml | 5 +++-- src/gui/Popups/DeleteDevicesPopup.qml | 2 +- src/gui/Popups/ForgetRoomPopup.qml | 5 +++-- src/gui/Popups/InviteToRoomPopup.qml | 4 ++-- src/gui/Popups/KeyVerificationPopup.qml | 8 ++++---- src/gui/Popups/LeaveRoomPopup.qml | 5 +++-- src/gui/Popups/PasswordPopup.qml | 4 ++-- src/gui/Popups/RedactPopup.qml | 4 ++-- src/gui/Popups/RemoveMemberPopup.qml | 4 ++-- src/gui/Popups/SignOutPopup.qml | 10 +++++----- src/gui/Popups/UnexpectedErrorPopup.qml | 6 +++--- 33 files changed, 90 insertions(+), 91 deletions(-) rename src/gui/Base/{ButtonLayout/ButtonLayout.qml => AutoDirectionLayout.qml} (97%) delete mode 100644 src/gui/Base/ButtonLayout/ApplyButton.qml delete mode 100644 src/gui/Base/ButtonLayout/CancelButton.qml create mode 100644 src/gui/Base/Buttons/ApplyButton.qml create mode 100644 src/gui/Base/Buttons/CancelButton.qml rename src/gui/Base/{ButtonLayout/OtherButton.qml => Buttons/GroupButton.qml} (90%) create mode 100644 src/gui/Base/Buttons/MiddleButton.qml create mode 100644 src/gui/Base/Buttons/NegativeButton.qml create mode 100644 src/gui/Base/Buttons/PositiveButton.qml diff --git a/src/gui/Base/ButtonLayout/ButtonLayout.qml b/src/gui/Base/AutoDirectionLayout.qml similarity index 97% rename from src/gui/Base/ButtonLayout/ButtonLayout.qml rename to src/gui/Base/AutoDirectionLayout.qml index 9798d9a3..fd286cda 100644 --- a/src/gui/Base/ButtonLayout/ButtonLayout.qml +++ b/src/gui/Base/AutoDirectionLayout.qml @@ -2,7 +2,6 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 -import ".." HGridLayout { readonly property real summedImplicitWidth: { diff --git a/src/gui/Base/ButtonLayout/ApplyButton.qml b/src/gui/Base/ButtonLayout/ApplyButton.qml deleted file mode 100644 index 148c8d4e..00000000 --- a/src/gui/Base/ButtonLayout/ApplyButton.qml +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import ".." - -HButton { - text: qsTr("Apply") - icon.name: "apply" - icon.color: theme.colors.positiveBackground - - Layout.preferredHeight: theme.baseElementsHeight - Layout.fillWidth: true -} diff --git a/src/gui/Base/ButtonLayout/CancelButton.qml b/src/gui/Base/ButtonLayout/CancelButton.qml deleted file mode 100644 index 0728ced9..00000000 --- a/src/gui/Base/ButtonLayout/CancelButton.qml +++ /dev/null @@ -1,14 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import ".." - -HButton { - text: qsTr("Cancel") - icon.name: "cancel" - icon.color: theme.colors.negativeBackground - - Layout.preferredHeight: theme.baseElementsHeight - Layout.fillWidth: true -} diff --git a/src/gui/Base/Buttons/ApplyButton.qml b/src/gui/Base/Buttons/ApplyButton.qml new file mode 100644 index 00000000..589619f3 --- /dev/null +++ b/src/gui/Base/Buttons/ApplyButton.qml @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later + +PositiveButton { + text: qsTr("Apply") + icon.name: "apply" +} diff --git a/src/gui/Base/Buttons/CancelButton.qml b/src/gui/Base/Buttons/CancelButton.qml new file mode 100644 index 00000000..80bb7e17 --- /dev/null +++ b/src/gui/Base/Buttons/CancelButton.qml @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later + +NegativeButton { + text: qsTr("Cancel") + icon.name: "cancel" +} diff --git a/src/gui/Base/ButtonLayout/OtherButton.qml b/src/gui/Base/Buttons/GroupButton.qml similarity index 90% rename from src/gui/Base/ButtonLayout/OtherButton.qml rename to src/gui/Base/Buttons/GroupButton.qml index 525477a9..14d6bb41 100644 --- a/src/gui/Base/ButtonLayout/OtherButton.qml +++ b/src/gui/Base/Buttons/GroupButton.qml @@ -1,6 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -import QtQuick 2.12 import QtQuick.Layouts 1.12 import ".." diff --git a/src/gui/Base/Buttons/MiddleButton.qml b/src/gui/Base/Buttons/MiddleButton.qml new file mode 100644 index 00000000..8b44170a --- /dev/null +++ b/src/gui/Base/Buttons/MiddleButton.qml @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later + +GroupButton { + icon.color: theme.colors.middleBackground +} diff --git a/src/gui/Base/Buttons/NegativeButton.qml b/src/gui/Base/Buttons/NegativeButton.qml new file mode 100644 index 00000000..366f518c --- /dev/null +++ b/src/gui/Base/Buttons/NegativeButton.qml @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later + +GroupButton { + icon.color: theme.colors.negativeBackground +} diff --git a/src/gui/Base/Buttons/PositiveButton.qml b/src/gui/Base/Buttons/PositiveButton.qml new file mode 100644 index 00000000..c73c81ea --- /dev/null +++ b/src/gui/Base/Buttons/PositiveButton.qml @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later + +GroupButton { + icon.color: theme.colors.positiveBackground +} diff --git a/src/gui/Pages/AccountSettings/Account.qml b/src/gui/Pages/AccountSettings/Account.qml index 7dfc7287..ae51de37 100644 --- a/src/gui/Pages/AccountSettings/Account.qml +++ b/src/gui/Pages/AccountSettings/Account.qml @@ -5,7 +5,7 @@ import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import "../.." import "../../Base" -import "../../Base/ButtonLayout" +import "../../Base/Buttons" import "../../Dialogs" HFlickableColumnPage { @@ -64,7 +64,7 @@ HFlickableColumnPage { } - footer: ButtonLayout { + footer: AutoDirectionLayout { ApplyButton { id: saveButton diff --git a/src/gui/Pages/AccountSettings/DeviceDelegate.qml b/src/gui/Pages/AccountSettings/DeviceDelegate.qml index bc95ce27..00b96d17 100644 --- a/src/gui/Pages/AccountSettings/DeviceDelegate.qml +++ b/src/gui/Pages/AccountSettings/DeviceDelegate.qml @@ -3,7 +3,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../../Base" -import "../../Base/ButtonLayout" +import "../../Base/Buttons" import "../../Base/HTile" HTile { @@ -133,10 +133,10 @@ HTile { label.text: qsTr("Actions:") label.horizontalAlignment: Qt.AlignHCenter - ButtonLayout { + AutoDirectionLayout { width: parent.width - ApplyButton { + PositiveButton { enabled: model.type !== "no_keys" icon.name: "device-verify" text: @@ -163,7 +163,7 @@ HTile { } } - CancelButton { + NegativeButton { text: qsTr("Sign out") icon.name: "device-delete" onClicked: deviceTile.deleteRequest() diff --git a/src/gui/Pages/AccountSettings/Encryption.qml b/src/gui/Pages/AccountSettings/Encryption.qml index f6a9d5db..032aa81c 100644 --- a/src/gui/Pages/AccountSettings/Encryption.qml +++ b/src/gui/Pages/AccountSettings/Encryption.qml @@ -3,7 +3,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../../Base" -import "../../Base/ButtonLayout" +import "../../Base/Buttons" HFlickableColumnPage { id: page @@ -15,8 +15,8 @@ HFlickableColumnPage { function takeFocus() { exportButton.forceActiveFocus() } - footer: ButtonLayout { - OtherButton { + footer: AutoDirectionLayout { + GroupButton { id: exportButton text: qsTr("Export") icon.name: "export-keys" @@ -32,7 +32,7 @@ HFlickableColumnPage { ) } - OtherButton { + GroupButton { text: qsTr("Import") icon.name: "import-keys" diff --git a/src/gui/Pages/AccountSettings/Sessions.qml b/src/gui/Pages/AccountSettings/Sessions.qml index a3109091..a06702c6 100644 --- a/src/gui/Pages/AccountSettings/Sessions.qml +++ b/src/gui/Pages/AccountSettings/Sessions.qml @@ -5,7 +5,7 @@ import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import "../.." import "../../Base" -import "../../Base/ButtonLayout" +import "../../Base/Buttons" import "../../PythonBridge" import "../../ShortcutBundles" @@ -100,15 +100,15 @@ HColumnPage { } - footer: ButtonLayout { - OtherButton { + footer: AutoDirectionLayout { + GroupButton { id: refreshButton text: qsTr("Refresh") icon.name: "device-refresh-list" onClicked: page.loadDevices() } - OtherButton { + NegativeButton { id: signOutCheckedButton enabled: deviceList.model.count > 0 text: @@ -117,7 +117,6 @@ HColumnPage { qsTr("Sign out checked") icon.name: "device-delete-checked" - icon.color: theme.colors.negativeBackground onClicked: deviceList.selectedCount ? page.deleteDevices(...deviceList.checkedIndice) : diff --git a/src/gui/Pages/AddAccount/Register.qml b/src/gui/Pages/AddAccount/Register.qml index 23b2293d..c5c799ab 100644 --- a/src/gui/Pages/AddAccount/Register.qml +++ b/src/gui/Pages/AddAccount/Register.qml @@ -3,13 +3,13 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../../Base" -import "../../Base/ButtonLayout" +import "../../Base/Buttons" HFlickableColumnPage { function takeFocus() { registerButton.forceActiveFocus() } - footer: ButtonLayout { + footer: AutoDirectionLayout { ApplyButton { id: registerButton text: qsTr("Register from Riot") diff --git a/src/gui/Pages/AddAccount/Reset.qml b/src/gui/Pages/AddAccount/Reset.qml index 21bec39d..9e4cb56d 100644 --- a/src/gui/Pages/AddAccount/Reset.qml +++ b/src/gui/Pages/AddAccount/Reset.qml @@ -3,13 +3,13 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../../Base" -import "../../Base/ButtonLayout" +import "../../Base/Buttons" HFlickableColumnPage { function takeFocus() { resetButton.forceActiveFocus() } - footer: ButtonLayout { + footer: AutoDirectionLayout { ApplyButton { id: resetButton text: qsTr("Reset password from Riot") diff --git a/src/gui/Pages/AddAccount/SignIn.qml b/src/gui/Pages/AddAccount/SignIn.qml index 4e90e53c..f8d32a26 100644 --- a/src/gui/Pages/AddAccount/SignIn.qml +++ b/src/gui/Pages/AddAccount/SignIn.qml @@ -3,7 +3,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../../Base" -import "../../Base/ButtonLayout" +import "../../Base/Buttons" HFlickableColumnPage { id: page @@ -77,7 +77,7 @@ HFlickableColumnPage { } - footer: ButtonLayout { + footer: AutoDirectionLayout { ApplyButton { enabled: page.canSignIn text: qsTr("Sign in") diff --git a/src/gui/Pages/AddChat/CreateRoom.qml b/src/gui/Pages/AddChat/CreateRoom.qml index c2b464d0..ef7d5112 100644 --- a/src/gui/Pages/AddChat/CreateRoom.qml +++ b/src/gui/Pages/AddChat/CreateRoom.qml @@ -4,7 +4,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../.." import "../../Base" -import "../../Base/ButtonLayout" +import "../../Base/Buttons" HFlickableColumnPage { id: page @@ -52,7 +52,7 @@ HFlickableColumnPage { } - footer: ButtonLayout { + footer: AutoDirectionLayout { ApplyButton { id: applyButton text: qsTr("Create") diff --git a/src/gui/Pages/AddChat/DirectChat.qml b/src/gui/Pages/AddChat/DirectChat.qml index 06bb70a1..8662d105 100644 --- a/src/gui/Pages/AddChat/DirectChat.qml +++ b/src/gui/Pages/AddChat/DirectChat.qml @@ -4,7 +4,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../.." import "../../Base" -import "../../Base/ButtonLayout" +import "../../Base/Buttons" HFlickableColumnPage { id: page @@ -64,7 +64,7 @@ HFlickableColumnPage { } - footer: ButtonLayout { + footer: AutoDirectionLayout { ApplyButton { id: applyButton text: qsTr("Start chat") diff --git a/src/gui/Pages/AddChat/JoinRoom.qml b/src/gui/Pages/AddChat/JoinRoom.qml index 40b722d1..28e723da 100644 --- a/src/gui/Pages/AddChat/JoinRoom.qml +++ b/src/gui/Pages/AddChat/JoinRoom.qml @@ -4,7 +4,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../.." import "../../Base" -import "../../Base/ButtonLayout" +import "../../Base/Buttons" HFlickableColumnPage { id: page @@ -57,7 +57,7 @@ HFlickableColumnPage { } - footer: ButtonLayout { + footer: AutoDirectionLayout { ApplyButton { id: joinButton text: qsTr("Join") diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/DeviceVerification.qml b/src/gui/Pages/Chat/RoomPane/MemberView/DeviceVerification.qml index 6f8e2a26..1de8d4b5 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/DeviceVerification.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/DeviceVerification.qml @@ -3,7 +3,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../../../../Base" -import "../../../../Base/ButtonLayout" +import "../../../../Base/Buttons" HFlickableColumnPage { id: page @@ -27,8 +27,8 @@ HFlickableColumnPage { } - footer: ButtonLayout { - ApplyButton { + footer: AutoDirectionLayout { + PositiveButton { text: qsTr("They're the same") icon.name: "device-verified" onClicked: { @@ -46,7 +46,7 @@ HFlickableColumnPage { } } - CancelButton { + NegativeButton { text: qsTr("They differ") icon.name: "device-blacklisted" onClicked: { diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberDeviceDelegate.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDeviceDelegate.qml index c34e6748..e2b68df9 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberDeviceDelegate.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDeviceDelegate.qml @@ -3,7 +3,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../../../../Base" -import "../../../../Base/ButtonLayout" +import "../../../../Base/Buttons" import "../../../../Base/HTile" HTile { diff --git a/src/gui/Pages/Chat/RoomPane/SettingsView.qml b/src/gui/Pages/Chat/RoomPane/SettingsView.qml index 31ae50f9..f551f82e 100644 --- a/src/gui/Pages/Chat/RoomPane/SettingsView.qml +++ b/src/gui/Pages/Chat/RoomPane/SettingsView.qml @@ -4,7 +4,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import "../../../Base" -import "../../../Base/ButtonLayout" +import "../../../Base/Buttons" HFlickableColumnPage { id: settingsView @@ -63,7 +63,7 @@ HFlickableColumnPage { color: theme.chat.roomPane.roomSettings.background } - footer: ButtonLayout { + footer: AutoDirectionLayout { ApplyButton { enabled: anyChange loading: saveFuture !== null diff --git a/src/gui/Popups/ClearMessagesPopup.qml b/src/gui/Popups/ClearMessagesPopup.qml index 20b8f5fd..e982c1d8 100644 --- a/src/gui/Popups/ClearMessagesPopup.qml +++ b/src/gui/Popups/ClearMessagesPopup.qml @@ -1,7 +1,8 @@ // SPDX-License-Identifier: LGPL-3.0-or-later import QtQuick 2.12 -import "../Base/ButtonLayout" +import "../Base" +import "../Base/Buttons" HFlickableColumnPopup { id: popup @@ -12,7 +13,7 @@ HFlickableColumnPopup { property var preClearCallback: null - page.footer: ButtonLayout { + page.footer: AutoDirectionLayout { ApplyButton { id: clearButton text: qsTr("Clear") diff --git a/src/gui/Popups/DeleteDevicesPopup.qml b/src/gui/Popups/DeleteDevicesPopup.qml index cde21def..0983afd0 100644 --- a/src/gui/Popups/DeleteDevicesPopup.qml +++ b/src/gui/Popups/DeleteDevicesPopup.qml @@ -2,7 +2,7 @@ import QtQuick 2.12 import "../Base" -import "../Base/ButtonLayout" +import "../Base/Buttons" import "../PythonBridge" PasswordPopup { diff --git a/src/gui/Popups/ForgetRoomPopup.qml b/src/gui/Popups/ForgetRoomPopup.qml index 04f12486..503bc3b0 100644 --- a/src/gui/Popups/ForgetRoomPopup.qml +++ b/src/gui/Popups/ForgetRoomPopup.qml @@ -1,7 +1,8 @@ // SPDX-License-Identifier: LGPL-3.0-or-later import QtQuick 2.12 -import "../Base/ButtonLayout" +import "../Base" +import "../Base/Buttons" HFlickableColumnPopup { id: popup @@ -29,7 +30,7 @@ HFlickableColumnPopup { } - page.footer: ButtonLayout { + page.footer: AutoDirectionLayout { ApplyButton { id: forgetButton text: qsTr("Forget") diff --git a/src/gui/Popups/InviteToRoomPopup.qml b/src/gui/Popups/InviteToRoomPopup.qml index 799da2ee..a9ae7f36 100644 --- a/src/gui/Popups/InviteToRoomPopup.qml +++ b/src/gui/Popups/InviteToRoomPopup.qml @@ -4,7 +4,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import "../Base" -import "../Base/ButtonLayout" +import "../Base/Buttons" HColumnPopup { id: popup @@ -46,7 +46,7 @@ HColumnPopup { } - page.footer: ButtonLayout { + page.footer: AutoDirectionLayout { ApplyButton { id: inviteButton text: qsTr("Invite") diff --git a/src/gui/Popups/KeyVerificationPopup.qml b/src/gui/Popups/KeyVerificationPopup.qml index 80b7f428..c3c59fed 100644 --- a/src/gui/Popups/KeyVerificationPopup.qml +++ b/src/gui/Popups/KeyVerificationPopup.qml @@ -3,7 +3,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../Base" -import "../Base/ButtonLayout" +import "../Base/Buttons" HFlickableColumnPopup { id: popup @@ -18,8 +18,8 @@ HFlickableColumnPopup { property var blacklistedCallback: null - page.footer: ButtonLayout { - ApplyButton { + page.footer: AutoDirectionLayout { + PositiveButton { visible: ! deviceIsCurrent text: qsTr("They match") icon.name: "device-verified" @@ -37,7 +37,7 @@ HFlickableColumnPopup { } } - CancelButton { + NegativeButton { visible: ! popup.deviceIsCurrent text: qsTr("They differ") icon.name: "device-blacklisted" diff --git a/src/gui/Popups/LeaveRoomPopup.qml b/src/gui/Popups/LeaveRoomPopup.qml index ebcfbd60..2891813c 100644 --- a/src/gui/Popups/LeaveRoomPopup.qml +++ b/src/gui/Popups/LeaveRoomPopup.qml @@ -1,7 +1,8 @@ // SPDX-License-Identifier: LGPL-3.0-or-later import QtQuick 2.12 -import "../Base/ButtonLayout" +import "../Base" +import "../Base/Buttons" HFlickableColumnPopup { id: popup @@ -13,7 +14,7 @@ HFlickableColumnPopup { property var leftCallback: null - page.footer: ButtonLayout { + page.footer: AutoDirectionLayout { ApplyButton { id: leaveButton icon.name: "room-leave" diff --git a/src/gui/Popups/PasswordPopup.qml b/src/gui/Popups/PasswordPopup.qml index d896a910..b064fecd 100644 --- a/src/gui/Popups/PasswordPopup.qml +++ b/src/gui/Popups/PasswordPopup.qml @@ -3,7 +3,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../Base" -import "../Base/ButtonLayout" +import "../Base/Buttons" HFlickableColumnPopup { id: popup @@ -51,7 +51,7 @@ HFlickableColumnPopup { } - page.footer: ButtonLayout { + page.footer: AutoDirectionLayout { ApplyButton { id: validateButton text: qsTr("Confirm") diff --git a/src/gui/Popups/RedactPopup.qml b/src/gui/Popups/RedactPopup.qml index 10ef0d9e..0bc8d8c1 100644 --- a/src/gui/Popups/RedactPopup.qml +++ b/src/gui/Popups/RedactPopup.qml @@ -3,7 +3,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../Base" -import "../Base/ButtonLayout" +import "../Base/Buttons" HFlickableColumnPopup { id: popup @@ -38,7 +38,7 @@ HFlickableColumnPopup { } - page.footer: ButtonLayout { + page.footer: AutoDirectionLayout { ApplyButton { text: qsTr("Remove") icon.name: "remove-message" diff --git a/src/gui/Popups/RemoveMemberPopup.qml b/src/gui/Popups/RemoveMemberPopup.qml index 1b90a98f..a4f94936 100644 --- a/src/gui/Popups/RemoveMemberPopup.qml +++ b/src/gui/Popups/RemoveMemberPopup.qml @@ -3,7 +3,7 @@ import QtQuick 2.12 import QtQuick.Layouts 1.12 import "../Base" -import "../Base/ButtonLayout" +import "../Base/Buttons" HFlickableColumnPopup { id: popup @@ -30,7 +30,7 @@ HFlickableColumnPopup { } - page.footer: ButtonLayout { + page.footer: AutoDirectionLayout { ApplyButton { text: operation === "disinvite" ? qsTr("Disinvite") : diff --git a/src/gui/Popups/SignOutPopup.qml b/src/gui/Popups/SignOutPopup.qml index e0df1347..b3f7e08a 100644 --- a/src/gui/Popups/SignOutPopup.qml +++ b/src/gui/Popups/SignOutPopup.qml @@ -2,7 +2,8 @@ import QtQuick 2.12 import ".." -import "../Base/ButtonLayout" +import "../Base" +import "../Base/Buttons" HFlickableColumnPopup { id: popup @@ -11,8 +12,8 @@ HFlickableColumnPopup { property string userId: "" - page.footer: ButtonLayout { - ApplyButton { + page.footer: AutoDirectionLayout { + PositiveButton { id: exportButton text: qsTr("Export keys") icon.name: "export-keys" @@ -29,11 +30,10 @@ HFlickableColumnPopup { ) } - OtherButton { + MiddleButton { id: signOutButton text: qsTr("Sign out now") icon.name: "sign-out" - icon.color: theme.colors.middleBackground onClicked: { if (ModelStore.get("accounts").count < 2 || diff --git a/src/gui/Popups/UnexpectedErrorPopup.qml b/src/gui/Popups/UnexpectedErrorPopup.qml index 08c78194..da49a087 100644 --- a/src/gui/Popups/UnexpectedErrorPopup.qml +++ b/src/gui/Popups/UnexpectedErrorPopup.qml @@ -4,7 +4,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import "../Base" -import "../Base/ButtonLayout" +import "../Base/Buttons" HColumnPopup { id: popup @@ -15,8 +15,8 @@ HColumnPopup { property string traceback: "" - page.footer: ButtonLayout { - ApplyButton { + page.footer: AutoDirectionLayout { + PositiveButton { text: qsTr("Report") icon.name: "report-error" enabled: false // TODO