Commit 2b303e3c authored by Karel Slaný's avatar Karel Slaný

Exposed back button from header bar to accessibility interface.

The page header emits a signal when back button is pressed.
parent fc056d31
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -28,14 +28,19 @@ import QtQuick 2.7
*/
Rectangle {
id: root
/* These properties must be set by caller. */
property string title: ""
signal backClicked()
anchors.top: parent.top
width: parent.width
height: headerHeight
color: headerColor
z: 1
Image {
id: backElement
id: backIcon
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: defaultMargin
......@@ -43,13 +48,32 @@ Rectangle {
source: "qrc:/ui/back.svg"
}
Text {
id: backText
anchors.verticalCenter: parent.verticalCenter
anchors.left: backElement.right
anchors.left: backIcon.right
anchors.leftMargin: defaultMargin
//font.bold: true
color: datovkaPalette.text
text: qsTr("Back")
}
MouseArea {
function handleClick() {
backClicked()
}
anchors.left: backIcon.left
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: backText.right
Accessible.role: Accessible.Button
Accessible.name: backText.text
Accessible.onPressAction: {
handleClick()
}
onClicked: {
handleClick()
}
}
Text {
anchors.centerIn: parent
font.bold: true
......
......@@ -100,7 +100,6 @@ 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
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -36,16 +36,10 @@ Item {
PageHeader {
id: headerBar
title: qsTr("About Datovka")
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
onBackClicked: {
pageView.pop(StackView.Immediate)
}
} // PageHeader
}
Flickable {
id: flickable
z: 0
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -53,14 +53,8 @@ Component {
PageHeader {
id: headerBar
title: qsTr("Account info")
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
onBackClicked: {
pageView.pop(StackView.Immediate)
}
Image {
id: actionButton
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -61,14 +61,8 @@ Item {
PageHeader {
id: headerBar
title: qsTr("Change password") + ": " + userName
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
onBackClicked: {
pageView.pop(StackView.Immediate)
}
Row {
anchors.verticalCenter: parent.verticalCenter
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -73,14 +73,8 @@ Item {
PageHeader {
id: headerBar
title: qsTr("Contacts")
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
onBackClicked: {
pageView.pop(StackView.Immediate)
}
Row {
anchors.verticalCenter: parent.verticalCenter
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -49,16 +49,10 @@ Component {
PageHeader {
id: headerBar
title: qsTr("Databox info")
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
onBackClicked: {
pageView.pop(StackView.Immediate)
}
} // PageHeader
}
Flickable {
id: flickable
z: 0
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -78,14 +78,8 @@ Item {
PageHeader {
id: headerBar
title: qsTr("Find databox")
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
onBackClicked: {
pageView.pop(StackView.Immediate)
}
Row {
anchors.verticalCenter: parent.verticalCenter
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -41,14 +41,8 @@ Component {
PageHeader {
id: headerBar
title: qsTr("Account properties")
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
onBackClicked: {
pageView.pop(StackView.Immediate)
}
}
ListModel {
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -47,14 +47,8 @@ Component {
PageHeader {
id: headerBar
title: qsTr("Settings")
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
onBackClicked: {
pageView.pop(StackView.Immediate)
}
}
ListModel {
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -49,15 +49,9 @@ Component {
}
PageHeader {
id: headerBar
title: qsTr("Message") + ": " + msgId
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
title: qsTr("Message") + ": " + msgId
onBackClicked: {
pageView.pop(StackView.Immediate)
}
}
ListModel {
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -53,15 +53,9 @@ Component {
PageHeader {
id: headerBar
title: qsTr("Message") + ": " + msgId
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
title: qsTr("Message") + ": " + msgId
onBackClicked: {
pageView.pop(StackView.Immediate)
}
}
ListModel {
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -43,14 +43,8 @@ Component {
PageHeader {
id: headerBar
title: qsTr("Message operations")
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
onBackClicked: {
pageView.pop(StackView.Immediate)
}
}
ListModel {
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -135,17 +135,11 @@ Component {
}
return str
}
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
if (typeof(statusBar) != "undefined") {
statusBar.visible = false
}
pageView.pop()
onBackClicked: {
if (typeof(statusBar) != "undefined") {
statusBar.visible = false
}
pageView.pop()
}
Row {
anchors.verticalCenter: parent.verticalCenter
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -86,14 +86,8 @@ Component {
PageHeader {
id: headerBar
title: (msgType == MessageType.TYPE_RECEIVED) ? qsTr("Received messages") : qsTr("Sent messages");
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop()
}
onBackClicked: {
pageView.pop()
}
Row {
anchors.verticalCenter: parent.verticalCenter
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -58,14 +58,8 @@ Item {
PageHeader {
id: headerBar
title: qsTr("Search message")
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
onBackClicked: {
pageView.pop(StackView.Immediate)
}
Row {
anchors.verticalCenter: parent.verticalCenter
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -191,14 +191,8 @@ Item {
PageHeader {
id: headerBar
title: qsTr("Create message")
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
onBackClicked: {
pageView.pop(StackView.Immediate)
}
OverlaidImage {
id: actionButton
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -68,14 +68,8 @@ Item {
PageHeader {
id: headerBar
title: qsTr("New account")
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
onBackClicked: {
pageView.pop(StackView.Immediate)
}
Row {
anchors.verticalCenter: parent.verticalCenter
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -53,16 +53,10 @@ Item {
PageHeader {
id: headerBar
title: qsTr("General settings")
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
onBackClicked: {
pageView.pop(StackView.Immediate)
}
} // PageHeader
}
Flickable {
id: flickable
z: 0
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -119,20 +119,12 @@ Item {
PageHeader {
id: headerBar
title: qsTr("PIN Settings")
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
onClicked: {
if (actionName != "unspecified") {
/* Navigate to initial action. */
actionName = "unspecified"
} else {
pageView.pop(StackView.Immediate)
}
}
onBackClicked: {
if (actionName != "unspecified") {
/* Navigate to initial action. */
actionName = "unspecified"
} else {
pageView.pop(StackView.Immediate)
}
}
Row {
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -60,16 +60,10 @@ Item {
PageHeader {
id: headerBar
title: qsTr("Storage settings")
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
onBackClicked: {
pageView.pop(StackView.Immediate)
}
} // PageHeader
}
Flickable {
id: flickable
z: 0
......
/*
* Copyright (C) 2014-2017 CZ.NIC
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -46,16 +46,10 @@ Item {
PageHeader {
id: headerBar
title: qsTr("Synchronization settings")
MouseArea {
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
width: parent.width * backMouseAreaRatio
onClicked: {
pageView.pop(StackView.Immediate)
}
onBackClicked: {
pageView.pop(StackView.Immediate)
}
} // PageHeader
}
Flickable {
id: flickable
z: 0
......
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