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
This commit is contained in:
@@ -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")
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
import QtQuick 2.12
|
||||
import "../Base"
|
||||
import "../Base/ButtonLayout"
|
||||
import "../Base/Buttons"
|
||||
import "../PythonBridge"
|
||||
|
||||
PasswordPopup {
|
||||
|
@@ -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")
|
||||
|
@@ -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")
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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")
|
||||
|
@@ -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"
|
||||
|
@@ -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") :
|
||||
|
@@ -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 ||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user