Style Login page
This commit is contained in:
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
@@ -21,6 +21,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
anchors.topMargin: Dimensions.l
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
loggedin_user.loginOkay.connect(loggedin);
|
loggedin_user.loginOkay.connect(loggedin);
|
||||||
@@ -31,57 +32,66 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
|
||||||
spacing: Dimensions.m
|
spacing: Dimensions.m
|
||||||
|
anchors.centerIn: parent
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
font: Typography.h1
|
font: Typography.h1
|
||||||
text: qsTr("Login")
|
text: qsTr("Login")
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
Layout.bottomMargin: Dimensions.l
|
||||||
}
|
}
|
||||||
Label {
|
|
||||||
text: qsTr("Benutzername")
|
|
||||||
}
|
|
||||||
TextField {
|
|
||||||
id: benutzerName
|
|
||||||
focus: true
|
|
||||||
implicitWidth: 300
|
|
||||||
placeholderText: qsTr("Benutzernamen eingeben")
|
|
||||||
|
|
||||||
onAccepted: {
|
Field {
|
||||||
if (benutzerName.text.trim() && passwort.text.trim())
|
label: qsTr("Benutzername")
|
||||||
loggedin_user.login(benutzerName.text.trim(), passwort.text);
|
|
||||||
else if (benutzerName.text.trim())
|
TextField {
|
||||||
passwort.forceActiveFocus();
|
id: benutzerName
|
||||||
|
|
||||||
|
focus: true
|
||||||
|
implicitWidth: 300
|
||||||
|
placeholderText: qsTr("Benutzernamen eingeben")
|
||||||
|
|
||||||
|
onAccepted: {
|
||||||
|
if (benutzerName.text.trim() && passwort.text.trim())
|
||||||
|
loggedin_user.login(benutzerName.text.trim(), passwort.text);
|
||||||
|
else if (benutzerName.text.trim())
|
||||||
|
passwort.forceActiveFocus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Label {
|
Field {
|
||||||
text: qsTr("Passwort")
|
label: qsTr("Passwort")
|
||||||
}
|
|
||||||
TextField {
|
|
||||||
id: passwort
|
|
||||||
echoMode: TextInput.Password
|
|
||||||
implicitWidth: 300
|
|
||||||
placeholderText: qsTr("Passwort eingeben")
|
|
||||||
|
|
||||||
onAccepted: {
|
TextField {
|
||||||
if (benutzerName.text.trim() && passwort.text.trim())
|
id: passwort
|
||||||
loggedin_user.login(benutzerName.text.trim(), passwort.text);
|
|
||||||
else if (passwort.text.trim())
|
echoMode: TextInput.Password
|
||||||
benutzerName.forceActiveFocus();
|
implicitWidth: 300
|
||||||
|
placeholderText: qsTr("Passwort eingeben")
|
||||||
|
|
||||||
|
onAccepted: {
|
||||||
|
if (benutzerName.text.trim() && passwort.text.trim())
|
||||||
|
loggedin_user.login(benutzerName.text.trim(), passwort.text);
|
||||||
|
else if (passwort.text.trim())
|
||||||
|
benutzerName.forceActiveFocus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
text: qsTr("Primary")
|
Layout.topMargin: Dimensions.m
|
||||||
|
text: qsTr("Login")
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (benutzerName.text.trim() && passwort.text.trim())
|
if (benutzerName.text.trim() && passwort.text.trim())
|
||||||
loggedin_user.login(benutzerName.text.trim(), passwort.text);
|
loggedin_user.login(benutzerName.text.trim(), passwort.text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Dialog {
|
Dialog {
|
||||||
id: recoveryPaswordDialog
|
id: recoveryPaswordDialog
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,22 @@ pragma Singleton
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
/**
|
||||||
|
* Distance for objects that are tied to each other,
|
||||||
|
* e.g. a field and its label.
|
||||||
|
*/
|
||||||
readonly property int s: 9
|
readonly property int s: 9
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Distance for objects that are grouped together, e.g. radio buttons of the
|
||||||
|
* same radio group.
|
||||||
|
*/
|
||||||
readonly property int m: 15
|
readonly property int m: 15
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Distance for objects that are not related to each other, or to objects
|
||||||
|
* and their container.
|
||||||
|
*/
|
||||||
readonly property int l: 30
|
readonly property int l: 30
|
||||||
|
|
||||||
readonly property int radius: 4
|
readonly property int radius: 4
|
||||||
|
|||||||
13
TeroStyle/Field.qml
Normal file
13
TeroStyle/Field.qml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
required property string label
|
||||||
|
spacing: Dimensions.s
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: label
|
||||||
|
font: Typography.body
|
||||||
|
}
|
||||||
|
}
|
||||||
19
TeroStyle/TextField.qml
Normal file
19
TeroStyle/TextField.qml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Templates as T
|
||||||
|
|
||||||
|
T.TextField {
|
||||||
|
background: Rectangle {
|
||||||
|
id: background
|
||||||
|
color: Colors.mantle
|
||||||
|
radius: Dimensions.radius
|
||||||
|
border.width: 1
|
||||||
|
border.color: Colors.interactive
|
||||||
|
height: 47
|
||||||
|
}
|
||||||
|
|
||||||
|
color: Colors.foreground
|
||||||
|
implicitHeight: background.height
|
||||||
|
placeholderTextColor: Colors.interactive
|
||||||
|
font: Typography.body
|
||||||
|
padding: Dimensions.m
|
||||||
|
}
|
||||||
@@ -3,3 +3,5 @@ singleton Colors Colors.qml
|
|||||||
singleton Dimensions Dimensions.qml
|
singleton Dimensions Dimensions.qml
|
||||||
singleton Typography Typography.qml
|
singleton Typography Typography.qml
|
||||||
Button Button.qml
|
Button Button.qml
|
||||||
|
Field Field.qml
|
||||||
|
TextField TextField.qml
|
||||||
2
qml.qrc
2
qml.qrc
@@ -51,8 +51,10 @@
|
|||||||
<file>Gui/OfferTable.qml</file>
|
<file>Gui/OfferTable.qml</file>
|
||||||
<file>TeroStyle/Button.qml</file>
|
<file>TeroStyle/Button.qml</file>
|
||||||
<file>TeroStyle/Colors.qml</file>
|
<file>TeroStyle/Colors.qml</file>
|
||||||
|
<file>TeroStyle/Field.qml</file>
|
||||||
<file>TeroStyle/Dimensions.qml</file>
|
<file>TeroStyle/Dimensions.qml</file>
|
||||||
<file>TeroStyle/qmldir</file>
|
<file>TeroStyle/qmldir</file>
|
||||||
|
<file>TeroStyle/TextField.qml</file>
|
||||||
<file>TeroStyle/Typography.qml</file>
|
<file>TeroStyle/Typography.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/TeroStyle"/>
|
<qresource prefix="/TeroStyle"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user