diff options
author | Caroline Chao <caroline.chao@digia.com> | 2014-10-13 16:04:41 +0200 |
---|---|---|
committer | Caroline Chao <caroline.chao@digia.com> | 2014-10-15 15:23:29 +0200 |
commit | d96a2ad916ea85488834e21c3848b63727380473 (patch) | |
tree | 0cad477fe702c1bc4d7689ece91883d1acf5a77f | |
parent | f4c0babcfad9b14b706dc4571c342be2319097b5 (diff) |
Replace location icon by back and home text
Display "home" when page opened is not an event/feedback or floorplan
or if the poped page would be the home page (page depth equal to two).
Location.svg is not used anymore, removing it.
Change-Id: I990d330a61e3f58392b8077c4f073044df7399be
Reviewed-by: Niels Weber <niels.weber@digia.com>
-rw-r--r-- | qml/components/ConferenceHeader.qml | 83 | ||||
-rw-r--r-- | qml/components/images/Location.svg | 12 | ||||
-rw-r--r-- | resource.qrc | 1 | ||||
-rw-r--r-- | src/theme.cpp | 1 |
4 files changed, 23 insertions, 74 deletions
diff --git a/qml/components/ConferenceHeader.qml b/qml/components/ConferenceHeader.qml index b79c849..798e2f5 100644 --- a/qml/components/ConferenceHeader.qml +++ b/qml/components/ConferenceHeader.qml @@ -62,84 +62,46 @@ Item { anchors.margins: Theme.margins.ten Item { Layout.preferredHeight: topicRect.height - Layout.preferredWidth: topicRect.height + Layout.fillWidth: true MouseArea { id: mouseAreaBack anchors.fill: parent - enabled: !!stack.currentItem && (stack.currentItem.objectName === "event" || - stack.currentItem.objectName === "feedback") - onClicked: stack.pop() + property bool isBackImageOnly: !!stack.currentItem && (stack.currentItem.objectName === "event" || + stack.currentItem.objectName === "feedback" || + stack.currentItem.objectName === "floorPlan") && stack.depth > 2 + enabled: stack.depth > 1 + onClicked: { + if (mouseAreaBack.isBackImageOnly) + stack.pop() + else + stack.pop(stack.find(function(item){ return item.objectName === "homeScreen" })) + } Rectangle { anchors.fill: parent anchors.margins: Theme.margins.five color: mouseAreaBack.pressed ? Theme.colors.smokewhite : Theme.colors.white - visible: stack.depth > 1 radius: 5 } Image { id: backButton + visible: stack.depth > 1 anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter anchors.leftMargin: Theme.margins.twenty - opacity: (stack.depth > 1 && (!!stack.currentItem && - (stack.currentItem.objectName === "event" || - stack.currentItem.objectName === "feedback" - ))) ? 1 : 0 - Behavior on opacity { PropertyAnimation{} } height: Theme.sizes.backHeight width: Theme.sizes.backWidth sourceSize.height: Theme.sizes.backHeight sourceSize.width: Theme.sizes.backWidth source: Theme.images.back } - } - - Item { - id: locationArea - anchors.fill: parent - - Item { - id: locationButton - anchors.left: parent.left + Text { + anchors.left: backButton.right + anchors.leftMargin: Theme.margins.ten anchors.verticalCenter: parent.verticalCenter - opacity: (!!stack.currentItem && stack.currentItem.objectName !== "event" && - stack.currentItem.objectName !== "feedback" && - applicationClient.currentConferenceId !== "") ? 1 : 0 - Behavior on opacity { PropertyAnimation{} } - - Image { - id: locationImage - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: Theme.margins.ten - sourceSize.height: Theme.sizes.menuHeight - sourceSize.width: Theme.sizes.menuWidth - source: Theme.images.location - } - - Text { - id: locationLabel - anchors.left: locationImage.right - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: Theme.margins.ten - text: applicationClient.currentConferenceDetails.location - font.pointSize: Theme.fonts.ten_pt - font.capitalization: Font.AllUppercase - font.weight: Font.DemiBold - color: Theme.colors.gray - Layout.fillWidth: false - Layout.alignment: Text.AlignVCenter | Text.AlignHCenter - - } - } - - MouseArea { - anchors.fill: parent - enabled: !!stack.currentItem && (stack.currentItem.objectName !== "event" && - stack.currentItem.objectName !== "feedback") - onClicked: { - stack.pop(stack.find(function(item){ return item.objectName === "homeScreen" })) - } + text: Theme.text.home.arg("") + color: Theme.colors.gray + font.pointSize: Theme.fonts.eight_pt + visible: stack.depth > 1 && !mouseAreaBack.isBackImageOnly } } } @@ -156,7 +118,7 @@ Item { MouseArea { id: mouseAreaMenu Layout.alignment: Qt.AlignRight - Layout.preferredWidth: topicRect.height + Layout.fillWidth: true Layout.preferredHeight: topicRect.height onClicked: showMenu() enabled: ModelsSingleton.conferenceId !== "" @@ -169,8 +131,9 @@ Item { Image { id: dropMenu visible: mouseAreaMenu.enabled - anchors.centerIn: parent - Layout.alignment: Qt.AlignRight + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: Theme.margins.twenty height: Theme.sizes.menuHeight width: Theme.sizes.menuWidth source: Theme.images.menu diff --git a/qml/components/images/Location.svg b/qml/components/images/Location.svg deleted file mode 100644 index 2c2483d..0000000 --- a/qml/components/images/Location.svg +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" - width="62px" height="84px" viewBox="0 0 62 84" enable-background="new 0 0 62 84" xml:space="preserve"> -<g> - <path fill="#808080" d="M52.916,9.078c-12.104-12.104-31.734-12.104-43.842,0C-2.902,21.059-3.021,40.397,8.703,52.529 - l22.332,30.953L53.52,52.318h-0.031C65.011,40.174,64.825,20.989,52.916,9.078z M43.018,43.021c-6.64,6.64-17.402,6.64-24.042,0 - s-6.64-17.402,0-24.042c6.64-6.642,17.402-6.642,24.042,0C49.656,25.619,49.656,36.382,43.018,43.021z"/> - <rect fill="none" width="62" height="84"/> -</g> -</svg> diff --git a/resource.qrc b/resource.qrc index a20d803..04a26e6 100644 --- a/resource.qrc +++ b/resource.qrc @@ -29,7 +29,6 @@ <file alias="images/NoRating.svg">qml/components/images/NoRating.svg</file> <file alias="images/anonymous.svg">qml/components/images/anonymous.svg</file> <file alias="images/icon-loading.svg">qml/components/images/icon-loading.svg</file> - <file alias="images/Location.svg">qml/components/images/Location.svg</file> <file alias="images/Twitter.svg">qml/components/images/Twitter.svg</file> <file alias="images/LevelA.svg">qml/components/images/LevelA.svg</file> <file alias="images/LevelB.svg">qml/components/images/LevelB.svg</file> diff --git a/src/theme.cpp b/src/theme.cpp index e0be59f..81b1e4b 100644 --- a/src/theme.cpp +++ b/src/theme.cpp @@ -146,7 +146,6 @@ Theme::Theme(QObject *parent) m_images->insert(QLatin1String("noRating"), QVariant("qrc:/images/NoRating.svg")); m_images->insert(QLatin1String("loading"), QVariant("qrc:/images/icon-loading.svg")); m_images->insert(QLatin1String("anonymous"), QVariant("qrc:/images/anonymous.svg")); - m_images->insert(QLatin1String("location"), QVariant("qrc:/images/Location.svg")); m_images->insert(QLatin1String("twitter"), QVariant("qrc:/images/Twitter.svg")); m_images->insert(QLatin1String("levelA"), QVariant("qrc:/images/LevelA.svg")); m_images->insert(QLatin1String("levelB"), QVariant("qrc:/images/LevelB.svg")); |