diff options
author | abcd <amos.choy@nokia.com> | 2012-01-16 15:48:37 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-17 04:51:11 +0100 |
commit | 965d68ebddc3e69c7d2489f03adce0593c9acf80 (patch) | |
tree | 43b560d606e77a710148cb331d1484ab2c49d759 /examples | |
parent | a9506a1c73ada80262157ae4736a16cbc0fcb435 (diff) | |
download | qtlocation-965d68ebddc3e69c7d2489f03adce0593c9acf80.tar.gz |
Update example look and feel
Change-Id: I95420b774e6ca18b47540fb4cc768522032672d3
Reviewed-by: Natalia Shubina <natalia.shubina@nokia.com>
Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'examples')
33 files changed, 78 insertions, 49 deletions
diff --git a/examples/declarative/common/common.qrc b/examples/declarative/common/common.qrc index 67d3b40e..a90ec581 100644 --- a/examples/declarative/common/common.qrc +++ b/examples/declarative/common/common.qrc @@ -16,12 +16,10 @@ <file>imports/QtLocation/examples/components/TitleBar.qml</file> <file>imports/QtLocation/examples/dialogs/Dialog.qml</file> <file>resources/busy.png</file> - <file>resources/button_hovered.png</file> <file>resources/button_pressed.png</file> <file>resources/button.png</file> <file>resources/button.sci</file> <file>resources/catch.png</file> - <file>resources/categories_hovered.png</file> <file>resources/categories_pressed.png</file> <file>resources/categories.png</file> <file>resources/checkbox_selected.png</file> @@ -29,11 +27,9 @@ <file>resources/cross_hovered.png</file> <file>resources/cross_pressed.png</file> <file>resources/cross.png</file> - <file>resources/hmenuItem_hovered.png</file> <file>resources/hmenuItem_pressed.png</file> <file>resources/hmenuItem.png</file> <file>resources/hmenuItem.sci</file> - <file>resources/left_hovered.png</file> <file>resources/left_pressed.png</file> <file>resources/left.png</file> <file>resources/marker_hovered.png</file> @@ -53,12 +49,10 @@ <file>resources/quit_hovered.png</file> <file>resources/quit_pressed.png</file> <file>resources/quit.png</file> - <file>resources/right_hovered.png</file> <file>resources/right_pressed.png</file> <file>resources/right.png</file> <file>resources/scale_end.png</file> <file>resources/scale.png</file> - <file>resources/search_hovered.png</file> <file>resources/search_pressed.png</file> <file>resources/search.png</file> <file>resources/star.png</file> diff --git a/examples/declarative/common/imports/QtLocation/examples/components/Button.qml b/examples/declarative/common/imports/QtLocation/examples/components/Button.qml index 29a0f1dc..5eba690c 100644 --- a/examples/declarative/common/imports/QtLocation/examples/components/Button.qml +++ b/examples/declarative/common/imports/QtLocation/examples/components/Button.qml @@ -81,7 +81,7 @@ Item { id: buttonText color: checked ? "lawngreen" : "white" anchors.centerIn: buttonImage; font.bold: true; font.pixelSize: 14 - style: Text.Raised; styleColor: "darkblue" + style: Text.Normal anchors.baseline: parent.bottom anchors.baselineOffset: -6 } @@ -91,7 +91,6 @@ Item { name: "Pressed" when: mouseRegion.pressed == true PropertyChanges { target: buttonImage; source: style.pressedBackground } - PropertyChanges { target: buttonText; style: Text.Sunken } }, State { name: "Hovered" @@ -101,7 +100,7 @@ Item { State { name: "Disabled" when: !enabled - PropertyChanges{ target: buttonText; color: "silver" } + PropertyChanges{ target: buttonText; color: "dimgray" } PropertyChanges{ target: mouseRegion; enabled: false } } ] diff --git a/examples/declarative/common/imports/QtLocation/examples/components/Menu.qml b/examples/declarative/common/imports/QtLocation/examples/components/Menu.qml index 3c35d6b5..0e4e820d 100644 --- a/examples/declarative/common/imports/QtLocation/examples/components/Menu.qml +++ b/examples/declarative/common/imports/QtLocation/examples/components/Menu.qml @@ -51,7 +51,7 @@ Grid { property string exclusiveButton: "" property bool exclusive: false property bool autoWidth: false - opacity: 0.9 + opacity: 1 rows: (horizontalOrientation) ? 1 : children.length columns: (horizontalOrientation) ? children.length : 1 signal clicked(string button) diff --git a/examples/declarative/common/imports/QtLocation/examples/components/style/ButtonStyle.qml b/examples/declarative/common/imports/QtLocation/examples/components/style/ButtonStyle.qml index 1bd35ca3..0998eae9 100644 --- a/examples/declarative/common/imports/QtLocation/examples/components/style/ButtonStyle.qml +++ b/examples/declarative/common/imports/QtLocation/examples/components/style/ButtonStyle.qml @@ -43,7 +43,7 @@ QtObject { id: buttonStyle property string background: "../../../../resources/button.sci" property string pressedBackground: "../../../../resources/button_pressed.png" - property string disabledBackground: "../../../../resources/button_hovered.png" + property string disabledBackground: "../../../../resources/button.png" property int heightAdjustment: 0 property int yAdjustment: 0 } diff --git a/examples/declarative/common/imports/QtLocation/examples/components/style/HMenuItemStyle.qml b/examples/declarative/common/imports/QtLocation/examples/components/style/HMenuItemStyle.qml index 8985898f..0e446932 100644 --- a/examples/declarative/common/imports/QtLocation/examples/components/style/HMenuItemStyle.qml +++ b/examples/declarative/common/imports/QtLocation/examples/components/style/HMenuItemStyle.qml @@ -41,9 +41,9 @@ import QtQuick 2.0 ButtonStyle { - background: "../../../../resources/hmenuItem.sci" + background: "../../../../resources/hmenuItem.png" pressedBackground: "../../../../resources/hmenuItem_pressed.png" - disabledBackground: "../../../../resources/hmenuItem_hovered.png" + disabledBackground: "../../../../resources/hmenuItem.png" heightAdjustment: 14 yAdjustment: -7 } diff --git a/examples/declarative/common/imports/QtLocation/examples/dialogs/Dialog.qml b/examples/declarative/common/imports/QtLocation/examples/dialogs/Dialog.qml index ada67f2e..b775f9a7 100644 --- a/examples/declarative/common/imports/QtLocation/examples/dialogs/Dialog.qml +++ b/examples/declarative/common/imports/QtLocation/examples/dialogs/Dialog.qml @@ -70,7 +70,7 @@ Item { Rectangle { id: dialogRectangle - color: "white" + color: "#ECECEC" opacity: parent.opacity width: parent.width - gap; height: listview.height + titleBar.height + buttons.height + gap*1.5 @@ -119,9 +119,7 @@ Item { Rectangle { id: dataRect - color: "#C0DCFF" - border.width: 1 - border.color: "dodgerblue" + color: "#ECECEC" radius: 5 width:dialogRectangle.width - gap height: listview.height// + gap diff --git a/examples/declarative/common/resources/button.png b/examples/declarative/common/resources/button.png Binary files differindex 18d9a84d..1e3e752c 100644 --- a/examples/declarative/common/resources/button.png +++ b/examples/declarative/common/resources/button.png diff --git a/examples/declarative/common/resources/button_hovered.png b/examples/declarative/common/resources/button_hovered.png Binary files differdeleted file mode 100644 index 0f228f83..00000000 --- a/examples/declarative/common/resources/button_hovered.png +++ /dev/null diff --git a/examples/declarative/common/resources/button_pressed.png b/examples/declarative/common/resources/button_pressed.png Binary files differindex 0a91912d..21d9835f 100644 --- a/examples/declarative/common/resources/button_pressed.png +++ b/examples/declarative/common/resources/button_pressed.png diff --git a/examples/declarative/common/resources/categories.png b/examples/declarative/common/resources/categories.png Binary files differindex 5dbf2fae..d1d82c2e 100644 --- a/examples/declarative/common/resources/categories.png +++ b/examples/declarative/common/resources/categories.png diff --git a/examples/declarative/common/resources/categories_hovered.png b/examples/declarative/common/resources/categories_hovered.png Binary files differdeleted file mode 100644 index b2405927..00000000 --- a/examples/declarative/common/resources/categories_hovered.png +++ /dev/null diff --git a/examples/declarative/common/resources/categories_pressed.png b/examples/declarative/common/resources/categories_pressed.png Binary files differindex 375fbe38..965e0ad7 100644 --- a/examples/declarative/common/resources/categories_pressed.png +++ b/examples/declarative/common/resources/categories_pressed.png diff --git a/examples/declarative/common/resources/hmenuItem.png b/examples/declarative/common/resources/hmenuItem.png Binary files differindex 42f565a2..d5da8a86 100644 --- a/examples/declarative/common/resources/hmenuItem.png +++ b/examples/declarative/common/resources/hmenuItem.png diff --git a/examples/declarative/common/resources/hmenuItem_hovered.png b/examples/declarative/common/resources/hmenuItem_hovered.png Binary files differdeleted file mode 100644 index 6a9a3a98..00000000 --- a/examples/declarative/common/resources/hmenuItem_hovered.png +++ /dev/null diff --git a/examples/declarative/common/resources/hmenuItem_pressed.png b/examples/declarative/common/resources/hmenuItem_pressed.png Binary files differindex f779baf6..7c3f542c 100644 --- a/examples/declarative/common/resources/hmenuItem_pressed.png +++ b/examples/declarative/common/resources/hmenuItem_pressed.png diff --git a/examples/declarative/common/resources/left.png b/examples/declarative/common/resources/left.png Binary files differindex c5eb9739..c0efa646 100644 --- a/examples/declarative/common/resources/left.png +++ b/examples/declarative/common/resources/left.png diff --git a/examples/declarative/common/resources/left_hovered.png b/examples/declarative/common/resources/left_hovered.png Binary files differdeleted file mode 100644 index 374aae2d..00000000 --- a/examples/declarative/common/resources/left_hovered.png +++ /dev/null diff --git a/examples/declarative/common/resources/left_pressed.png b/examples/declarative/common/resources/left_pressed.png Binary files differindex 28cda79d..b4fee456 100644 --- a/examples/declarative/common/resources/left_pressed.png +++ b/examples/declarative/common/resources/left_pressed.png diff --git a/examples/declarative/common/resources/right.png b/examples/declarative/common/resources/right.png Binary files differindex 51773bae..db343b07 100644 --- a/examples/declarative/common/resources/right.png +++ b/examples/declarative/common/resources/right.png diff --git a/examples/declarative/common/resources/right_hovered.png b/examples/declarative/common/resources/right_hovered.png Binary files differdeleted file mode 100644 index 12479ec4..00000000 --- a/examples/declarative/common/resources/right_hovered.png +++ /dev/null diff --git a/examples/declarative/common/resources/right_pressed.png b/examples/declarative/common/resources/right_pressed.png Binary files differindex 07d8c003..111f386b 100644 --- a/examples/declarative/common/resources/right_pressed.png +++ b/examples/declarative/common/resources/right_pressed.png diff --git a/examples/declarative/common/resources/search.png b/examples/declarative/common/resources/search.png Binary files differindex 43b6a88c..6bad5bd7 100644 --- a/examples/declarative/common/resources/search.png +++ b/examples/declarative/common/resources/search.png diff --git a/examples/declarative/common/resources/search_hovered.png b/examples/declarative/common/resources/search_hovered.png Binary files differdeleted file mode 100644 index e1bbc5a3..00000000 --- a/examples/declarative/common/resources/search_hovered.png +++ /dev/null diff --git a/examples/declarative/common/resources/search_pressed.png b/examples/declarative/common/resources/search_pressed.png Binary files differindex 31bd3823..23c92fa3 100644 --- a/examples/declarative/common/resources/search_pressed.png +++ b/examples/declarative/common/resources/search_pressed.png diff --git a/examples/declarative/common/resources/titlebar.png b/examples/declarative/common/resources/titlebar.png Binary files differindex c4689844..5b1d09a1 100644 --- a/examples/declarative/common/resources/titlebar.png +++ b/examples/declarative/common/resources/titlebar.png diff --git a/examples/declarative/common/resources/vmenuItem.png b/examples/declarative/common/resources/vmenuItem.png Binary files differindex 5d60f854..efe37e94 100644 --- a/examples/declarative/common/resources/vmenuItem.png +++ b/examples/declarative/common/resources/vmenuItem.png diff --git a/examples/declarative/mapviewer/mapviewer.qml b/examples/declarative/mapviewer/mapviewer.qml index b2acdbab..d9fd266b 100644 --- a/examples/declarative/mapviewer/mapviewer.qml +++ b/examples/declarative/mapviewer/mapviewer.qml @@ -64,7 +64,7 @@ Item { Menu { id:mainMenu anchors.bottom: parent.bottom - z: backgroundRect.z + 2 + z: backgroundRect.z + 3 Component.onCompleted: { addItem("Tools") diff --git a/examples/declarative/places/content/places/CategoryDelegate.qml b/examples/declarative/places/content/places/CategoryDelegate.qml index f5096781..8e1ffdc1 100644 --- a/examples/declarative/places/content/places/CategoryDelegate.qml +++ b/examples/declarative/places/content/places/CategoryDelegate.qml @@ -102,7 +102,6 @@ Item { visible: model.hasModelChildren source: "../../resources/right.png" - hoveredSource: "../../resources/right_hovered.png" pressedSource: "../../resources/right_pressed.png" onClicked: root.arrowClicked() diff --git a/examples/declarative/places/content/places/OptionsDialog.qml b/examples/declarative/places/content/places/OptionsDialog.qml index b7e59b23..a7078707 100644 --- a/examples/declarative/places/content/places/OptionsDialog.qml +++ b/examples/declarative/places/content/places/OptionsDialog.qml @@ -60,7 +60,7 @@ Item { Rectangle { id: dialogRectangle - color: "white" + color: "#ECECEC" opacity: 1 width: parent.width - gap height: titleBar.height + options.height + gap * 1.5 diff --git a/examples/declarative/places/content/places/SearchBox.qml b/examples/declarative/places/content/places/SearchBox.qml index ecbd8fd3..fd79008e 100644 --- a/examples/declarative/places/content/places/SearchBox.qml +++ b/examples/declarative/places/content/places/SearchBox.qml @@ -47,6 +47,8 @@ Rectangle { property bool suggestionsEnabled: true + color: "#ECECEC" + height: searchBox.height + 20 Behavior on height { NumberAnimation { duration: 250 } @@ -100,8 +102,9 @@ Rectangle { IconButton { id: searchButton + anchors.verticalCenter: parent.verticalCenter + source: "../../resources/search.png" - hoveredSource: "../../resources/search_hovered.png" pressedSource: "../../resources/search_pressed.png" onClicked: { @@ -114,7 +117,6 @@ Rectangle { id: categoryButton source: "../../resources/categories.png" - hoveredSource: "../../resources/categories_hovered.png" pressedSource: "../../resources/categories_pressed.png" onClicked: { @@ -148,7 +150,6 @@ Rectangle { //! [CategoryModel view 2] header: IconButton { source: "../../resources/left.png" - hoveredSource: "../../resources/left_hovered.png" pressedSource: "../../resources/left_pressed.png" onClicked: categoryListModel.rootIndex = categoryListModel.parentModelIndex() diff --git a/examples/declarative/places/content/places/SearchResultDelegate.qml b/examples/declarative/places/content/places/SearchResultDelegate.qml index c9c13e99..4c366d06 100644 --- a/examples/declarative/places/content/places/SearchResultDelegate.qml +++ b/examples/declarative/places/content/places/SearchResultDelegate.qml @@ -73,41 +73,79 @@ Item { Text { id: placeName; text: place.favorite ? place.favorite.name : place.name } } - Text { text: distance + "m" } + Text { id: distanceText; text: distance + "m"; font.italic: true; font.pointSize: placeName.font.pointSize * 0.8 } } + + MouseArea { + anchors.fill: parent + + onPressed: placeRoot.state = "Pressed" + onReleased: placeRoot.state = "" + onCanceled: placeRoot.state = "" + + onClicked: { + if (model.type === undefined || type === PlaceSearchModel.PlaceResult) { + if (!place.detailsFetched) + place.getDetails(); + + root.displayPlaceDetails({ + distance: model.distance, + place: model.place, + }); + } + } + } + + states: [ + State { + name: "" + }, + State { + name: "Pressed" + PropertyChanges { target: placeName; color: "#1C94FC"} + PropertyChanges { target: distanceText; color: "#1C94FC"} + } + ] } } //! [PlaceSearchModel place delegate] Component { id: correctionComponent + Item { + id: correctionRoot - Text { - width: parent.width - text: "Did you mean " + correction + "?" - } - } + Text { + id: correctionText + width: parent.width + text: "Did you mean " + correction + "?" - Loader { - anchors.left: parent.left - anchors.right: parent.right + MouseArea { + anchors.fill: parent - MouseArea { - anchors.fill: parent - onClicked: { - if (model.type === undefined || type === PlaceSearchModel.PlaceResult) { - if (!place.detailsFetched) - place.getDetails(); + onPressed: correctionRoot.state = "Pressed" + onReleased: correctionRoot.state = "" + onCanceled: correctionRoot.state = "" - root.displayPlaceDetails({ - distance: model.distance, - place: model.place, - }); - } else if (type === PlaceSearchModel.CorrectionResult) { - searchFor(correction); + onClicked: root.searchFor(correction); } } + + states: [ + State { + name: "" + }, + State { + name: "Pressed" + PropertyChanges { target: correctionText; color: "#1C94FC"} + } + ] } + } + + Loader { + anchors.left: parent.left + anchors.right: parent.right sourceComponent: (model.type === undefined || model.type === PlaceSearchModel.PlaceResult) ? placeComponent : correctionComponent } diff --git a/examples/declarative/places/content/places/SearchResultView.qml b/examples/declarative/places/content/places/SearchResultView.qml index 7a55bb6f..44e22840 100644 --- a/examples/declarative/places/content/places/SearchResultView.qml +++ b/examples/declarative/places/content/places/SearchResultView.qml @@ -83,7 +83,7 @@ Item { anchors.fill: parent - spacing: 5 + spacing: 20 model: placeSearchModel delegate: SearchResultDelegate { @@ -92,6 +92,8 @@ Item { placeDetails.distance = data.distance; view.currentIndex = 1; } + + onSearchFor: placeSearchModel.searchForText(query); } } //! [PlaceSearchModel place list] @@ -123,9 +125,9 @@ Item { IconButton { id: placeBackButton + anchors.left: parent.left source: "../../resources/left.png" - hoveredSource: "../../resources/left_hovered.png" pressedSource: "../../resources/left_pressed.png" onClicked: view.showSearchResults() @@ -189,7 +191,6 @@ Item { id: contentListBackButton source: "../../resources/left.png" - hoveredSource: "../../resources/left_hovered.png" pressedSource: "../../resources/left_pressed.png" onClicked: view.currentIndex = 1 @@ -220,7 +221,6 @@ Item { id: contentBackButton source: "../../resources/left.png" - hoveredSource: "../../resources/left_hovered.png" pressedSource: "../../resources/left_pressed.png" onClicked: { diff --git a/examples/declarative/places/places.qml b/examples/declarative/places/places.qml index 973099e9..9e5a8ff8 100644 --- a/examples/declarative/places/places.qml +++ b/examples/declarative/places/places.qml @@ -461,7 +461,7 @@ Item { width: parent.width - catchImage.width height: parent.height - color: "white" + color: "#ECECEC" radius: 5 SearchResultView { |