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:
@@ -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
|
||||
|
||||
|
@@ -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()
|
||||
|
@@ -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"
|
||||
|
||||
|
@@ -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) :
|
||||
|
Reference in New Issue
Block a user