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:
miruka
2020-07-11 22:52:14 -04:00
parent 67f1572a18
commit ed030f7dd9
33 changed files with 90 additions and 91 deletions

View File

@@ -2,7 +2,6 @@
import QtQuick 2.12
import QtQuick.Layouts 1.12
import ".."
HGridLayout {
readonly property real summedImplicitWidth: {

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -0,0 +1,6 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
PositiveButton {
text: qsTr("Apply")
icon.name: "apply"
}

View File

@@ -0,0 +1,6 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
NegativeButton {
text: qsTr("Cancel")
icon.name: "cancel"
}

View File

@@ -1,6 +1,5 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
import QtQuick 2.12
import QtQuick.Layouts 1.12
import ".."

View File

@@ -0,0 +1,5 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
GroupButton {
icon.color: theme.colors.middleBackground
}

View File

@@ -0,0 +1,5 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
GroupButton {
icon.color: theme.colors.negativeBackground
}

View File

@@ -0,0 +1,5 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
GroupButton {
icon.color: theme.colors.positiveBackground
}