I have made the following changes intended for : CE:MW:Shared / qt-components
Please review and accept or decline. BOSS has already run some checks on this request. See the "Messages from BOSS" section below. https://build.pub.meego.com//request/show/6781 Thank You, Marko Saukko [This message was auto-generated] --- Request # 6781: Messages from BOSS: State: review at 2012-09-25T12:52:55 by bossbot Reviews: accepted by bossbot : Prechecks succeeded. new for CE-maintainers : Please replace this text with a review and approve/reject the review (not the SR). BOSS will take care of the rest Changes: submit: Project:MTF:MW / qt-components -> CE:MW:Shared / qt-components changes files: -------------- --- qt-components.changes +++ qt-components.changes @@ -0,0 +1,11 @@ +* Mon Sep 24 2012 Robin Burchell <[email protected]> - 1.4.1 +- Fix surrendering of TextArea when clicked outside (from John) +- Hide toolbar shadows when the toolbar is not visible (from John) +- Avoid unnecessary layouts in ToolBarLayout (from John) +- Fixes NEMO#272: {Multi}SelectionDialog doesn't work with C++ model out of the box (from Robin & John) +- drop qt-components-1.3git20120215-1-fix-defines.patch (upstreamed, by Robin) +- Fixes NEM#302: implement PageHeader component (from Robin) +- Add PageStack::openSheet() and openDialog() convenience APIs (from Robin) +- Only set DialogStatus.Closed when Dialog is really, totally gone and closed (from Robin) +- Sync Utils.js with extras/Utils.js (from Robin) + old: ---- qt-components-1.3git20120215-1-fix-defines.patch qt-components-1.4.0.tar.bz2 new: ---- qt-components-1.4.1.tar.bz2 spec files: ----------- --- qt-components.spec +++ qt-components.spec @@ -1,6 +1,6 @@ # # Do NOT Edit the Auto-generated Part! -# Generated by: spectacle version 0.24.1 +# Generated by: spectacle version 0.25 # Name: qt-components @@ -9,15 +9,14 @@ # << macros Summary: Qt Quick UX Components -Version: 1.4.0 +Version: 1.4.1 Release: 1 Group: System/Libraries License: BSD URL: https://qt.gitorious.org/qt-components/qt-components -Source0: qt-components-1.4.0.tar.bz2 +Source0: %{name}-%{version}.tar.bz2 Source100: qt-components.yaml Patch0: xruxa-screen-resolution.patch -Patch1: qt-components-1.3git20120215-1-fix-defines.patch BuildRequires: pkgconfig(QtCore) >= 4.7.0 BuildRequires: pkgconfig(QtGui) BuildRequires: pkgconfig(QtOpenGL) @@ -49,8 +48,6 @@ # xruxa-screen-resolution.patch %patch0 -p1 -# qt-components-1.3git20120215-1-fix-defines.patch -%patch1 -p1 # >> setup # << setup other changes: -------------- ++++++ qt-components-1.4.0.tar.bz2 -> qt-components-1.4.1.tar.bz2 --- examples/meego/QmlComponentGallery/qml/ListPage.qml +++ examples/meego/QmlComponentGallery/qml/ListPage.qml @@ -39,13 +39,17 @@ ****************************************************************************/ import QtQuick 1.1 -import com.nokia.meego 1.1 +import com.nokia.meego 1.2 import com.nokia.extras 1.1 Page { id: listPage - anchors.leftMargin: UiConstants.DefaultMargin - anchors.rightMargin: UiConstants.DefaultMargin + + PageHeader { + id: pageHeader + text: "QML Component Gallery" + color: "#44bb44" + } tools: ToolBarLayout { @@ -161,8 +165,14 @@ ListView { id: listView - anchors.fill: parent + anchors.top: pageHeader.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + anchors.leftMargin: UiConstants.DefaultMargin + anchors.rightMargin: UiConstants.DefaultMargin model: pagesModel + clip: true delegate: ListDelegate { Image { --- src/meego/Dialog.qml +++ src/meego/Dialog.qml @@ -104,7 +104,15 @@ titleBar.y = statesWrapper.__titleSaver backgroundRect = 0.0; root.opacity = 0.0; - status = DialogStatus.Closed; + // DialogStatus.Closed is set when Fader has finished its job + } + + Connections { + target: __fader() + onAlphaChanged: { + if (status == DialogStatus.Closing && __fader().alpha == 0.0) + status = DialogStatus.Closed + } } function __beginTransformationToVisible() { --- src/meego/MultiSelectionDialog.qml +++ src/meego/MultiSelectionDialog.qml @@ -64,6 +64,21 @@ anchors.left: parent.left anchors.right: parent.right + // Legacy. "name" used to be the role which was used by delegate + // "modelData" available for JS array and for models with one role + // C++ models have "display" role available always + function __setItemText() { + try { + itemText.text = name + } catch(err) { + try { + itemText.text = modelData + } catch (err) { + itemText.text = display + } + } + } + MouseArea { id: delegateMouseArea anchors.fill: parent; @@ -96,23 +111,8 @@ anchors.rightMargin: root.platformStyle.itemRightMargin font: root.platformStyle.itemFont } - Component.onCompleted: { - try { - // Legacy. "name" used to be the role which was used by delegate - itemText.text = name - } catch(err) { - try { - // "modelData" available for JS array and for models with one role - itemText.text = modelData - } catch (err) { - try { - // C++ models have "display" role available always - itemText.text = display - } catch(err) { - } - } - } - } + + Component.onCompleted: __setItemText() } } @@ -182,8 +182,8 @@ flickableItem: selectionListView platformStyle.inverted: true } - onCountChanged: selectionContent.listViewHeight = (typeof model.count === 'undefined' ? model.length : model.count) * platformStyle.itemHeight - onModelChanged: selectionContent.listViewHeight = (typeof model.count === 'undefined' ? model.length : model.count) * platformStyle.itemHeight + onCountChanged: selectionContent.listViewHeight = selectionListView.count * platformStyle.itemHeight + onModelChanged: selectionContent.listViewHeight = selectionListView.count * platformStyle.itemHeight } } --- src/meego/PageHeader.qml +++ src/meego/PageHeader.qml @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Robin Burchell <[email protected]> +** +** This file is part of the Qt Components project. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.1 +import com.nokia.meego 1.1 + +Rectangle { + id: detailHeader + + height: (screen.currentOrientation == Screen.Portrait || screen.currentOrientation == Screen.PortraitInverted) ? UiConstants.HeaderDefaultHeightPortrait : UiConstants.HeaderDefaultHeightLandscape + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + color: "#000000" + property alias text: label.text + property alias textColor: label.color + + Label { + id: label + anchors.left: parent.left + anchors.leftMargin: UiConstants.DefaultMargin + anchors.right: parent.right + anchors.rightMargin: UiConstants.DefaultMargin + anchors.verticalCenter: parent.verticalCenter + elide: Text.ElideRight + smooth: true + color: "white" + font: UiConstants.HeaderFont + } +} + --- src/meego/PageStack.js +++ src/meego/PageStack.js @@ -49,6 +49,44 @@ return pageStack.length; } +function openSheet(sheet, properties) { + var sheetComp; + if (sheet.createObject) { + // sheet defined as component + sheetComp = sheet; + } else if (typeof sheet == "string") { + // sheet defined as string (a url) + sheetComp = componentCache[sheet]; + if (!sheetComp) { + sheetComp = componentCache[sheet] = Qt.createComponent(sheet); + } + } + if (sheetComp) { + if (sheetComp.status == Component.Error) { + throw new Error("Error while loading sheet: " + sheetComp.errorString()); + } else { + // instantiate sheet from component + sheet = sheetComp.createObject(root, properties || {}); + } + + // if we instantiate the sheet, we must clean it up + sheet.statusChanged.connect(function() { + if (sheet.status == DialogStatus.Closed) + sheet.destroy() + }) + } else { + // copy properties to the page + for (var prop in properties) { + if (properties.hasOwnProperty(prop)) { + sheet[prop] = properties[prop]; + } + } + } + + sheet.open() + return sheet +} + // Pushes a page on the stack. function push(page, properties, replace, immediate) { // page order sanity check --- src/meego/PageStack.qml +++ src/meego/PageStack.qml @@ -66,6 +66,30 @@ // The number of ongoing transitions. property int __ongoingTransitionCount: 0 + // Opens a dialog. + // The dialog can be defined as a component, item or string. + // If an item is used then the sheet will get re-parented. + // If a string is used then it is interpreted as a url that is used to load + // a dialog component. + // + // The properties argument is optional and allows defining a map of properties to set on the dialog. + // Returns the dialog instance. + function openDialog(dialog, properties) { + return Engine.openSheet(dialog, properties) + } + + // Opens a sheet. + // The sheet can be defined as a component, item or string. + // If an item is used then the sheet will get re-parented. + // If a string is used then it is interpreted as a url that is used to load + // a sheet component. + // + // The properties argument is optional and allows defining a map of properties to set on the sheet. + // Returns the sheet instance. + function openSheet(sheet, properties) { + return Engine.openSheet(sheet, properties) + } + // Pushes a page on the stack. // The page can be defined as a component, item or string. // If an item is used then the page will get re-parented. --- src/meego/SelectionDialog.qml +++ src/meego/SelectionDialog.qml @@ -64,21 +64,20 @@ anchors.left: parent.left anchors.right: parent.right - // Legacy. "name" used to be the role which was used by delegate - // "modelData" available for JS array and for models with one role - // C++ models have "display" role available always - function __setItemText() { - try { - itemText.text = name - } catch(err) { - try { - itemText.text = modelData - } catch (err) { - itemText.text = display - } - } - } - + // Legacy. "name" used to be the role which was used by delegate + // "modelData" available for JS array and for models with one role + // C++ models have "display" role available always + function __setItemText() { + try { + itemText.text = name + } catch(err) { + try { + itemText.text = modelData + } catch (err) { + itemText.text = display + } + } + } MouseArea { id: delegateMouseArea @@ -174,8 +173,8 @@ flickableItem: selectionListView platformStyle.inverted: true } - onCountChanged: selectionContent.listViewHeight = (typeof model.count === 'undefined' ? model.length : model.count) * platformStyle.itemHeight - onModelChanged: selectionContent.listViewHeight = (typeof model.count === 'undefined' ? model.length : model.count) * platformStyle.itemHeight + onCountChanged: selectionContent.listViewHeight = selectionListView.count * platformStyle.itemHeight + onModelChanged: selectionContent.listViewHeight = selectionListView.count * platformStyle.itemHeight } } --- src/meego/TextArea.qml +++ src/meego/TextArea.qml @@ -640,7 +640,7 @@ InverseMouseArea { anchors.fill: parent anchors.margins: UI.TOUCH_EXPANSION_MARGIN - enabled: root.activeFocus + enabled: textEdit.activeFocus onClickedOutside: { if (Popup.isOpened(textEdit) && ((mouseX > Popup.geometry().left && mouseX < Popup.geometry().right) && --- src/meego/ToolBar.qml +++ src/meego/ToolBar.qml @@ -105,30 +105,34 @@ State { name: "hidden" when: privateVisibility == ToolBarVisibility.Hidden || tools == null - PropertyChanges { target: root; height: 0; } + PropertyChanges { target: root; height: 0; visible: false; } }, State { name: "HiddenImmediately" when: privateVisibility == ToolBarVisibility.HiddenImmediately - PropertyChanges { target: root; height: 0; } + PropertyChanges { target: root; height: 0; visible: false; } }, State { name: "" when: !(privateVisibility == ToolBarVisibility.Visible || tools == null) - PropertyChanges { target: root; height: bgImage.height } + PropertyChanges { target: root; height: bgImage.height; visible: true; } } - ] - transitions: [ - // Transition between active and inactive states. - Transition { - from: ""; to: "hidden"; reversible: true - ParallelAnimation { - PropertyAnimation { properties: "height"; easing.type: Easing.InOutExpo; duration: platformStyle.visibilityTransitionDuration } + // Transition between active and inactive states. + transitions: Transition { + from: ""; to: "hidden"; reversible: true; + SequentialAnimation { + PropertyAnimation { + properties: "height"; + easing.type: Easing.InOutExpo; + duration: platformStyle.visibilityTransitionDuration; + } + PropertyAction { + properties: "visible"; } } - ] + } // The current set of tools. property Item tools: null @@ -236,21 +240,25 @@ // Start state for pop entry, end state for push exit. State { name: "left" + PropertyChanges { target: container; visible: true } PropertyChanges { target: container; x: -30; opacity: 0.0 } }, // Start state for push entry, end state for pop exit. State { name: "right" + PropertyChanges { target: container; visible: true } PropertyChanges { target: container; x: 30; opacity: 0.0 } }, // Start state for replace entry. State { name: "front" + PropertyChanges { target: container; visible: true } PropertyChanges { target: container; scale: 1.25; opacity: 0.0 } }, // End state for replace exit. State { name: "back" + PropertyChanges { target: container; visible: true } PropertyChanges { target: container; scale: 0.85; opacity: 0.0 } }, // Inactive state. --- src/meego/ToolBarLayout.js +++ src/meego/ToolBarLayout.js @@ -90,8 +90,7 @@ // Main layout function function layout() { - - if (parent === null || width === 0 || children === undefined) + if (parent === null || toolbarLayout.width === 0 || children === undefined) return; var i; --- src/meego/Utils.js +++ src/meego/Utils.js @@ -110,6 +110,23 @@ Get the height that is actually covered by the statusbar (0 if the statusbar is not shown. */ function statusBarCoveredHeight(item) { - return ( findRootItem(item, "pageStackWindow") != null - && findRootItem(item, "pageStackWindow").__statusBarHeight ) + var pageStackWindow = findRootItem(item, "pageStackWindow"); + if ( pageStackWindow.objectName == "pageStackWindow" ) + return pageStackWindow.__statusBarHeight; + return 0 +} + +/* + Get the height that is actually covered by the statusbar (0 if the statusbar is not shown. +*/ +function toolBarCoveredHeight(item) { + var pageStackWindow = findRootItem(item, "pageStackWindow"); + if ( pageStackWindow.objectName == "pageStackWindow" && pageStackWindow.showToolBar) + return pageStackWindow.platformToolBarHeight + return 0 +} + +function intersects(rect1, rect2) { + return (rect1.left <= rect2.right && rect2.left <= rect1.right && + rect1.top <= rect2.bottom && rect2.top <= rect1.bottom) } --- src/meego/i18n/mlocalewrapper.h +++ src/meego/i18n/mlocalewrapper.h @@ -165,7 +165,12 @@ // without localization support, an error message is thrown whenever Qml tries to access a method from MLocale // this is what we want -#ifdef HAVE_MEEGOTOUCH + // + // except for language, which will break compile without meegotouch, because + // someone used it outside QML... +#ifndef HAVE_MEEGOTOUCH + QString language() const { return QString(); } +#else // HAVE_MEEGOTOUCH Q_INVOKABLE void setLocale(QString localeName) --- src/meego/meego.pro +++ src/meego/meego.pro @@ -182,6 +182,7 @@ MouseAreaDebug.qml \ NotificationBanner.qml \ Page.qml \ + PageHeader.qml \ PageStack.qml \ PageStack.js \ PageStackWindow.qml \ --- src/meego/qmldir +++ src/meego/qmldir @@ -29,6 +29,7 @@ MenuItemStyle 1.0 MenuItemStyle.qml MouseAreaDebug 1.0 MouseAreaDebug.qml Page 1.0 Page.qml +PageHeader 1.2 PageHeader.qml PageStack 1.0 PageStack.qml PageStackWindow 1.0 PageStackWindow.qml PageStackWindowStyle 1.0 PageStackWindowStyle.qml ++++++ qt-components.yaml --- qt-components.yaml +++ qt-components.yaml @@ -1,15 +1,14 @@ Name: qt-components Summary: Qt Quick UX Components -Version: 1.4.0 +Version: 1.4.1 Release: 1 Group: System/Libraries License: BSD URL: https://qt.gitorious.org/qt-components/qt-components Sources: - - qt-components-1.4.0.tar.bz2 + - "%{name}-%{version}.tar.bz2" Patches: - xruxa-screen-resolution.patch - - qt-components-1.3git20120215-1-fix-defines.patch Description: The Harmattan Qt Quick UX Components ++++++ deleted files: --- qt-components-1.3git20120215-1-fix-defines.patch
