Commit 9cc01ead authored by Martin Straka's avatar Martin Straka

Headers and title texts refactoring

parent bf9ce514
......@@ -100,6 +100,7 @@ ApplicationWindow {
property int acntListSpacing: defaultMargin * 4
property int formItemVerticalSpacing: defaultMargin
property int formButtonHorizontalSpacing: defaultMargin * 5
property real backMouseAreaRatio: 0.2
/* compare message delivery date with current date-90days */
property int deleteAfterDays: 90
......
......@@ -36,15 +36,13 @@ Item {
PageHeader {
id: headerBar
title: qsTr("About Datovka")
Item {
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
pageView.pop(StackView.Immediate)
}
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
}
} // PageHeader
......
......@@ -48,39 +48,34 @@ Component {
PageHeader {
id: headerBar
title: acntName + " (" + userName + ")" + "\n" + qsTr("Account info")
Item {
title: qsTr("Account info")
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
pageView.pop(StackView.Immediate)
}
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
statusBar.visible = false
pageView.pop(StackView.Immediate)
}
}
Row {
Image {
id: actionButton
anchors.verticalCenter: parent.verticalCenter
spacing: defaultMargin
anchors.right: parent.right
anchors.rightMargin: defaultMargin
Image {
id: actionButton
anchors.verticalCenter: parent.verticalCenter
sourceSize.height: imgHeight
source: "qrc:/ui/sync.svg"
MouseArea {
anchors.fill: parent
onClicked: {
isds.doIsdsAction("getAccountInfo", userName)
}
sourceSize.height: imgHeight
source: "qrc:/ui/sync.svg"
MouseArea {
anchors.fill: parent
onClicked: {
isds.doIsdsAction("getAccountInfo", userName)
}
Connections {
target: isds
onRunGetAccountInfoSig: {
isds.getAccountInfo(userName)
}
}
Connections {
target: isds
onRunGetAccountInfoSig: {
isds.getAccountInfo(userName)
}
}
}
......
......@@ -60,16 +60,14 @@ Item {
PageHeader {
id: headerBar
title: acntName + " (" + userName + ")" + "\n" + qsTr("Change password")
Item {
title: qsTr("Change password") + ": " + userName
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
pageView.pop(StackView.Immediate)
}
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
}
Row {
......
......@@ -65,17 +65,15 @@ Item {
}
PageHeader {
id: headerBar
title: qsTr("Contacts") + " (" + userName + ")"
Item {
title: qsTr("Contacts")
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
statusBar.visible = false
pageView.pop(StackView.Immediate)
}
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
statusBar.visible = false
pageView.pop(StackView.Immediate)
}
}
TextField {
......
......@@ -48,16 +48,14 @@ Component {
}
PageHeader {
id: headerBar
title: qsTr("Databox info") + " (" + dbID + ")"
Item {
title: qsTr("Databox info")
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
pageView.pop(StackView.Immediate)
}
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
}
} // PageHeader
......
......@@ -73,16 +73,14 @@ Item {
PageHeader {
id: headerBar
title: qsTr("Find databox")
Item {
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
statusBar.visible = false
pageView.pop(StackView.Immediate)
}
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
statusBar.visible = false
pageView.pop(StackView.Immediate)
}
}
Image {
......
This diff is collapsed.
......@@ -41,16 +41,14 @@ Component {
PageHeader {
id: headerBar
title: qsTr("Datovka settings")
Item {
title: qsTr("Settings")
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
pageView.pop(StackView.Immediate)
}
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
}
}
......
......@@ -52,22 +52,14 @@ Component {
}
PageHeader {
id: headerBar
title: {
var str = qsTr("Sent message");
if (msgType == MessageType.TYPE_RECEIVED) {
str = qsTr("Received message")
}
return str + " " + msgId + "\n" + qsTr("Message operations")
}
Item {
title: qsTr("Message") + ": " + msgId
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
pageView.pop(StackView.Immediate)
}
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
}
}
......
......@@ -48,22 +48,14 @@ Component {
PageHeader {
id: headerBar
title: {
var str = qsTr("Sent message");
if (msgType == MessageType.TYPE_RECEIVED) {
str = qsTr("Received message")
}
return str + " " + msgId + "\n" + qsTr("Message operations")
}
Item {
title: qsTr("Message") + ": " + msgId
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
pageView.pop(StackView.Immediate)
}
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
}
}
......
......@@ -50,7 +50,7 @@ Component {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * 0.2
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
......
......@@ -120,43 +120,32 @@ Component {
PageHeader {
id: headerBar
title: {
var str1 = "";
var str2 = "";
if (fromLocalDb) {
str1 += acntName + " (" + userName + ")"
} else if (zfoType == MsgInfo.TYPE_MESSAGE) {
str1 += qsTr("Message from ZFO")
} else if (zfoType == MsgInfo.TYPE_DELIVERY_INFO) {
str1 += qsTr("Delivery info from ZFO")
} else {
str1 += qsTr("Unknown ZFO content")
}
var str = "";
if (fromLocalDb && (msgType == MessageType.TYPE_RECEIVED)) {
str2 += qsTr("Received message") + " " + zfoId
str += qsTr("Received message") + ": " + zfoId
} else if (fromLocalDb && (msgType == MessageType.TYPE_SENT)) {
str2 += qsTr("Sent message") + " " + zfoId
str += qsTr("Sent message") + ": " + zfoId
} else if (zfoType == MsgInfo.TYPE_MESSAGE) {
str += qsTr("ZFO Message") + ": " + zfoId
} else if (zfoType == MsgInfo.TYPE_DELIVERY_INFO) {
str += qsTr("ZFO Delivery info") + ": " + zfoId
} else if (zfoType != MsgInfo.TYPE_UNKNOWN) {
str2 += qsTr("Message ID") + " " + zfoId
str += qsTr("Message ID") + ": " + zfoId
} else {
str2 += "" /* Empty string. */
str += qsTr("Unknown ZFO content")
}
if (str2 === "") {
return str1
}
return str1 + "\n" + str2
return str
}
Item {
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
if (typeof(statusBar) != "undefined") {
statusBar.visible = false
}
pageView.pop()
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
if (typeof(statusBar) != "undefined") {
statusBar.visible = false
}
pageView.pop()
}
}
Row {
......
......@@ -85,7 +85,7 @@ Component {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * 0.2
width: parent.width * backMouseAreaRatio
onClicked: {
accounts.updateNewMessageCounter(accountModel, userName)
statusBar.visible = false
......
......@@ -52,16 +52,14 @@ Item {
PageHeader {
id: headerBar
title: qsTr("Search message")
Item {
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
statusBar.visible = false
pageView.pop(StackView.Immediate)
}
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
statusBar.visible = false
pageView.pop(StackView.Immediate)
}
}
Row {
......
......@@ -131,7 +131,7 @@ Item {
dmAllowSubstDelivery.visible = boxEffectiveOVM
if (action === "new") {
initPDZ.visible = !boxEffectiveOVM
headerBar.title = qsTr("Create message") + " (" + userName + ")"
headerBar.title = qsTr("New message")
} else if (action === "reply") {
setReplyData(userName, msgId)
} else if (action === "template") {
......@@ -186,16 +186,14 @@ Item {
PageHeader {
id: headerBar
title: qsTr("Create message")
Item {
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
statusBar.visible = false
pageView.pop(StackView.Immediate)
}
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
statusBar.visible = false
pageView.pop(StackView.Immediate)
}
}
OverlaidImage {
......
......@@ -66,16 +66,14 @@ Item {
PageHeader {
id: headerBar
title: qsTr("Add a new account")
Item {
title: qsTr("New account")
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
pageView.pop(StackView.Immediate)
}
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
}
Row {
......@@ -344,7 +342,7 @@ Item {
loginMethodComboBox.currentIndex = loginMethod
userNameTextField.enabled = false
testAccount.enabled = false
headerBar.title = qsTr("Account settings") + ": "+ userName
headerBar.title = qsTr("Account settings")
}
} // Connection
} // Column layout
......
......@@ -48,16 +48,14 @@ Item {
PageHeader {
id: headerBar
title: qsTr("General settings")
Item {
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
settings.saveAllSettings(accountModel)
pageView.pop(StackView.Immediate)
}
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
settings.saveAllSettings(accountModel)
pageView.pop(StackView.Immediate)
}
}
} // PageHeader
......
......@@ -119,12 +119,12 @@ Item {
PageHeader {
id: headerBar
title: qsTr("PIN Settings")
Item {
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
onClicked: {
if (actionName != "unspecified") {
/* Navigate to initial action. */
......
......@@ -52,19 +52,17 @@ Item {
PageHeader {
id: headerBar
title: qsTr("Storage settings")
Item {
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
settings.saveAllSettings(accountModel)
if (currentZfoSize > zfoDbSizeSpinBox.value) {
zfo.reduceZfoDbSize(currentZfoSize-zfoDbSizeSpinBox.value);
}
pageView.pop(StackView.Immediate)
}
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
settings.saveAllSettings(accountModel)
if (currentZfoSize > zfoDbSizeSpinBox.value) {
zfo.reduceZfoDbSize(currentZfoSize-zfoDbSizeSpinBox.value);
}
pageView.pop(StackView.Immediate)
}
}
} // PageHeader
......
......@@ -41,16 +41,14 @@ Item {
PageHeader {
id: headerBar
title: qsTr("Synchronization settings")
Item {
MouseArea {
anchors.left: parent.left
width: parent.width * 0.5
height: parent.height
MouseArea {
anchors.fill: parent
onClicked: {
settings.saveAllSettings(accountModel)
pageView.pop(StackView.Immediate)
}
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
settings.saveAllSettings(accountModel)
pageView.pop(StackView.Immediate)
}
}
} // PageHeader
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment