added "show password" functionality and fixed some layout and compiling issues
This commit is contained in:
parent
98e913a134
commit
58f5d4835b
6 changed files with 132 additions and 22 deletions
|
@ -1,8 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<manifest package="com.itsblue.flgvertretung" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.04.1" android:versionCode="8" android:installLocation="auto">
|
||||
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<external-path name="external_files" path="."/>
|
||||
</paths>
|
||||
<manifest package="com.itsblue.flgvertretungtest" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.04.1" android:versionCode="8" android:installLocation="auto">
|
||||
|
||||
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="fannyapp" android:icon="@drawable/icon">
|
||||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="fannyapp" android:screenOrientation="unspecified" android:launchMode="singleTop">
|
||||
<intent-filter>
|
||||
|
@ -68,7 +66,7 @@
|
|||
|
||||
</application>
|
||||
|
||||
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16"/>
|
||||
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="28"/>
|
||||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
|
||||
|
||||
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
|
||||
|
|
BIN
graphics/icons/hide.png
Normal file
BIN
graphics/icons/hide.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
graphics/icons/view.png
Normal file
BIN
graphics/icons/view.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
|
@ -1,12 +1,15 @@
|
|||
import QtQuick 2.0
|
||||
import QtQuick 2.11
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.2
|
||||
|
||||
Page {
|
||||
id: root
|
||||
//anchors.fill: parent
|
||||
objectName: "LoginPage";
|
||||
|
||||
onHeightChanged: {
|
||||
console.log(height)
|
||||
}
|
||||
|
||||
header: AppToolBar {
|
||||
Label {
|
||||
text: "Anmeldung"
|
||||
|
@ -24,6 +27,8 @@ Page {
|
|||
anchors.margins: window.height * 0.01
|
||||
height: window.height * 0.2
|
||||
fillMode: Image.PreserveAspectFit
|
||||
mipmap: true
|
||||
smooth: true
|
||||
}
|
||||
|
||||
Label {
|
||||
|
@ -44,33 +49,138 @@ Page {
|
|||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
|
||||
spacing: 40
|
||||
width: parent.width
|
||||
anchors.fill: parent
|
||||
anchors.topMargin: bigLogo.height + infoText.height + window.height * 0.02
|
||||
anchors.bottomMargin: window.height * 0.2
|
||||
Column {
|
||||
spacing: ( height - 100 ) * 0.1
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: infoText.bottom
|
||||
bottom: parent.bottom
|
||||
topMargin: window.height * 0.02
|
||||
bottomMargin: window.height * 0.2
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: tiuname
|
||||
placeholderText: "Benutzername"
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
Keys.onReturnPressed: login(tiuname.text, tipasswd.text, cBperm.checked)
|
||||
anchors.left: parent.left
|
||||
anchors.margins: window.width * 0.05
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: root.width * 0.05
|
||||
right: parent.right
|
||||
rightMargin: root.width * 0.05
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
TextField {
|
||||
id: tipasswd
|
||||
echoMode: TextInput.Password
|
||||
echoMode: passwordHideShow.state === "visible" ? TextInput.Normal:TextInput.Password
|
||||
placeholderText: "Passwort"
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
Keys.onReturnPressed: login(tiuname.text, tipasswd.text, cBperm.checked)
|
||||
anchors.left: parent.left
|
||||
anchors.margins: window.width * 0.05
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: root.width * 0.05
|
||||
right: parent.right
|
||||
rightMargin: root.width * 0.05
|
||||
}
|
||||
|
||||
|
||||
|
||||
MouseArea {
|
||||
id: passwordHideShow
|
||||
anchors {
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
right: parent.right
|
||||
}
|
||||
width: visibleIcon.width
|
||||
|
||||
onClicked: {
|
||||
if(state === "visible"){
|
||||
state = "invisible"
|
||||
}
|
||||
else {
|
||||
state = "visible"
|
||||
}
|
||||
}
|
||||
|
||||
state: "invisible"
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "visible"
|
||||
PropertyChanges {
|
||||
target: visibleIcon
|
||||
scale: 0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: invisibleIcon
|
||||
scale: 1
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "invisible"
|
||||
PropertyChanges {
|
||||
target: visibleIcon
|
||||
scale: 1
|
||||
}
|
||||
PropertyChanges {
|
||||
target: invisibleIcon
|
||||
scale: 0
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
transitions: [
|
||||
Transition {
|
||||
from: "*"
|
||||
to: "*"
|
||||
NumberAnimation {
|
||||
properties: "scale,opacity"
|
||||
easing.type: Easing.InOutQuad
|
||||
duration: 200
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Image {
|
||||
id: visibleIcon
|
||||
|
||||
anchors {
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
right: parent.right
|
||||
|
||||
bottomMargin: parent.height * 0.3
|
||||
topMargin: bottomMargin
|
||||
}
|
||||
fillMode: Image.PreserveAspectFit
|
||||
smooth: true
|
||||
mipmap: true
|
||||
source: "qrc:/graphics/icons/view.png"
|
||||
}
|
||||
|
||||
Image {
|
||||
id: invisibleIcon
|
||||
|
||||
anchors {
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
right: parent.right
|
||||
|
||||
bottomMargin: parent.height * 0.35
|
||||
topMargin: bottomMargin
|
||||
}
|
||||
fillMode: Image.PreserveAspectFit
|
||||
smooth: true
|
||||
mipmap: true
|
||||
source: "qrc:/graphics/icons/hide.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CheckDelegate {
|
||||
|
|
|
@ -10,5 +10,7 @@
|
|||
<file>graphics/icons/drawer.png</file>
|
||||
<file>graphics/icons/menu.png</file>
|
||||
<file>graphics/FannyLogo_small.png</file>
|
||||
<file>graphics/icons/hide.png</file>
|
||||
<file>graphics/icons/view.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -183,7 +183,7 @@ int ServerConn::getEvents(){
|
|||
ReturnData_t ret; //this is a custom type to store the returned data
|
||||
// Call the webservice
|
||||
|
||||
QNetworkRequest request(QUrl("https://api.itsblue.de/fanny/vertretung.php?uname=ZedlerDo&passwd=LxyJQB&day=smorgen&agree=true"));
|
||||
QNetworkRequest request(QUrl("http://api.itsblue.de/fanny/vertretung.php?uname=ZedlerDo&passwd=LxyJQB&day=smorgen&agree=true"));
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader,
|
||||
"application/x-www-form-urlencoded");
|
||||
|
||||
|
|
Reference in a new issue