mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-20 17:16:46 +00:00
GODT-1346: GODT-1340 GODT-1315 QML changes
GODT-1365: Create ComboBox component GODT-1338: GODT-1343 Help view buttons GODT-1340: Not crashing, user list updating in main thread. GODT-1345: adding panic handlers
This commit is contained in:
@ -20,9 +20,10 @@ import QtQuick.Window 2.13
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
import Proton 4.0
|
||||
import "../Proton"
|
||||
|
||||
RowLayout {
|
||||
id: root
|
||||
property ColorScheme colorScheme
|
||||
|
||||
// Primary buttons
|
||||
|
||||
@ -18,7 +18,8 @@
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import Proton 4.0
|
||||
|
||||
import "../Proton"
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
|
||||
@ -20,7 +20,7 @@ import QtQuick.Window 2.13
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
import Proton 4.0
|
||||
import "../Proton"
|
||||
|
||||
RowLayout {
|
||||
id: root
|
||||
@ -33,29 +33,35 @@ RowLayout {
|
||||
|
||||
CheckBox {
|
||||
text: "Checkbox"
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
text: "Checkbox"
|
||||
error: true
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
text: "Checkbox"
|
||||
enabled: false
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
CheckBox {
|
||||
text: ""
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
text: ""
|
||||
error: true
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
text: ""
|
||||
enabled: false
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,34 +73,40 @@ RowLayout {
|
||||
CheckBox {
|
||||
text: "Checkbox"
|
||||
checked: true
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
text: "Checkbox"
|
||||
checked: true
|
||||
error: true
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
text: "Checkbox"
|
||||
checked: true
|
||||
enabled: false
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
CheckBox {
|
||||
text: ""
|
||||
checked: true
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
text: ""
|
||||
checked: true
|
||||
error: true
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
text: ""
|
||||
checked: true
|
||||
enabled: false
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
100
internal/frontend/qml/tests/ComboBoxes.qml
Normal file
100
internal/frontend/qml/tests/ComboBoxes.qml
Normal file
@ -0,0 +1,100 @@
|
||||
// Copyright (c) 2021 Proton Technologies AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
import QtQuick 2.13
|
||||
import QtQuick.Window 2.13
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
import "../Proton"
|
||||
|
||||
RowLayout {
|
||||
id: root
|
||||
property ColorScheme colorScheme
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
ComboBox {
|
||||
Layout.fillWidth: true
|
||||
model: ["First", "Second", "Third"]
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
Layout.fillWidth: true
|
||||
model: ["First", "Second", "Third"]
|
||||
editable: true
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
ComboBox {
|
||||
Layout.fillWidth: true
|
||||
model: ["First", "Second", "Third"]
|
||||
colorScheme: root.colorScheme
|
||||
enabled: false
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
Layout.fillWidth: true
|
||||
model: ["First", "Second", "Third"]
|
||||
editable: true
|
||||
colorScheme: root.colorScheme
|
||||
enabled: false
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
ComboBox {
|
||||
Layout.fillWidth: true
|
||||
model: ["First", "Second", "Third"]
|
||||
colorScheme: root.colorScheme
|
||||
LayoutMirroring.enabled: true
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
Layout.fillWidth: true
|
||||
model: ["First", "Second", "Third"]
|
||||
editable: true
|
||||
colorScheme: root.colorScheme
|
||||
LayoutMirroring.enabled: true
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
ComboBox {
|
||||
Layout.fillWidth: true
|
||||
model: ["First", "Second", "Third"]
|
||||
colorScheme: root.colorScheme
|
||||
enabled: false
|
||||
LayoutMirroring.enabled: true
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
Layout.fillWidth: true
|
||||
model: ["First", "Second", "Third"]
|
||||
editable: true
|
||||
colorScheme: root.colorScheme
|
||||
enabled: false
|
||||
LayoutMirroring.enabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -20,9 +20,10 @@ import QtQuick.Window 2.13
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
import Proton 4.0
|
||||
import "../Proton"
|
||||
|
||||
RowLayout {
|
||||
id: root
|
||||
property ColorScheme colorScheme
|
||||
|
||||
ColumnLayout {
|
||||
|
||||
@ -20,9 +20,10 @@ import QtQuick.Window 2.13
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
import Proton 4.0
|
||||
import "../Proton"
|
||||
|
||||
RowLayout {
|
||||
id: root
|
||||
property ColorScheme colorScheme
|
||||
|
||||
ColumnLayout {
|
||||
@ -32,30 +33,36 @@ RowLayout {
|
||||
|
||||
Switch {
|
||||
text: "Toggle"
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
Switch {
|
||||
text: "Toggle"
|
||||
enabled: false
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
Switch {
|
||||
text: "Toggle"
|
||||
loading: true
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
Switch {
|
||||
text: ""
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
Switch {
|
||||
text: ""
|
||||
enabled: false
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
Switch {
|
||||
text: ""
|
||||
loading: true
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,35 +74,41 @@ RowLayout {
|
||||
Switch {
|
||||
text: "Toggle"
|
||||
checked: true
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
Switch {
|
||||
text: "Toggle"
|
||||
checked: true
|
||||
enabled: false
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
Switch {
|
||||
text: "Toggle"
|
||||
checked: true
|
||||
loading: true
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
Switch {
|
||||
text: ""
|
||||
checked: true
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
Switch {
|
||||
text: ""
|
||||
checked: true
|
||||
enabled: false
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
|
||||
Switch {
|
||||
text: ""
|
||||
checked: true
|
||||
loading: true
|
||||
colorScheme: root.colorScheme
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
30
internal/frontend/qml/tests/Test.qml
Normal file
30
internal/frontend/qml/tests/Test.qml
Normal file
@ -0,0 +1,30 @@
|
||||
// Copyright (c) 2021 Proton Technologies AG
|
||||
//
|
||||
// This file is part of ProtonMail Bridge.
|
||||
//
|
||||
// ProtonMail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ProtonMail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with ProtonMail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
import QtQuick.Window 2.13
|
||||
|
||||
import "../Proton"
|
||||
|
||||
Window {
|
||||
width: 800
|
||||
height: 600
|
||||
visible: true
|
||||
TestComponents {
|
||||
anchors.fill: parent
|
||||
colorScheme: ProtonStyle.currentStyle
|
||||
}
|
||||
}
|
||||
@ -19,52 +19,68 @@ import QtQuick 2.13
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
import Proton 4.0
|
||||
import "../Proton"
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
property ColorScheme colorScheme
|
||||
color: colorScheme.background_norm
|
||||
clip: true
|
||||
|
||||
ColumnLayout {
|
||||
implicitHeight: children[0].implicitHeight + children[0].anchors.topMargin + children[0].anchors.bottomMargin
|
||||
implicitWidth: children[0].implicitWidth + children[0].anchors.leftMargin + children[0].anchors.rightMargin
|
||||
|
||||
ScrollView {
|
||||
anchors.fill: parent
|
||||
|
||||
spacing: 5
|
||||
ColumnLayout {
|
||||
anchors.margins: 20
|
||||
|
||||
Buttons {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 20
|
||||
}
|
||||
width: root.width
|
||||
|
||||
TextFields {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 20
|
||||
}
|
||||
spacing: 5
|
||||
|
||||
TextAreas {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 20
|
||||
}
|
||||
Buttons {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 20
|
||||
}
|
||||
|
||||
CheckBoxes {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 20
|
||||
}
|
||||
CheckBoxes {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 20
|
||||
}
|
||||
|
||||
RadioButtons {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 20
|
||||
}
|
||||
ComboBoxes {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 20
|
||||
}
|
||||
|
||||
Switches {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 20
|
||||
RadioButtons {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 20
|
||||
}
|
||||
|
||||
Switches {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 20
|
||||
}
|
||||
|
||||
TextAreas {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 20
|
||||
}
|
||||
|
||||
TextFields {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 20
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ import QtQuick.Window 2.13
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
import Proton 4.0
|
||||
import "../Proton"
|
||||
|
||||
RowLayout {
|
||||
id: root
|
||||
|
||||
@ -20,9 +20,10 @@ import QtQuick.Window 2.13
|
||||
import QtQuick.Layouts 1.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
import Proton 4.0
|
||||
import "../Proton"
|
||||
|
||||
RowLayout {
|
||||
id: root
|
||||
property ColorScheme colorScheme
|
||||
|
||||
// Norm
|
||||
@ -148,6 +149,23 @@ RowLayout {
|
||||
placeholderText: "Placeholder"
|
||||
label: "Label"
|
||||
hint: "Hint"
|
||||
assistiveText: "Assistive text"
|
||||
}
|
||||
|
||||
TextField {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
|
||||
placeholderText: "Placeholder"
|
||||
label: "Label"
|
||||
}
|
||||
|
||||
TextField {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
|
||||
placeholderText: "Placeholder"
|
||||
hint: "Hint"
|
||||
}
|
||||
|
||||
TextField {
|
||||
@ -157,12 +175,5 @@ RowLayout {
|
||||
placeholderText: "Placeholder"
|
||||
assistiveText: "Assistive text"
|
||||
}
|
||||
|
||||
TextField {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
|
||||
placeholderText: "Placeholder"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user