diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/CHANGES ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/CHANGES --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/CHANGES 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/CHANGES 2013-12-11 12:43:36.000000000 +0000 @@ -9,6 +9,7 @@ API Changes *********** +* ADDED IN: PickerDelegate: readonly property Picker picker * CHANGED IN: OptionSelector: readonly property bool currentlyExpanded TO property bool currentlyExpanded * CHANGED IN: ItemSelector: readonly property bool currentlyExpanded TO property bool currentlyExpanded * ADDED IN: Action: property string iconName @@ -79,6 +80,7 @@ * CHANGED IN Header: property Component contents TO property Item contents * ADDED IN Panel: function open() * ADDED IN Panel: function close() +* ADDED IN Panel: property int hideTimeout * DEPRECATED IN Panel: writable property opened. Will be made read-only. * ADDED IN: Empty: property bool waitingConfirmationForRemoval * ADDED IN: Empty: function cancelItemRemoval() diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/components.api ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/components.api --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/components.api 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/components.api 2013-12-11 12:43:36.000000000 +0000 @@ -27,9 +27,6 @@ modules/Ubuntu/Components/ActivityIndicator.qml AnimatedItem property bool running -modules/Ubuntu/Components/AnimatedItem.qml -StyledItem - property bool onScreen modules/Ubuntu/Components/Button.qml AbstractButton property color color @@ -38,6 +35,16 @@ modules/Ubuntu/Components/CheckBox.qml AbstractButton property bool checked +modules/Ubuntu/Components/Colors/UbuntuColors.qml +QtObject + readonly property color orange + readonly property color lightAubergine + readonly property color midAubergine + readonly property color darkAubergine + readonly property color warmGrey + readonly property color coolGrey + property Gradient orangeGradient + property Gradient greyGradient modules/Ubuntu/Components/CrossFadeImage.qml Item property url source @@ -46,25 +53,9 @@ readonly property bool running property size sourceSize readonly property int status -modules/Ubuntu/Components/DraggingArea.qml -MouseArea - property int orientation - property bool dragging - property real dragVelocity - property real dragValue - property real lateralPosition - property point __pressedPosition - property var __dragEvents - property bool clickValidated - property bool zeroVelocityCounts - signal dragStart - signal dragEnd - function updateSpeed() - function cullOldDragEvents(currentTime) - function getEventSpeed(currentTime, event) - function pushDragEvent(event) modules/Ubuntu/Components/Header.qml StyledItem + property bool animate function show() function hide() property string title @@ -78,6 +69,107 @@ modules/Ubuntu/Components/Label.qml Text property string fontSize +modules/Ubuntu/Components/ListItems/Base.qml +Empty + property variant icon + property url iconSource + property string iconName + property url fallbackIconSource + property string fallbackIconName + property bool progression + property bool iconFrame + property real __iconWidth + property real __iconHeight + property real __leftIconMargin + property real __rightIconMargin + property bool __iconIsItem + property internal children +modules/Ubuntu/Components/ListItems/Caption.qml +Item + property string text +modules/Ubuntu/Components/ListItems/Divider.qml +Image +modules/Ubuntu/Components/ListItems/Empty.qml +AbstractButton + property bool selected + property bool highlightWhenPressed + property bool removable + property bool confirmRemoval + readonly property string swipingState + readonly property bool waitingConfirmationForRemoval + signal itemRemoved + property int __height + property bool showDivider + default property internal children + property internal __contents + property list backgroundIndicator + property ThinDivider divider + property real __contentsMargins + function cancelItemRemoval() +modules/Ubuntu/Components/ListItems/Header.qml +Item + property string text + property internal __foregroundColor +modules/Ubuntu/Components/ListItems/ItemSelector.qml +ListItem.Empty + property var model + property bool expanded + property bool multiSelection + property bool colourImage + property real containerHeight + property int selectedIndex + property bool currentlyExpanded + readonly property real itemHeight + signal delegateClicked(int index) + signal expansionCompleted() +modules/Ubuntu/Components/ListItems/MultiValue.qml +Base + property variant values +modules/Ubuntu/Components/ListItems/SingleControl.qml +Empty + property Item control + function __updateControl() +modules/Ubuntu/Components/ListItems/SingleValue.qml +Base + property string value +modules/Ubuntu/Components/ListItems/Standard.qml +Empty + property variant icon + property url iconSource + property string iconName + property url fallbackIconSource + property string fallbackIconName + property bool progression + property real __iconWidth + property real __iconHeight + property real __leftIconMargin + property real __rightIconMargin + property Item control + property bool iconFrame + property bool __controlAreaPressed + property bool __iconIsItem + property internal __foregroundColor +modules/Ubuntu/Components/ListItems/Subtitled.qml +Base + property string text + property string subText +modules/Ubuntu/Components/ListItems/ThinDivider.qml +Image +modules/Ubuntu/Components/ListItems/ValueSelector.qml +Empty + property variant icon + property url iconSource + property string iconName + property url fallbackIconSource + property string fallbackIconName + property real __iconWidth + property real __iconHeight + property real __leftIconMargin + property real __rightIconMargin + property bool iconFrame + property variant values + property int selectedIndex + property bool expanded modules/Ubuntu/Components/MainView.qml PageTreeNode property string applicationName @@ -89,13 +181,6 @@ default property internal contentsItem property list actions property UnityActions.ActionManager actionManager -modules/Ubuntu/Components/ModelSectionCounter.qml -Object - property var view - property int count - readonly property real sectionHeight - property bool cacheSections - property var cache modules/Ubuntu/Components/Object.qml QtObject default property internal children @@ -143,24 +228,6 @@ function push(page, properties) function pop() function clear() -modules/Ubuntu/Components/PageTreeNode.qml -StyledItem - property bool __isPageTreeNode - property Header header - property Toolbar toolbar - property QtObject __propagated - property bool active - property Item pageStack - property Item parentNode - property Item activeLeafNode - property bool isLeaf -modules/Ubuntu/Components/PageWrapper.qml -PageTreeNode - property var reference - property Item object - property bool canDestroy - property var properties - function destroyObject() modules/Ubuntu/Components/Panel.qml Item default property list contents @@ -168,12 +235,102 @@ property bool opened function open() function close() + property int hideTimeout property bool locked property real hintSize property real triggerSize + property bool animate readonly property bool animating property bool __closeOnContentsClicks property bool pressed +modules/Ubuntu/Components/Pickers/Dialer.qml +StyledItem + property real minimumValue + property real maximumValue + property real size + property real handSpace + readonly property Item centerItem + property list centerContent + readonly property list hands + signal handUpdated(var hand) +modules/Ubuntu/Components/Pickers/DialerHand.qml +StyledItem + property real value + property DialerHandGroup hand + readonly property Dialer dialer + default property list overlay + readonly property int index + property internal __grabber +modules/Ubuntu/Components/Pickers/Picker.qml +StyledItem + property bool circular + property var model + property Component delegate + property int selectedIndex + property bool live + property int __clickedIndex +modules/Ubuntu/Components/Pickers/PickerDelegate.qml +AbstractButton + readonly property Picker picker +modules/Ubuntu/Components/Popups/ActionSelectionPopover.qml +Popover + property Item target + property var actions + property Component delegate +modules/Ubuntu/Components/Popups/ComposerSheet.qml +SheetBase + signal cancelClicked + signal confirmClicked +modules/Ubuntu/Components/Popups/DefaultSheet.qml +SheetBase + property bool doneButton + signal closeClicked + signal doneClicked +modules/Ubuntu/Components/Popups/Dialog.qml +PopupBase + default property list contents + property string title + property string text + property Item caller + property Item pointerTarget + property real edgeMargins + property real callerMargin + property bool modal +modules/Ubuntu/Components/Popups/Popover.qml +PopupBase + default property list container + property real contentWidth + property real contentHeight + property Item caller + property Item pointerTarget + property real edgeMargins + property real callerMargin + property bool autoClose + property Component foregroundStyle + function show() + function hide() + function __makeInvisible() +modules/Ubuntu/Components/Popups/PopupBase.qml +OrientationHelper + property Item dismissArea + property bool grabDismissAreaEvents + function show() + function hide() + function __closeIfHidden() + function __closePopup() + property Item __foreground + property bool __closeOnDismissAreaPress + property internal __dimBackground + property internal __eventGrabber +modules/Ubuntu/Components/Popups/SheetBase.qml +PopupBase + default property list container + property real contentsWidth + property real contentsHeight + property string title + property bool modal + property internal __leftButton + property internal __rightButton modules/Ubuntu/Components/ProgressBar.qml AnimatedItem property bool indeterminate @@ -212,7 +369,8 @@ modules/Ubuntu/Components/TabBar.qml StyledItem property Item tabsItem - property ListModel model + property var model + readonly property bool pressed property bool selectionMode property int selectedIndex property bool alwaysSelectionMode @@ -288,12 +446,6 @@ function undo() function forceActiveFocus() property internal __internal -modules/Ubuntu/Components/TextCursor.qml -StyledItem - property var editorItem - property string positionProperty - property var popover - function openPopover() modules/Ubuntu/Components/TextField.qml ActionItem property bool highlighted @@ -336,8 +488,8 @@ property string text property Validator validator property enumeration horizontalAlignment - property internal effectiveHorizontalAlignment - property internal verticalAlignment + property enumeration effectiveHorizontalAlignment + property enumeration verticalAlignment property string passwordCharacter property color selectionColor property color selectedTextColor @@ -360,12 +512,22 @@ function remove(start, end) function getText(start, end) property internal __internal -modules/Ubuntu/Components/TextInputPopover.qml -ActionSelectionPopover -modules/Ubuntu/Components/Toolbar.qml -Panel - property Item tools - property int hideTimeout +modules/Ubuntu/Components/Themes/Palette.qml +QtObject + property PaletteValues normal + property PaletteValues selected +modules/Ubuntu/Components/Themes/PaletteValues.qml +QtObject + property color background + property color backgroundText + property color base + property color baseText + property color foreground + property color foregroundText + property color overlay + property color overlayText + property color field + property color fieldText modules/Ubuntu/Components/ToolbarButton.qml ActionItem modules/Ubuntu/Components/ToolbarItems.qml @@ -384,250 +546,6 @@ property string radius property Item image property url borderSource -modules/Ubuntu/Components/Colors/UbuntuColors.qml -QtObject - readonly property color orange - readonly property color lightAubergine - readonly property color midAubergine - readonly property color darkAubergine - readonly property color warmGrey - readonly property color coolGrey - property Gradient orangeGradient - property Gradient greyGradient -modules/Ubuntu/Components/ListItems/Base.qml -Empty - property variant icon - property url iconSource - property string iconName - property url fallbackIconSource - property string fallbackIconName - property bool progression - property bool iconFrame - property real __iconWidth - property real __iconHeight - property real __leftIconMargin - property real __rightIconMargin - property bool __iconIsItem - property internal children -modules/Ubuntu/Components/ListItems/Caption.qml -Item - property string text -modules/Ubuntu/Components/ListItems/Divider.qml -Image -modules/Ubuntu/Components/ListItems/Empty.qml -AbstractButton - property bool selected - property bool highlightWhenPressed - property bool removable - property bool confirmRemoval - readonly property string swipingState - readonly property bool waitingConfirmationForRemoval - signal itemRemoved - property int __height - property bool showDivider - default property internal children - property internal __contents - property list backgroundIndicator - property ThinDivider divider - property real __contentsMargins - function cancelItemRemoval() -modules/Ubuntu/Components/ListItems/Header.qml -Item - property string text - property internal __foregroundColor -modules/Ubuntu/Components/ListItems/IconVisual.qml -Item - property url source - property url fallbackSource - property string fallbackIconName - property bool hasFrame -modules/Ubuntu/Components/ListItems/ImageWithFallback.qml -Image - property url fallbackSource - property bool fallbackRequired - function isSourceDefined(sourceUrl) - function tryLoadingFallbackSource() - function checkStatus() -modules/Ubuntu/Components/ListItems/ItemSelector.qml -ListItem.Empty - property var model - property bool expanded - property bool multiSelection - property bool colourImage - property real containerHeight - property int selectedIndex - property bool currentlyExpanded - readonly property real itemHeight - signal delegateClicked(int index) - signal expansionCompleted() -modules/Ubuntu/Components/ListItems/LabelVisual.qml -Label - property bool selected - property bool secondary - property bool overlay - function isInsideOverlay(item) -modules/Ubuntu/Components/ListItems/MultiValue.qml -Base - property variant values -modules/Ubuntu/Components/ListItems/ProgressionVisual.qml -Item - property bool showSplit - property real splitMargin -modules/Ubuntu/Components/ListItems/SingleControl.qml -Empty - property Item control - function __updateControl() -modules/Ubuntu/Components/ListItems/SingleValue.qml -Base - property string value -modules/Ubuntu/Components/ListItems/Standard.qml -Empty - property variant icon - property url iconSource - property string iconName - property url fallbackIconSource - property string fallbackIconName - property bool progression - property real __iconWidth - property real __iconHeight - property real __leftIconMargin - property real __rightIconMargin - property Item control - property bool iconFrame - property bool __controlAreaPressed - property bool __iconIsItem - property internal __foregroundColor -modules/Ubuntu/Components/ListItems/Subtitled.qml -Base - property string text - property string subText -modules/Ubuntu/Components/ListItems/ThinDivider.qml -Image -modules/Ubuntu/Components/ListItems/ValueSelector.qml -Empty - property variant icon - property url iconSource - property string iconName - property url fallbackIconSource - property string fallbackIconName - property real __iconWidth - property real __iconHeight - property real __leftIconMargin - property real __rightIconMargin - property bool iconFrame - property variant values - property int selectedIndex - property bool expanded -modules/Ubuntu/Components/Pickers/Dialer.qml -StyledItem - property real minimumValue - property real maximumValue - property real size - property real handSpace - readonly property Item centerItem - property list centerContent - readonly property list hands - signal handUpdated(var hand) -modules/Ubuntu/Components/Pickers/DialerHand.qml -StyledItem - property real value - property DialerHandGroup hand - readonly property Dialer dialer - default property list overlay - readonly property int index - property internal __grabber -modules/Ubuntu/Components/Pickers/DialerHandGroup.qml -QtObject - property real width - property real height - property bool draggable - property bool visible - property bool toCenterItem -modules/Ubuntu/Components/Pickers/Picker.qml -StyledItem - property bool circular - property var model - property Component delegate - property int selectedIndex - property bool live - property int __clickedIndex -modules/Ubuntu/Components/Pickers/PickerDelegate.qml -AbstractButton -modules/Ubuntu/Components/Popups/ActionSelectionPopover.qml -Popover - property Item target - property var actions - property Component delegate -modules/Ubuntu/Components/Popups/ComposerSheet.qml -SheetBase - signal cancelClicked - signal confirmClicked -modules/Ubuntu/Components/Popups/DefaultSheet.qml -SheetBase - property bool doneButton - signal closeClicked - signal doneClicked -modules/Ubuntu/Components/Popups/Dialog.qml -PopupBase - default property list contents - property string title - property string text - property Item caller - property Item pointerTarget - property real edgeMargins - property real callerMargin - property bool modal -modules/Ubuntu/Components/Popups/Popover.qml -PopupBase - default property list container - property real contentWidth - property internal contentHeight - property Item caller - property Item pointerTarget - property real edgeMargins - property real callerMargin - property bool autoClose - property Component foregroundStyle - function show() - function hide() - function __makeInvisible() -modules/Ubuntu/Components/Popups/PopupBase.qml -OrientationHelper - property Item dismissArea - property bool grabDismissAreaEvents - function show() - function hide() - function __closeIfHidden() - function __closePopup() - property Item __foreground - property bool __closeOnDismissAreaPress - property internal __dimBackground - property internal __eventGrabber -modules/Ubuntu/Components/Popups/SheetBase.qml -PopupBase - default property list container - property real contentsWidth - property real contentsHeight - property string title - property bool modal - property internal __leftButton - property internal __rightButton -modules/Ubuntu/Components/Themes/Palette.qml -QtObject - property PaletteValues normal - property PaletteValues selected -modules/Ubuntu/Components/Themes/PaletteValues.qml -QtObject - property color background - property color backgroundText - property color base - property color baseText - property color foreground - property color foregroundText - property color overlay - property color overlayText - property color field - property color fieldText plugins.qmltypes name: "InverseMouseAreaType" prototype: "QQuickMouseArea" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/debian/changelog ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/debian/changelog --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/debian/changelog 2013-12-11 13:02:20.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/debian/changelog 2013-12-11 13:02:20.000000000 +0000 @@ -1,4 +1,4 @@ -ubuntu-ui-toolkit (0.1.46+14.04.20131129-0ubuntu1) trusty; urgency=low +ubuntu-ui-toolkit (0.1.46+14.04.20131129+doxfix-0ubuntu1) trusty; urgency=low [ Zsombor Egri ] * Tabs to react on model changes when a Repeater is used to populate @@ -32,7 +32,7 @@ [ Ubuntu daily release ] * Automatic snapshot from revision 872 - -- Ubuntu daily release Fri, 29 Nov 2013 20:24:58 +0000 + -- Timo Jyrinki Wed, 11 Dec 2013 12:59:31 +0000 ubuntu-ui-toolkit (0.1.46+14.04.20131126.1-0ubuntu1) trusty; urgency=low diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/debian/control ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/debian/control --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/debian/control 2013-12-11 13:02:20.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/debian/control 2013-12-11 13:02:20.000000000 +0000 @@ -13,7 +13,7 @@ qtbase5-private-dev, qttools5-dev-tools, # Starting with Qt5.2 'libqt5v8-5-private-dev' should be removed - libqt5v8-5-private-dev, + qtbase5-dev (>= 5.2~) | libqt5v8-5-private-dev, qtbase5-dev-tools, libqt5sql5-sqlite, qtdeclarative5-dev-tools, diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/documentation/ubuntu-ui-toolkit-offline.qdocconf ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/documentation/ubuntu-ui-toolkit-offline.qdocconf --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/documentation/ubuntu-ui-toolkit-offline.qdocconf 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/documentation/ubuntu-ui-toolkit-offline.qdocconf 2013-12-11 12:43:36.000000000 +0000 @@ -2,11 +2,11 @@ HTML.nobreadcrumbs = "true" HTML.stylesheets = \ - documentation/css/breadcrumbs.js \ - documentation/css/reset.css \ - documentation/css/qtquick.css \ - documentation/css/base.css \ - documentation/css/scratch.css + $SRC/css/breadcrumbs.js \ + $SRC/css/reset.css \ + $SRC/css/qtquick.css \ + $SRC/css/base.css \ + $SRC/css/scratch.css HTML.headerstyles = \ "\n" \ diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/documentation/ubuntu-ui-toolkit-online-indexes.qdocconf ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/documentation/ubuntu-ui-toolkit-online-indexes.qdocconf --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/documentation/ubuntu-ui-toolkit-online-indexes.qdocconf 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/documentation/ubuntu-ui-toolkit-online-indexes.qdocconf 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,11 @@ +include(ubuntu-ui-toolkit-online.qdocconf) + +indexes = \ + /usr/share/qt5/doc/qtqml/qtqml.index \ + /usr/share/qt5/doc/qtquick/qtquick.index \ + /usr/share/qt5/doc/qtwebkit/qtwebkit.index \ + /usr/share/qt5/doc/qtsvg/qtsvg.index \ + /usr/share/qt5/doc/qtscript/qtscript.index \ + /usr/share/qt5/doc/qtmultimedia/qtmultimedia.index \ + /usr/share/doc/unity-action/qml/unity-action-qml-api.index \ + diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/documentation/ubuntu-ui-toolkit-online.qdocconf ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/documentation/ubuntu-ui-toolkit-online.qdocconf --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/documentation/ubuntu-ui-toolkit-online.qdocconf 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/documentation/ubuntu-ui-toolkit-online.qdocconf 2013-12-11 12:43:36.000000000 +0000 @@ -2,15 +2,6 @@ include(ubuntu-appdev-site-header.qdocconf) include(ubuntu-appdev-site-footer.qdocconf) -indexes = \ - /usr/share/qt5/doc/qtqml/qtqml.index \ - /usr/share/qt5/doc/qtquick/qtquick.index \ - /usr/share/qt5/doc/qtwebkit/qtwebkit.index \ - /usr/share/qt5/doc/qtsvg/qtsvg.index \ - /usr/share/qt5/doc/qtscript/qtscript.index \ - /usr/share/qt5/doc/qtmultimedia/qtmultimedia.index \ - /usr/share/doc/unity-action/qml/unity-action-qml-api.index \ - HTML.nobreadcrumbs = "false" HTML.headerstyles = \ diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/examples/ubuntu-ui-toolkit-gallery/Pickers.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/examples/ubuntu-ui-toolkit-gallery/Pickers.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/examples/ubuntu-ui-toolkit-gallery/Pickers.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/examples/ubuntu-ui-toolkit-gallery/Pickers.qml 2013-12-11 12:43:36.000000000 +0000 @@ -32,7 +32,9 @@ delegate: PickerDelegate { Label { text: modelData - anchors.verticalCenter: parent.verticalCenter + anchors.fill: parent + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter } } @@ -46,7 +48,9 @@ delegate: PickerDelegate { Label { text: modelData - anchors.verticalCenter: parent.verticalCenter + anchors.fill: parent + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter } } @@ -73,7 +77,9 @@ delegate: PickerDelegate { Label { text: modelData - anchors.verticalCenter: parent.verticalCenter + anchors.fill: parent + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter } Component.onCompleted: { if (index === (picker.model.count - 1)) diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Header.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Header.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Header.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Header.qml 2013-12-11 12:43:36.000000000 +0000 @@ -36,8 +36,13 @@ } y: 0 + /*! + Animate showing and hiding of the header. + */ + property bool animate: true + Behavior on y { - enabled: !(header.flickable && header.flickable.moving) + enabled: animate && !(header.flickable && header.flickable.moving) SmoothedAnimation { duration: Ubuntu.UbuntuAnimation.BriskDuration } diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/ListItems/Empty.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/ListItems/Empty.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/ListItems/Empty.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/ListItems/Empty.qml 2013-12-11 12:43:36.000000000 +0000 @@ -158,7 +158,7 @@ /*! \preliminary - \qmlproperty ThinDivider bottomDividerLine + \qmlproperty ThinDivider divider Exposes our the bottom line divider. */ property alias divider: bottomDividerLine diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/ListItems/ProgressionVisual.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/ListItems/ProgressionVisual.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/ListItems/ProgressionVisual.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/ListItems/ProgressionVisual.qml 2013-12-11 12:43:36.000000000 +0000 @@ -15,38 +15,15 @@ */ import QtQuick 2.0 +import Ubuntu.Components 0.1 // Internal helper class for the visuals of // the progression symbol. -Item { +StyledItem { id: progressionVisual - width: progressIcon.width + (showSplit ? splitMargin + progressionDivider.width : 0) - property bool showSplit: false property real splitMargin - Image { - id: progressIcon - source: "artwork/ListItemProgressionArrow.png" - anchors { - verticalCenter: parent.verticalCenter - right: parent.right - } - - opacity: enabled ? 1.0 : 0.5 - } - - Image { - id: progressionDivider - visible: progressionVisual.showSplit - anchors { - top: parent.top - bottom: parent.bottom - right: progressIcon.left - rightMargin: splitMargin - } - source: "artwork/ListItemDividerVertical.png" - opacity: enabled ? 1.0 : 0.5 - } + style: Theme.createStyleComponent("ProgressionVisualStyle.qml", progressionVisual) } Binary files /tmp/279D_Msotj/ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/ListItems/artwork/ListItemDividerVertical@18.png and /tmp/9Azr6_Bjjl/ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/ListItems/artwork/ListItemDividerVertical@18.png differ Binary files /tmp/279D_Msotj/ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/ListItems/artwork/ListItemProgressionArrow@8.png and /tmp/9Azr6_Bjjl/ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/ListItems/artwork/ListItemProgressionArrow@8.png differ diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/ListItems/qmldir ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/ListItems/qmldir --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/ListItems/qmldir 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/ListItems/qmldir 2013-12-11 12:43:36.000000000 +0000 @@ -4,7 +4,6 @@ Divider 0.1 Divider.qml Header 0.1 Header.qml internal IconVisual IconVisual.qml -ItemSeparator 0.1 ItemSeparator.qml internal LabelVisual LabelVisual.qml MultiValue 0.1 MultiValue.qml ItemSelector 0.1 ItemSelector.qml diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/MainView.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/MainView.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/MainView.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/MainView.qml 2013-12-11 12:43:36.000000000 +0000 @@ -292,6 +292,11 @@ } } + /*! + Animate header and toolbar. + */ + property bool animate: true + Toolbar { id: toolbarItem onPressedChanged: { @@ -300,6 +305,7 @@ headerItem.tabBar.selectionMode = false; } } + animate: canvas.animate } /*! @@ -313,6 +319,7 @@ objectName: "MainView_Header" id: headerItem property real bottomY: headerItem.y + headerItem.height + animate: canvas.animate property Item tabBar: null Binding { @@ -322,19 +329,35 @@ when: headerItem.contents && headerItem.contents.hasOwnProperty("selectionMode") && headerItem.contents.hasOwnProperty("alwaysSelectionMode") && - headerItem.contents.hasOwnProperty("selectedIndex") + headerItem.contents.hasOwnProperty("selectedIndex") && + headerItem.contents.hasOwnProperty("pressed") } Connections { // no connections are made when target is null target: headerItem.tabBar - onSelectionModeChanged: { - if (headerItem.tabBar.selectionMode) { + onPressedChanged: { + if (headerItem.tabBar.pressed) { if (!toolbarItem.locked) toolbarItem.close(); } } } } + + Connections { + target: Qt.application + onActiveChanged: { + if (Qt.application.active) { + canvas.animate = false; + headerItem.show(); + if (headerItem.tabBar) { + headerItem.tabBar.selectionMode = true; + } + if (!toolbarItem.locked) toolbarItem.open(); + canvas.animate = true; + } + } + } } /*! diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/OptionSelectorDelegate.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/OptionSelectorDelegate.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/OptionSelectorDelegate.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/OptionSelectorDelegate.qml 2013-12-11 12:43:36.000000000 +0000 @@ -202,9 +202,7 @@ Connections { target: listView.container onCurrentlyExpandedChanged: { - optionExpansion.stop(); imageExpansion.stop(); - optionCollapse.stop(); selectedImageCollapse.stop(); deselectedImageCollapse.stop(); diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Panel.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Panel.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Panel.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Panel.qml 2013-12-11 12:43:36.000000000 +0000 @@ -103,8 +103,7 @@ Any Items can be placed inside the Panel, but MouseAreas can block mouse events from reaching the panel and thus obstruct the swiping behavior for hiding the panel. As a result, the user cannot start swiping on the buttons in the examples above in order to hide the panel. To remedy this, clicked() - signals are forwarded from the panel to its children. The children's clicked() signal does not have - a mouse parameter. Example: + signals are forwarded from the panel by calling the child's trigger() function. Example: \qml import QtQuick 2.0 import Ubuntu.Components 0.1 @@ -130,15 +129,17 @@ width: units.gu(8) height: units.gu(4) anchors.centerIn: parent - color: Theme.palette.normal.foreground - signal clicked() - onClicked: print("The red rectangle was clicked"); + color: "red" + function trigger() { + print("The red rectangle was clicked"); + } } } } + Component.onCompleted: panel.open(); } \endqml - Like this, the red rectangle accepts clicked() events, but the user can still swipe down on top + Like this, the red rectangle accepts click events, but the user can still swipe down on top of the rectangle in order to hide the panel. */ Item { @@ -208,6 +209,7 @@ // FIXME: When opened is made readonly, openedChangedWarning must be removed internal.openedChangedWarning = false; panel.state = "spread"; + hideTimer.conditionalRestart(); } /*! @@ -217,9 +219,21 @@ // FIXME: When opened is made readonly, openedChangedWarning must be removed. internal.openedChangedWarning = false; panel.state = ""; + hideTimer.stop(); } /*! + The time in milliseconds before the panel automatically hides after inactivity + when it is not locked. Interacting with the panel resets the timer. + Note that adding contents to the panel that accepts mouse events will prevent + the panel from detecting interaction and the timer will not be reset. + Setting a negative value will disable automatic hiding. + Default value: -1 (automatic hiding is disabled). + \qmlproperty int hideTimeout + */ + property alias hideTimeout: hideTimer.interval + + /*! Disable edge swipe to open/close the panel. False by default. */ property bool locked: false @@ -228,8 +242,50 @@ if (state == "hint" || state == "moving") { draggingArea.finishMoving(); } + if (!hideTimer.conditionalRestart()) { + hideTimer.stop(); + } } + Timer { + id: hideTimer + interval: -1 + running: panel.opened && !panel.locked && interval >= 0 + + function conditionalRestart() { + if (hideTimer.interval >= 0) { + if (!panel.locked && panel.opened) { + hideTimer.restart(); + return true; + } + } + return false; + } + onIntervalChanged: { + if (!conditionalRestart()) { + hideTimer.stop(); + } + } + onTriggered: { + if (!panel.locked) { + panel.close(); + } + } + } + // disable the timer when the application is not active to avoid closing + // the panel immediately after the application becomes active again + Connections { + target: Qt.application + onActiveChanged: { + if (Qt.application.active) { + hideTimer.conditionalRestart(); + } else { + hideTimer.stop(); + } + } + } + + /*! How much of the panel to show when the user touches the panel's edge. This gives the user a hint that there is a panel hiding at that edge and @@ -277,6 +333,11 @@ ] /*! + Animate transitions between the different panel states. + */ + property bool animate: true + + /*! The toolbar is currently not in a stable hidden or visible state. */ readonly property bool animating: draggingArea.pressed || transitionToAll.running @@ -317,7 +378,7 @@ UbuntuNumberAnimation { target: bar properties: "position" - duration: Toolkit.UbuntuAnimation.SnapDuration + duration: panel.animate ? Toolkit.UbuntuAnimation.SnapDuration : 0 } } ] @@ -332,7 +393,7 @@ The duration in milliseconds of sliding in or out transitions when opening, closing, and showing the hint. Default value: 250 */ - property real transitionDuration: Toolkit.UbuntuAnimation.FastDuration + property real transitionDuration: panel.animate ? Toolkit.UbuntuAnimation.FastDuration : 0 property string previousState: "" property int movingDelta @@ -485,6 +546,7 @@ property int initialPosition onPressed: { + hideTimer.stop(); pressedItem = getTriggerableItem(mouse); if (panel.locked) return; initialPosition = getMousePosition(); @@ -514,12 +576,16 @@ onReleased: { if (panel.state == "moving" || panel.state == "hint") { finishMoving(); + } else { + hideTimer.conditionalRestart(); } } // Mouse cursor moving out of the window while pressed on desktop onCanceled: { if (panel.state == "moving" || panel.state == "hint") { finishMoving(); + } else { + hideTimer.conditionalRestart(); } } diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Pickers/Picker.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Pickers/Picker.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Pickers/Picker.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Pickers/Picker.qml 2013-12-11 12:43:36.000000000 +0000 @@ -92,7 +92,9 @@ property var model /*! - The delegate visualizing the model elements. + The delegate visualizing the model elements. Any kind of component can be + used as delegate, however it is recommended to use \l PickerDelegate, which + integrates selection functionality into the Picker. */ property Component delegate @@ -115,4 +117,155 @@ /*! \internal */ property int __clickedIndex: -1 + + // bind style instance's view property to the Loader's item + Binding { + target: __styleInstance + property: "view" + value: loader.item + when: __styleInstance.hasOwnProperty("view") && loader.item + } + + // tumbler + Loader { + id: loader + asynchronous: false + parent: __styleInstance.hasOwnProperty("tumblerHolder") ? __styleInstance.tumblerHolder : picker + anchors.fill: parent + sourceComponent: circular ? wrapAround : linear + + // property for loading completion + property bool completed: item && (status === Loader.Ready) && item.viewCompleted + + Binding { + target: loader.item + property: "currentIndex" + value: picker.selectedIndex + when: loader.item && loader.status === Loader.Ready + } + + // live selectedIndex updater + Binding { + target: picker + property: "selectedIndex" + value: loader.item.currentIndex + when: loader.completed && (picker.model !== undefined) && picker.live + } + // non-live selectedIndex updater + Connections { + target: loader.item + ignoreUnknownSignals: true + onMovementEnded: { + if (!picker.live) { + picker.selectedIndex = loader.item.currentIndex; + } + } + onCurrentIndexChanged: { + if (!picker.live && picker.__clickedIndex === loader.item.currentIndex) { + picker.selectedIndex = loader.item.currentIndex; + picker.__clickedIndex = -1; + } + } + onModelChanged: { + loader.moveToIndex((loader.completed) ? 0 : picker.selectedIndex); + if (loader.completed && !picker.live) { + picker.selectedIndex = 0; + } + } + } + + function modelSize() { + return loader.item.model.hasOwnProperty("count") ? loader.item.model.count : loader.item.model.length; + } + + function moveToIndex(toIndex) { + var count = (loader.item && loader.item.model) ? modelSize() : -1; + if (completed && count > 0) { + if (QuickUtils.className(loader.item) === "QQuickListView") { + loader.item.currentIndex = toIndex; + return; + } else { + loader.item.positionViewAtIndex(count - 1, PathView.Center); + loader.item.positionViewAtIndex(toIndex, PathView.Center); + } + } + } + } + + // circular list + Component { + id: wrapAround + PathView { + id: pView + objectName: "Picker_WrapAround" + // property declared for PickerDelegate to be able to access the main component + property Item pickerItem: picker + // property holding view completion + property bool viewCompleted: false + anchors { + top: parent ? parent.top : undefined + bottom: parent ? parent.bottom : undefined + horizontalCenter: parent ? parent.horizontalCenter : undefined + } + width: parent ? parent.width : 0 + clip: true + + model: picker.model + delegate: picker.delegate + currentIndex: picker.selectedIndex + // put the currentItem to the center of the view + preferredHighlightBegin: 0.5 + preferredHighlightEnd: 0.5 + + // FIXME: currentItem gets set upon first flick when the model is empty at the + // time the component gets completed. Watch the model changes to force update + pathItemCount: pView.height / (pView.currentItem ? pView.currentItem.height : 1) + 1 + snapMode: PathView.SnapToItem + flickDeceleration: 100 + + property int contentHeight: pathItemCount * (pView.currentItem ? pView.currentItem.height : 1) + path: Path { + startX: pView.width / 2 + startY: -(pView.contentHeight - pView.height) / 2 + PathLine { + x: pView.width / 2 + y: pView.height + (pView.contentHeight - pView.height) / 2 + } + } + + Component.onCompleted: viewCompleted = true + } + } + + // linear list + Component { + id: linear + ListView { + id: lView + objectName: "Picker_Linear" + // property declared for PickerDelegate to be able to access the main component + property Item pickerItem: picker + // property holding view completion + property bool viewCompleted: false + anchors { + top: parent ? parent.top : undefined + bottom: parent ? parent.bottom : undefined + horizontalCenter: parent ? parent.horizontalCenter : undefined + } + width: parent ? parent.width : 0 + clip: true + + model: picker.model + delegate: picker.delegate + currentIndex: picker.selectedIndex + + preferredHighlightBegin: (height - (currentItem ? currentItem.height : 0)) / 2 + preferredHighlightEnd: preferredHighlightBegin + (currentItem ? currentItem.height : 0) + highlightRangeMode: ListView.StrictlyEnforceRange + highlightMoveDuration: 300 + flickDeceleration: 100 + + Component.onCompleted: viewCompleted = true + } + } } diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Pickers/PickerDelegate.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Pickers/PickerDelegate.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Pickers/PickerDelegate.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Pickers/PickerDelegate.qml 2013-12-11 12:43:36.000000000 +0000 @@ -30,14 +30,21 @@ AbstractButton { id: pickerDelegate + /*! + \qmlproperty Picker picker + \readonly + The property holds the Picker component the delegate belongs to. + */ + readonly property alias picker: internal.picker + implicitHeight: units.gu(4) - implicitWidth: parent.width + implicitWidth: picker ? internal.itemList.width : 0 /*! \internal */ onClicked: { - if (internal.tumblerItem.currentIndex === index) return; - internal.tumbler.__clickedIndex = index; - internal.tumblerItem.currentIndex = index; + if (internal.itemList.currentIndex === index) return; + picker.__clickedIndex = index; + internal.itemList.currentIndex = index; } style: Theme.createStyleComponent("PickerDelegateStyle.qml", pickerDelegate) @@ -45,7 +52,7 @@ QtObject { id: internal property bool inListView: QuickUtils.className(pickerDelegate.parent) !== "QQuickPathView" - property Item tumblerItem: !inListView ? pickerDelegate.parent : pickerDelegate.parent.parent - property Item tumbler: tumblerItem ? tumblerItem.tumbler : null + property Item itemList: !inListView ? pickerDelegate.PathView.view : pickerDelegate.ListView.view + property Picker picker: itemList ? itemList.pickerItem : null } } diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Popups/Popover.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Popups/Popover.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Popups/Popover.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Popups/Popover.qml 2013-12-11 12:43:36.000000000 +0000 @@ -104,7 +104,6 @@ The properties can be used to alter the default content width and heights. */ property alias contentWidth: foreground.width - /*! \internal */ property alias contentHeight: foreground.height /*! @@ -144,7 +143,7 @@ property bool autoClose: true /*! - \qmlproperty Component style + \qmlproperty Component foregroundStyle Exposes the style property of the \l StyledItem contained in the Popover. Refer to \l StyledItem how to use it. */ diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/TabBar.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/TabBar.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/TabBar.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/TabBar.qml 2013-12-11 12:43:36.000000000 +0000 @@ -46,7 +46,14 @@ determined by the style component, Default style checks the existence of the \b tab role first, and if not defined will use the \b title role. */ - property ListModel model + property var model: null + + /*! + The user is interacting with the tab bar. + Depends on the style pressed property. + */ + readonly property bool pressed: __styleInstance !== null && __styleInstance.hasOwnProperty("pressed") ? + __styleInstance.pressed : false /*! An inactive tab bar only displays the currently selected tab, @@ -57,7 +64,7 @@ /*! The property holds the index of the selected Tab item. */ - property int selectedIndex: (model && model.count > 0) ? 0 : -1 + property int selectedIndex: (model && internal.modelChecked && model.count > 0) ? 0 : -1 /*! Do not deactivate the tab bar after a specified idle time or when the user selects a new tab. @@ -80,4 +87,59 @@ implicitHeight: units.gu(7.5) style: Theme.createStyleComponent("TabBarStyle.qml", tabBar) + + QtObject { + id: internal + + property bool modelChecked: true; + + function checkRoles() { + if (tabBar.model.count <= 0) + return; + + modelChecked = true; + var f = tabBar.model.get(0); + if (f.tab === undefined && f.title === undefined) { + console.error("TabBar model must provide either tab or title role."); + tabBar.model = null; + } + if (f.tab !== undefined && f.tab.title === undefined) { + console.error("TabBar model's tab role must have title property."); + tabBar.model = null; + } + } + } + + /*! \internal */ + onModelChanged: { + internal.modelChecked = true; + + if (!model) + return; + + if (!model.hasOwnProperty("count")) { + console.error("TabBar model must have count property defined."); + tabBar.model = null; + return; + } + + if (!model.hasOwnProperty("get")) { + console.error("TabBar model must provide get() function."); + tabBar.model = null; + return; + } + + if (model.count > 0) { + internal.checkRoles(); + tabBar.selectedIndex = Math.max(Math.min(tabBar.selectedIndex, model.count - 1), 0); + } else { + internal.modelChecked = false; + tabBar.selectedIndex = Qt.binding(function() { return (model && internal.modelChecked && model.count > 0) ? 0 : -1 }) + } + } + + Connections { + target: !internal.modelChecked ? tabBar.model : null + onCountChanged: internal.checkRoles(); + } } diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Tabs.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Tabs.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Tabs.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Tabs.qml 2013-12-11 12:43:36.000000000 +0000 @@ -282,10 +282,17 @@ } } - QtObject { + Object { id: internal property Header header: tabs.__propagated ? tabs.__propagated.header : null + Binding { + target: tabBar + property: "animate" + when: internal.header && internal.header.hasOwnProperty("animate") + value: internal.header.animate + } + /* List of connected Repeaters to avoid repeater "hammering" of itemAdded() signal. */ diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/TextField.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/TextField.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/TextField.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/TextField.qml 2013-12-11 12:43:36.000000000 +0000 @@ -543,9 +543,7 @@ \qmlproperty enumeration verticalAlignment */ property alias horizontalAlignment: editor.horizontalAlignment - /*! \internal */ property alias effectiveHorizontalAlignment: editor.effectiveHorizontalAlignment - /*! \internal */ property alias verticalAlignment: editor.verticalAlignment /*! @@ -570,7 +568,7 @@ /*! The highlighted text color, used in selections. - \qmlproperty color selctedTextColor + \qmlproperty color selectedTextColor */ property alias selectedTextColor: editor.selectedTextColor diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Themes/Ambiance/HighlightMagnifier.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Themes/Ambiance/HighlightMagnifier.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Themes/Ambiance/HighlightMagnifier.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Themes/Ambiance/HighlightMagnifier.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,71 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 + +Item { + id: magnifier + property alias sourceItem: effectSource.sourceItem + property alias scaleFactor: effect.scaleFactor + + // everything in the sourceItem that is not transparent will be made this color + // in the output, but the transparency of the input is respected + property alias outputColor: effect.outputColor + + ShaderEffectSource { + id: effectSource + visible: false + + property real sourceRectMultiplier: 2.0 + + // XXX: This works because the parent of magnifier is the same as sourceItem + // in this case. Otherwise coordinate transformations will be needed. + sourceRect: Qt.rect(magnifier.x, magnifier.y, magnifier.width, magnifier.height) + + textureSize: Qt.size(magnifier.width*sourceRectMultiplier, magnifier.height*sourceRectMultiplier) + } + + ShaderEffect { + id: effect + anchors.fill: parent + + property variant source: effectSource + property real scaleFactor: 1.2 + property color outputColor: "red" + + vertexShader: " + attribute highp vec4 qt_Vertex; + attribute highp vec2 qt_MultiTexCoord0; + uniform highp mat4 qt_Matrix; + uniform highp float scaleFactor; + varying highp vec2 qt_TexCoord0; + void main() { + qt_TexCoord0 = vec2(0.5 - 1.0 / (2.0 * scaleFactor)) + qt_MultiTexCoord0 / vec2(scaleFactor); + gl_Position = qt_Matrix * qt_Vertex; + }" + + fragmentShader: " + uniform lowp float qt_Opacity; + varying highp vec2 qt_TexCoord0; + uniform sampler2D source; + uniform highp vec4 outputColor; + + void main() { + lowp vec4 tex = texture2D(source, qt_TexCoord0); + gl_FragColor = vec4(outputColor.rgb, outputColor.a*tex.a) * qt_Opacity; + }" + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Themes/Ambiance/PickerDelegateStyle.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Themes/Ambiance/PickerDelegateStyle.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Themes/Ambiance/PickerDelegateStyle.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Themes/Ambiance/PickerDelegateStyle.qml 2013-12-11 12:43:36.000000000 +0000 @@ -18,36 +18,38 @@ import Ubuntu.Components 0.1 Item { - property real minFade: 0.25 + property real minFade: 0.2 property real maxFade: 0.95 + property bool fadingEnabled: true property bool inListView: QuickUtils.className(styledItem.parent) !== "QQuickPathView" - property Item tumblerItem: !inListView ? styledItem.parent : styledItem.parent.parent - property Item tumbler: tumblerItem ? tumblerItem.tumbler : null - property Item highlightItem: tumblerItem.highlightItem + property Item itemList: inListView ? styledItem.ListView.view : styledItem.PathView.view + property Item picker: styledItem.picker + property Item highlightItem: itemList.highlightItem Binding { target: styledItem + when: fadingEnabled property: "opacity" value: opacityCalc() } function opacityCalc() { - if (!tumbler || !highlightItem || (index === tumblerItem.currentIndex)) return 1.0; + if (!picker || !highlightItem || (index === itemList.currentIndex)) return 1.0; var highlightY = highlightItem.y; var delegateY = styledItem.y; if (inListView) { - highlightY -= tumblerItem.contentY; - delegateY -= tumblerItem.contentY; + highlightY -= itemList.contentY; + delegateY -= itemList.contentY; } - var midY = (delegateY + styledItem.height) / 2 + var midY = delegateY + styledItem.height / 2; if (delegateY < highlightY) { return MathUtils.clamp(MathUtils.projectValue(midY, 0, highlightY, minFade, maxFade), minFade, maxFade); } var highlightH = highlightY + highlightItem.height; if (delegateY >= highlightH) { delegateY -= highlightH; - midY = (delegateY + styledItem.height) / 2; + midY = delegateY + styledItem.height / 2; return MathUtils.clamp(1.0 - MathUtils.projectValue(midY, 0, highlightY, minFade, maxFade), minFade, maxFade); } return 1.0; diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Themes/Ambiance/PickerStyle.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Themes/Ambiance/PickerStyle.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Themes/Ambiance/PickerStyle.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Themes/Ambiance/PickerStyle.qml 2013-12-11 12:43:36.000000000 +0000 @@ -16,180 +16,110 @@ import QtQuick 2.0 import Ubuntu.Components 0.1 +import Ubuntu.Components.ListItems 0.1 -Rectangle { +Item { id: control // style properties - property color frameColor: UbuntuColors.warmGrey - property real frameWidth: 1 - property color backgroundColor: "#00000000" - property bool overlay: true - property color overlayColor: UbuntuColors.warmGrey - - // private properties - property bool completed: false - - border { - width: frameWidth - color: frameColor - } - color: backgroundColor - anchors.fill: parent + /*! + Specifies the background color + */ + property color backgroundColor: "#0A000000" + /*! + Background color for highlight. + */ + property color highlightBackgroundColor: "#ffffffff" + /*! + Highlight color. + */ + property color highlightColor: UbuntuColors.orange + /*! + Scale of the highlight item + */ + property real highlightScaleFactor: 1.15 + /*! + Thickness of the highlight component + */ + property real highlightThickness: units.gu(5) + + /*! + The content holder exposed to the Picker so tumbler list can be reparented to it. + */ + property alias tumblerHolder: content + + /*! + \internal + View instance listing the model + */ + property Item view: Item{} - function modelSize() { - return loader.item.model.hasOwnProperty("count") ? loader.item.model.count : loader.item.model.length; - } + anchors.fill: parent - function moveToIndex(toIndex) { - var count = (loader.item && loader.item.model) ? modelSize() : -1; - if (completed && count > 0) { - if (QuickUtils.className(loader.item) === "QQuickListView") { - loader.item.currentIndex = toIndex; - return; - } else { - loader.item.positionViewAtIndex(count - 1, PathView.Center); - loader.item.positionViewAtIndex(toIndex, PathView.Center); - } - } - } + // frame + UbuntuShape { + anchors.fill: parent + radius: "medium" + color: Theme.palette.normal.overlay + image: shapeSource + } + + ShaderEffectSource { + id: shapeSource + sourceItem: background + hideSource: true + // FIXME: visible: false prevents rendering so make it a nearly + // transparent 1x1 pixel instead + opacity: 0.01 + width: 1 + height: 1 + } + + Rectangle { + id: background + anchors.fill: parent - Component { - id: highlightComponent - Item { - width: parent ? parent.width : 0 - height: (parent && parent.currentItem) ? parent.currentItem.height : units.gu(4); - } - } - - // circular list - Component { - id: wrapAround - PathView { - id: pView - property Item tumbler: styledItem + MouseArea { anchors.fill: parent - clip: true - - model: styledItem.model - delegate: styledItem.delegate - highlight: highlightComponent - // put the currentItem to the center of the view - preferredHighlightBegin: 0.5 - preferredHighlightEnd: 0.5 - - pathItemCount: pView.height / highlightItem.height + 1 - snapMode: PathView.SnapToItem - flickDeceleration: 100 - - property int contentHeight: pathItemCount * highlightItem.height - path: Path { - startX: pView.width / 2 - startY: -(pView.contentHeight - pView.height) / 2 - PathLine { - x: pView.width / 2 - y: pView.height + (pView.contentHeight - pView.height) / 2 - } - } } - } - - // linear list - Component { - id: linear - ListView { - id: lView - property Item tumbler: styledItem + // background + color: backgroundColor + Item { + id: content anchors.fill: parent - clip: true - - model: styledItem.model - delegate: styledItem.delegate - - highlight: highlightComponent - preferredHighlightBegin: highlightItem ? (height - highlightItem.height) / 2 : 0 - preferredHighlightEnd: highlightItem ? (preferredHighlightBegin + highlightItem.height) : 0 - highlightRangeMode: ListView.StrictlyEnforceRange - highlightMoveDuration: 300 - flickDeceleration: 100 - } - } - - Loader { - id: loader - asynchronous: false - anchors { - fill: parent - margins: units.gu(0.2) - } - sourceComponent: (styledItem.circular) ? wrapAround : linear - - // to avoid binding loop - Connections { - target: styledItem - onSelectedIndexChanged: loader.item.currentIndex = styledItem.selectedIndex - } - - // live selectedIndex updater - Binding { - target: styledItem - property: "selectedIndex" - value: loader.item.currentIndex - when: completed && (styledItem.model !== undefined) && styledItem.live - } - // non-live selectedIndex updater - Connections { - target: loader.item - ignoreUnknownSignals: true - onMovementEnded: { - if (!styledItem.live) styledItem.selectedIndex = loader.item.currentIndex; - } - onCurrentIndexChanged: { - if (!styledItem.live && styledItem.__clickedIndex === loader.item.currentIndex) { - styledItem.selectedIndex = loader.item.currentIndex; - styledItem.__clickedIndex = -1; - } - } - onModelChanged: { - moveToIndex((completed) ? 0 : styledItem.selectedIndex); - if (completed && !styledItem.live) styledItem.selectedIndex = 0; - } } - Component.onCompleted: { - completed = true; - if (item) { - loader.item.currentIndex = styledItem.selectedIndex; - moveToIndex(styledItem.selectedIndex); + // highlight + Rectangle { + id: highlightItem + y: (content.height - control.highlightThickness) / 2 + anchors { + left: content.left + right: content.right + } + height: control.highlightThickness + color: highlightBackgroundColor + } + ThinDivider { + anchors { + left: content.left + right: content.right + bottom: highlightItem.top + } + } + ThinDivider { + anchors { + left: content.left + right: content.right + top: highlightItem.bottom } } - // overlay - Rectangle { - visible: control.overlay - gradient: Gradient { - GradientStop { - position: 0 - color: control.overlayColor - } - - GradientStop { - position: 0.40 - color: "#ffffff" - } - - GradientStop { - position: 0.63 - color: "#ffffff" - } - - GradientStop { - position: 1 - color: control.overlayColor - } - } - anchors.fill: parent + HighlightMagnifier { + sourceItem: view + anchors.fill: highlightItem + scaleFactor: control.highlightScaleFactor + outputColor: control.highlightColor } } - } diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Themes/Ambiance/ProgressionVisualStyle.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Themes/Ambiance/ProgressionVisualStyle.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Themes/Ambiance/ProgressionVisualStyle.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Themes/Ambiance/ProgressionVisualStyle.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,51 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Components 0.1 + +Item { + id: progressionVisualStyle + + property url progressionDividerSource: "artwork/progression_divider.png" + property url progressionIconSource: "artwork/chevron.png" + + implicitWidth: progressIcon.width + (styledItem.showSplit ? styledItem.splitMargin + progressionDivider.width : 0) + + Image { + id: progressIcon + source: progressionIconSource + anchors { + verticalCenter: parent.verticalCenter + right: parent.right + } + + opacity: enabled ? 1.0 : 0.5 + } + + Image { + id: progressionDivider + visible: styledItem.showSplit + anchors { + top: parent.top + bottom: parent.bottom + right: progressIcon.left + rightMargin: styledItem.splitMargin + } + source: progressionDividerSource + opacity: enabled ? 1.0 : 0.5 + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Themes/Ambiance/TabBarStyle.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Themes/Ambiance/TabBarStyle.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Themes/Ambiance/TabBarStyle.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Themes/Ambiance/TabBarStyle.qml 2013-12-11 12:43:36.000000000 +0000 @@ -19,6 +19,11 @@ Item { id: tabBarStyle + + // used to detect when the user is interacting with the tab bar by pressing it + // or dragging the tab bar buttons. + readonly property bool pressed: mouseArea.interacting + // styling properties, public API property color headerTextColor: Theme.palette.normal.backgroundText property color headerTextSelectedColor: Theme.palette.selected.backgroundText @@ -57,7 +62,7 @@ buttonView.selectButton(styledItem.selectedIndex); } - property ListModel tabsModel : styledItem ? styledItem.model : null + property var tabsModel : styledItem ? styledItem.model : null Connections { target: styledItem @@ -213,6 +218,17 @@ } } + onPressedChanged: { + // Catch release after a press with a delay that is too + // long to make it a click, but don't unset interacting when + // the user starts dragging. In that case it will be unset in + // buttonView.onDragEnded. + if (!pressed && !buttonView.dragging) { + // unset interacting which was set in mouseArea.onPressed + mouseArea.interacting = false; + } + } + // Select this button function select() { buttonView.selectedButtonIndex = button.buttonIndex; @@ -301,20 +317,37 @@ } } - onDragEnded: activatingTimer.stop() - - // deactivate the tab bar after inactivity - onMovementStarted: idleTimer.stop() - onMovementEnded: { - if (!styledItem.alwaysSelectionMode) { - idleTimer.restart(); - } + onDragEnded: { + // unset interacting which was set in mouseArea.onPressed + mouseArea.interacting = false; } + Timer { id: idleTimer interval: tabBarStyle.deactivateTime running: styledItem.selectionMode && !styledItem.alwaysSelectionMode onTriggered: styledItem.selectionMode = false + function conditionalRestartOrStop() { + if (Qt.application.active && + styledItem.selectionMode && + !styledItem.alwaysSelectionMode && + !mouseArea.interacting) { + idleTimer.restart(); + } else { + idleTimer.stop(); + } + } + } + + // disable the timer when the application is not active and reset + // it when the application is resumed. + Connections { + target: Qt.application + onActiveChanged: idleTimer.conditionalRestartOrStop() + } + Connections { + target: styledItem + onSelectionModeChanged: idleTimer.conditionalRestartOrStop() } } @@ -322,8 +355,17 @@ // a tabBar not in selection mode can be put in selection mode by pressing id: mouseArea anchors.fill: parent - enabled: !styledItem.selectionMode + + // set in onPressed, and unset in button.onPressedChanged or buttonView.onDragEnded + // because after not accepting the mouse, the released event will go to + // the buttonView or individual buttons. + property bool interacting: false + onInteractingChanged: idleTimer.conditionalRestartOrStop() + + // This MouseArea is always enabled, even when the tab bar is in selection mode, + // so that press events are detected and tabBarStyle.pressed is updated. onPressed: { + mouseArea.interacting = true; styledItem.selectionMode = true; mouse.accepted = false; } Binary files /tmp/279D_Msotj/ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Themes/Ambiance/artwork/progression_divider@18.png and /tmp/9Azr6_Bjjl/ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Themes/Ambiance/artwork/progression_divider@18.png differ diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Themes/Ambiance/qmldir ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Themes/Ambiance/qmldir --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Themes/Ambiance/qmldir 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Themes/Ambiance/qmldir 2013-12-11 12:43:36.000000000 +0000 @@ -24,3 +24,4 @@ PickerDelegateStyle 0.1 PickerDelegateStyle.qml DialerStyle 0.1 DialerStyle.qml DialerHandStyle 0.1 DialerHandStyle.qml +internal HighlightMagnifier HighlightMagnifier.qml diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Toolbar.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Toolbar.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/modules/Ubuntu/Components/Toolbar.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/modules/Ubuntu/Components/Toolbar.qml 2013-12-11 12:43:36.000000000 +0000 @@ -42,12 +42,7 @@ */ property Item tools: null - /*! - \preliminary - The time in milliseconds before the toolbar automatically hides after inactivity - when it is not locked. - */ - property int hideTimeout: 5000 + hideTimeout: 5000 /*! \internal */ onToolsChanged: { @@ -66,10 +61,6 @@ if (tools && tools.hasOwnProperty("opened")) { tools.opened = toolbar.opened; } - - if (!toolbar.locked) { - hideTimer.restart(); - } } else { // no tools locked = true; toolbar.close(); @@ -79,22 +70,10 @@ // if tools is not specified, lock the toolbar in closed position locked: tools && tools.hasOwnProperty("locked") ? tools.locked : false - Timer { - id: hideTimer - interval: toolbar.hideTimeout - running: toolbar.opened && !toolbar.locked - onTriggered: { - if (!toolbar.locked) { - toolbar.close(); - } - } - } - onOpenedChanged: { if (tools && tools.hasOwnProperty("opened")) { tools.opened = toolbar.opened; } - if (!toolbar.locked) hideTimer.restart(); } Connections { diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/ca.po ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/ca.po --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/ca.po 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/ca.po 2013-12-11 12:43:36.000000000 +0000 @@ -14,8 +14,8 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-11-28 06:06+0000\n" -"X-Generator: Launchpad (build 16847)\n" +"X-Launchpad-Export-Date: 2013-12-06 06:24+0000\n" +"X-Generator: Launchpad (build 16863)\n" #: examples/ubuntu-ui-toolkit-gallery/Animations.qml:22 msgid "NumberAnimation" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/de.po ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/de.po --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/de.po 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/de.po 2013-12-11 12:43:36.000000000 +0000 @@ -14,8 +14,8 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-11-28 06:06+0000\n" -"X-Generator: Launchpad (build 16847)\n" +"X-Launchpad-Export-Date: 2013-12-06 06:24+0000\n" +"X-Generator: Launchpad (build 16863)\n" #: examples/ubuntu-ui-toolkit-gallery/Animations.qml:22 msgid "NumberAnimation" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/es.po ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/es.po --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/es.po 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/es.po 2013-12-11 12:43:36.000000000 +0000 @@ -14,8 +14,8 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-11-28 06:06+0000\n" -"X-Generator: Launchpad (build 16847)\n" +"X-Launchpad-Export-Date: 2013-12-06 06:24+0000\n" +"X-Generator: Launchpad (build 16863)\n" #: examples/ubuntu-ui-toolkit-gallery/Animations.qml:22 msgid "NumberAnimation" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/fi.po ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/fi.po --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/fi.po 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/fi.po 2013-12-11 12:43:36.000000000 +0000 @@ -14,8 +14,8 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-11-28 06:06+0000\n" -"X-Generator: Launchpad (build 16847)\n" +"X-Launchpad-Export-Date: 2013-12-06 06:24+0000\n" +"X-Generator: Launchpad (build 16863)\n" #: examples/ubuntu-ui-toolkit-gallery/Animations.qml:22 msgid "NumberAnimation" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/fr.po ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/fr.po --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/fr.po 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/fr.po 2013-12-11 12:43:36.000000000 +0000 @@ -14,8 +14,8 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-11-28 06:06+0000\n" -"X-Generator: Launchpad (build 16847)\n" +"X-Launchpad-Export-Date: 2013-12-06 06:24+0000\n" +"X-Generator: Launchpad (build 16863)\n" #: examples/ubuntu-ui-toolkit-gallery/Animations.qml:22 msgid "NumberAnimation" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/gl.po ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/gl.po --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/gl.po 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/gl.po 2013-12-11 12:43:36.000000000 +0000 @@ -14,8 +14,8 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-11-28 06:06+0000\n" -"X-Generator: Launchpad (build 16847)\n" +"X-Launchpad-Export-Date: 2013-12-06 06:24+0000\n" +"X-Generator: Launchpad (build 16863)\n" #: examples/ubuntu-ui-toolkit-gallery/Animations.qml:22 msgid "NumberAnimation" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/he.po ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/he.po --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/he.po 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/he.po 2013-12-11 12:43:36.000000000 +0000 @@ -14,8 +14,8 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-11-28 06:06+0000\n" -"X-Generator: Launchpad (build 16847)\n" +"X-Launchpad-Export-Date: 2013-12-06 06:24+0000\n" +"X-Generator: Launchpad (build 16863)\n" #: examples/ubuntu-ui-toolkit-gallery/Animations.qml:22 msgid "NumberAnimation" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/ko.po ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/ko.po --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/ko.po 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/ko.po 2013-12-11 12:43:36.000000000 +0000 @@ -14,8 +14,8 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-11-28 06:06+0000\n" -"X-Generator: Launchpad (build 16847)\n" +"X-Launchpad-Export-Date: 2013-12-06 06:24+0000\n" +"X-Generator: Launchpad (build 16863)\n" #: examples/ubuntu-ui-toolkit-gallery/Animations.qml:22 msgid "NumberAnimation" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/my.po ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/my.po --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/my.po 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/my.po 2013-12-11 12:43:36.000000000 +0000 @@ -14,8 +14,8 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-11-28 06:06+0000\n" -"X-Generator: Launchpad (build 16847)\n" +"X-Launchpad-Export-Date: 2013-12-06 06:24+0000\n" +"X-Generator: Launchpad (build 16863)\n" #: examples/ubuntu-ui-toolkit-gallery/Animations.qml:22 msgid "NumberAnimation" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/nl.po ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/nl.po --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/nl.po 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/nl.po 2013-12-11 12:43:36.000000000 +0000 @@ -14,8 +14,8 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-11-28 06:06+0000\n" -"X-Generator: Launchpad (build 16847)\n" +"X-Launchpad-Export-Date: 2013-12-06 06:24+0000\n" +"X-Generator: Launchpad (build 16863)\n" #: examples/ubuntu-ui-toolkit-gallery/Animations.qml:22 msgid "NumberAnimation" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/oc.po ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/oc.po --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/oc.po 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/oc.po 2013-12-11 12:43:36.000000000 +0000 @@ -14,8 +14,8 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-11-28 06:06+0000\n" -"X-Generator: Launchpad (build 16847)\n" +"X-Launchpad-Export-Date: 2013-12-06 06:24+0000\n" +"X-Generator: Launchpad (build 16863)\n" #: examples/ubuntu-ui-toolkit-gallery/Animations.qml:22 msgid "NumberAnimation" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/sv.po ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/sv.po --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/po/sv.po 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/po/sv.po 2013-12-11 12:43:36.000000000 +0000 @@ -14,8 +14,8 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2013-11-28 06:06+0000\n" -"X-Generator: Launchpad (build 16847)\n" +"X-Launchpad-Export-Date: 2013-12-06 06:24+0000\n" +"X-Generator: Launchpad (build 16863)\n" #: examples/ubuntu-ui-toolkit-gallery/Animations.qml:22 msgid "NumberAnimation" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py 2013-12-11 12:43:36.000000000 +0000 @@ -181,7 +181,8 @@ def setUp(self): super(ToolbarTestCase, self).setUp() self.toolbar = self.main_view.get_toolbar() - self.assertFalse(self.toolbar.opened) + # toolbar may be opened or closed now, depending on whether + # the application has been deactivated and resumed already def test_open_toolbar(self): self.toolbar.open() @@ -204,6 +205,7 @@ self.assertFalse(self.toolbar.animating) def test_closed_toolbar_is_not_closed_again(self): + self.toolbar.close() with mock.patch.object( self.main_view.pointing_device, 'drag') as mock_drag: self.toolbar.close() @@ -212,6 +214,7 @@ self.assertFalse(self.toolbar.opened) def test_click_toolbar_button(self): + self.toolbar.close() label = self.app.select_single('Label', objectName='clicked_label') self.assertNotEqual(label.text, 'Button clicked.') self.toolbar.open() @@ -227,6 +230,7 @@ str(error), 'Button with objectName "unexisting" not found.') def test_click_button_on_closed_toolbar(self): + self.toolbar.close() error = self.assertRaises( emulators.ToolkitEmulatorException, self.toolbar.click_button, 'buttonName') diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/qmlapicheck.py ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/qmlapicheck.py --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/qmlapicheck.py 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/qmlapicheck.py 2013-12-11 12:43:36.000000000 +0000 @@ -28,18 +28,50 @@ ' Generate a QML API file\n' 'Example:\n' ' env BUILTINS=QQuick,QQml,U1db:: ' - '%s modules/Ubuntu/Components/*.qml plugins.qmltypes' + '%s modules/Ubuntu/Components/qmldir plugins.qmltypes' ' > components.api.new\n' + '\n' + ' It is recommended to pass qmldir files over a list of qml files\n' + ' because then internal components are discarded and errors in that\n' + ' list can be found.\n' + ' For testing one can pass qml files also directly or serve them\n' + ' via standard input.\n' + ' The variable BUILTINS is a comma-separated list of prefixes for\n' + ' API that appears in qmltypes files but not part of the same\n' + ' package.\n' + '\n' + 'Use the following command to see changes in the API:\n' ' diff -Fqml -u components.api{,.new}\n' % (basename, basename)) sys.exit(1) builtins = os.getenv('BUILTINS', '').split(',') +inputfiles = [] for line in fileinput.input(): + if fileinput.filename()[-6:] == 'qmldir': + if line[:8] == 'internal': + # Internal components are not part of public API + continue + pieces = line.strip().split(' ') + if len(pieces) > 2: + filename = pieces[2] + # We only work with QML + if filename[-3:] == 'qml': + # Filenames are relative to the qmldir + # Foo 1.0 Foo.qml + folder = os.path.dirname(fileinput.filename()) + inputfiles.append(folder + '/' + filename) + else: + inputfiles.append(fileinput.filename()) + fileinput.nextfile() + +inputfiles.sort() +for line in fileinput.input(inputfiles): # New file if fileinput.isfirstline(): in_block = 0 in_comment = in_builtin_type = False - annotated_type = None + block_meta = {} + annotated_properties = {} if fileinput.filename()[-3:] == 'qml': filetype = 'qml' keywords = ['signal', 'property', 'function'] @@ -58,9 +90,16 @@ line = line.split('//')[0] # alias properties only define their type through qdoc comments if '\\qmlproperty' in line: - annotated_type = line + words = line.strip().split(' ') + name = words[2] + # Strip namespace + if '::' in name: + name = name.split('::')[1] + type = words[1] + annotated_properties[name] = type elif '\\internal' in line: - annotated_type = 'internal internal internal' + # internal without type always relates to the next declared property + annotated_properties['internal'] = 'internal' if '/*' in line and not '*/' in line: in_comment = True @@ -79,6 +118,7 @@ # End of function/ signal/ Item block if '}' in line: in_block -= 1 + block_meta = {} if in_block == 1 and in_builtin_type: in_builtin_type = False continue @@ -89,7 +129,7 @@ declaration = line.split(':')[0] words = declaration.strip().split(' ') # Skip types with prefixes considered builtin - if words[0] == 'name': + if filetype == 'qmltypes' and words[0] == 'name': found_builtin_type = False for builtin in builtins: if '"' + builtin in line: @@ -98,6 +138,15 @@ if found_builtin_type: in_builtin_type = True continue + if 'prototype' in block_meta: + print(' ' + block_meta['prototype'].strip()) + print(' ' + line.strip()) + continue + + block_meta[words[0]] = line + # Omit prototype if it comes before the name since we may skip it + if not 'name' in block_meta and words[0] == 'prototype': + continue # Don't consider the qml variable name as a keyword if filetype == 'qml': @@ -111,13 +160,20 @@ if filetype == 'qml': signature = declaration.split('{')[0].strip() if 'alias' in line: - if not annotated_type: + no_mods = signature + for mod in ['readonly', 'default']: + no_mods = no_mods.replace(mod, '') + name = no_mods.strip().split(' ')[2] + if 'internal' in annotated_properties: + if not name in annotated_properties: + annotated_properties[name] = 'internal' + del annotated_properties['internal'] + if not name in annotated_properties: print(' %s' % (signature)) - print('Error: Missing \\qmlproperty annotation') + print('Error: Missing \\qmlproperty for %s' % name) sys.exit(1) - real_type = annotated_type.strip().split(' ')[1] + real_type = annotated_properties[name] signature = signature.replace('alias', real_type) - annotated_type = None elif filetype == 'qmltypes': signature = line.strip() if not in_builtin_type: @@ -127,6 +183,7 @@ # Start of function/ signal/ Item block if '{' in line: in_block += 1 + block_meta = {} # The parent type can affect API if in_block == 1 and filetype == 'qml': print(line.split('{')[0].strip()) diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/resources/pickers/PickerTest.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/resources/pickers/PickerTest.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/resources/pickers/PickerTest.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/resources/pickers/PickerTest.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * Copyright 2012 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Components 0.1 +import Ubuntu.Components.Pickers 0.1 + +Row { + ListModel { + id: pickerModel + Component.onCompleted: { + for (var i = 0; i < 100; i++) { + append({"label": "Item #"+i}); + } + } + } + + Picker { + height: units.gu(40) + model: pickerModel + delegate: PickerDelegate { + Label { + anchors.fill: parent + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + text: modelData + } + } + } + + Picker { + height: units.gu(40) + model: pickerModel + circular: false + delegate: PickerDelegate { + Label { + anchors.fill: parent + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + text: modelData + } + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/add_qmlmakecheck.pri ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/add_qmlmakecheck.pri --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/add_qmlmakecheck.pri 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/add_qmlmakecheck.pri 2013-12-11 12:43:36.000000000 +0000 @@ -9,5 +9,6 @@ } check.commands += cd ../../..; check.commands += qmlplugindump Ubuntu.Components 0.1 modules > plugins.qmltypes; -check.commands += BUILTINS=QQuick,QQml,U1db:: python tests/qmlapicheck.py modules/Ubuntu/Components/*.qml modules/Ubuntu/Components/*/*.qml plugins.qmltypes > components.api.new; +# Palette gets included in Qt 5.2 qmlplugindump even though it's qml +check.commands += BUILTINS=QQuick,QQml,U1db::,Palette python tests/qmlapicheck.py modules/Ubuntu/Components/qmldir modules/Ubuntu/Components/Colors/UbuntuColors.qml modules/Ubuntu/Components/*/qmldir plugins.qmltypes > components.api.new; check.commands += diff -Fqml -u components.api components.api.new || exit 1; cd tests/unit diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/layout_dependency.pri ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/layout_dependency.pri --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/layout_dependency.pri 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/layout_dependency.pri 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -COMPONENTS_PATH = ../../../modules/Ubuntu/Layouts -INCLUDEPATH += $$COMPONENTS_PATH/plugin -PRE_TARGETDEPS = $$COMPONENTS_PATH/libUbuntuLayouts.so -LIBS += $$COMPONENTS_PATH/libUbuntuLayouts.so -DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$_PRO_FILE_PWD_\\\"\" - -components.target = $$PRE_TARGETDEPS -components.commands = cd $$COMPONENTS_PATH/plugin && $(QMAKE) && make -QMAKE_EXTRA_TARGETS += components diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/test-include.pri ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/test-include.pri --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/test-include.pri 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/test-include.pri 2013-12-11 12:43:36.000000000 +0000 @@ -1,5 +1,4 @@ include( plugin_dependency.pri ) -include( layout_dependency.pri ) include( add_makecheck.pri ) TEMPLATE = app diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_arguments/tst_arguments.cpp ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_arguments/tst_arguments.cpp --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_arguments/tst_arguments.cpp 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_arguments/tst_arguments.cpp 2013-12-11 12:43:36.000000000 +0000 @@ -482,6 +482,38 @@ } }; -QTEST_MAIN(tst_UCArguments) +// Do not use QTEST_MAIN. QTEST_MAIN is 99.99% of the times what you +// want when running a Qt testcase but it creates a Q*Application and in +// this case that is not wanted since we are creating and destroying them as +// part of the test and Qt doesn't like when there's more than one Q*Application +// at the same time, so do without creating a Q*Application in main. +// This can of course have some implications but it seems that +// for this testcase all is fine. +int main(int argc, char *argv[]) +{ + int myArgc = argc; + char **myArgv = new char*[argc + 1]; + // Eat -platform xyz, we're just using QCoreApplications here so + // no need to say the gui platform to use + // We are techically leaking the myArgv char** and it's strdup'ed contents + // but it happens the binary just finishes after, so not a problem + int j = 0; + for (int i = 0; i < argc; i++) { + if (argv[i] == QString("-platform")) { + if (i < argc) { + i++; // skip also the platform value + myArgc -= 2; + } else { + myArgc -= 1; + } + } else { + myArgv[j] = strdup(argv[i]); + j++; + } + } + myArgv[myArgc] = 0; + tst_UCArguments tc; + return QTest::qExec(&tc, myArgc, myArgv); +} #include "tst_arguments.moc" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorAll.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorAll.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorAll.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorAll.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 300 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "landscape" - when: root.width > root.height - ItemLayout { - objectName: "testLayout" - anchors.fill: parent - item: "test" - } - } - ] - - Rectangle { - width: 100 - height: 100 - color: "red" - objectName: "testItem" - Layouts.item: "test" - anchors.left: parent.left - anchors.top: parent.top - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.margins: 20 - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorBottom.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorBottom.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorBottom.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorBottom.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 300 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "landscape" - when: root.width > root.height - ItemLayout { - objectName: "testLayout" - anchors.fill: parent - item: "test" - } - } - ] - - Rectangle { - width: 100 - height: 100 - color: "red" - objectName: "testItem" - Layouts.item: "test" - anchors.bottom: parent.bottom - anchors.bottomMargin: 10 - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorCenterWithOffset.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorCenterWithOffset.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorCenterWithOffset.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorCenterWithOffset.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 300 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "landscape" - when: root.width > root.height - ItemLayout { - objectName: "testLayout" - anchors.fill: parent - item: "test" - } - } - ] - - Rectangle { - width: 100 - height: 100 - color: "red" - objectName: "testItem" - Layouts.item: "test" - anchors.centerIn: parent - anchors.verticalCenterOffset: 50 - anchors.horizontalCenterOffset: 40 - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorCenteredInDefault.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorCenteredInDefault.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorCenteredInDefault.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorCenteredInDefault.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 300 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "landscape" - when: root.width > root.height - ItemLayout { - objectName: "testLayout" - anchors.fill: parent - item: "test" - } - } - ] - - Rectangle { - width: 100 - height: 100 - color: "red" - objectName: "testItem" - Layouts.item: "test" - anchors.centerIn: parent - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorFilledMargins.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorFilledMargins.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorFilledMargins.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorFilledMargins.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 300 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "landscape" - when: root.width > root.height - ItemLayout { - objectName: "testLayout" - anchors.fill: parent - item: "test" - } - } - ] - - Rectangle { - color: "red" - objectName: "testItem" - Layouts.item: "test" - anchors.fill: parent - anchors.margins: 10 - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorFilledReparenting.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorFilledReparenting.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorFilledReparenting.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorFilledReparenting.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 300 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "landscape" - when: root.width > root.height - ItemLayout { - objectName: "testLayout" - anchors.fill: parent - item: "test" - } - } - ] - - Rectangle { - color: "red" - objectName: "testItem" - Layouts.item: "test" - anchors.fill: parent - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorFilledSeparateMargins.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorFilledSeparateMargins.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorFilledSeparateMargins.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorFilledSeparateMargins.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 300 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "landscape" - when: root.width > root.height - ItemLayout { - objectName: "testLayout" - anchors.fill: parent - item: "test" - } - } - ] - - Rectangle { - color: "red" - objectName: "testItem" - Layouts.item: "test" - anchors.fill: parent - anchors.leftMargin: 10 - anchors.topMargin: 20 - anchors.rightMargin: 30 - anchors.bottomMargin: 40 - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorHorizontalCenter.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorHorizontalCenter.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorHorizontalCenter.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorHorizontalCenter.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 300 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "landscape" - when: root.width > root.height - ItemLayout { - objectName: "testLayout" - anchors.fill: parent - item: "test" - } - } - ] - - Rectangle { - width: 100 - height: 100 - color: "red" - objectName: "testItem" - Layouts.item: "test" - anchors.horizontalCenter: parent.horizontalCenter - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorHorizontalCenterOffset.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorHorizontalCenterOffset.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorHorizontalCenterOffset.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorHorizontalCenterOffset.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 300 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "landscape" - when: root.width > root.height - ItemLayout { - objectName: "testLayout" - anchors.fill: parent - item: "test" - } - } - ] - - Rectangle { - width: 100 - height: 100 - color: "red" - objectName: "testItem" - Layouts.item: "test" - anchors.horizontalCenter: parent.horizontalCenter - anchors.horizontalCenterOffset: 50.0 - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorLeft.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorLeft.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorLeft.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorLeft.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 300 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "landscape" - when: root.width > root.height - ItemLayout { - objectName: "testLayout" - anchors.fill: parent - item: "test" - } - } - ] - - Rectangle { - width: 100 - height: 100 - color: "red" - objectName: "testItem" - Layouts.item: "test" - anchors.left: parent.left - anchors.leftMargin: 10 - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorRight.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorRight.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorRight.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorRight.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 300 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "landscape" - when: root.width > root.height - ItemLayout { - objectName: "testLayout" - anchors.fill: parent - item: "test" - } - } - ] - - Rectangle { - width: 100 - height: 100 - color: "red" - objectName: "testItem" - Layouts.item: "test" - anchors.right: parent.right - anchors.rightMargin: 10 - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorTop.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorTop.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorTop.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorTop.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 300 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "landscape" - when: root.width > root.height - ItemLayout { - objectName: "testLayout" - anchors.fill: parent - item: "test" - } - } - ] - - Rectangle { - width: 100 - height: 100 - color: "red" - objectName: "testItem" - Layouts.item: "test" - anchors.top: parent.top - anchors.topMargin: 10 - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorVerticalCenter.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorVerticalCenter.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorVerticalCenter.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorVerticalCenter.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 300 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "landscape" - when: root.width > root.height - ItemLayout { - objectName: "testLayout" - anchors.fill: parent - item: "test" - } - } - ] - - Rectangle { - width: 100 - height: 100 - color: "red" - objectName: "testItem" - Layouts.item: "test" - anchors.verticalCenter: parent.verticalCenter - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorVerticalCenterOffset.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorVerticalCenterOffset.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/AnchorVerticalCenterOffset.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/AnchorVerticalCenterOffset.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 300 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "landscape" - when: root.width > root.height - ItemLayout { - objectName: "testLayout" - anchors.fill: parent - item: "test" - } - } - ] - - Rectangle { - width: 100 - height: 100 - color: "red" - objectName: "testItem" - Layouts.item: "test" - anchors.verticalCenter: parent.verticalCenter - anchors.verticalCenterOffset: 50 - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/CurrentLayoutChange.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/CurrentLayoutChange.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/CurrentLayoutChange.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/CurrentLayoutChange.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 360 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - - layouts: [ - ConditionalLayout { - name: "portrait" - when: root.width < root.height - }, - - ConditionalLayout { - name: "landscape" - when: root.width >= root.height - } - ] - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/DefaultLayout.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/DefaultLayout.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/DefaultLayout.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/DefaultLayout.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Components 0.1 -import Ubuntu.Layouts 0.1 - -Item { - objectName: "defaultLayout" - anchors.fill: parent - Label { - objectName: "item1" - id: label1 - Layouts.item: "item1" - text: "item1" - } - Label { - objectName: "item2" - id: label2 - anchors.bottom: label1.bottom - Layouts.item: "item2" - text: "item2" - } - Label { - objectName: "item3" - id: label3 - anchors.bottom: label2.bottom - Layouts.item: "item3" - text: "item3" - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/ExternalLayouts.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/ExternalLayouts.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/ExternalLayouts.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/ExternalLayouts.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Components 0.1 -import Ubuntu.Layouts 0.1 - -Item { - id: root - width: units.gu(40) - height: units.gu(30) - - Layouts { - objectName: "layouts" - id: layouts - anchors.fill: parent - layouts: [ - SmallLayout{}, - MediumLayout {}, - LargeLayout {} - ] - - // default layout - DefaultLayout{ - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/LaidOutItemsOutsideOfLayout.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/LaidOutItemsOutsideOfLayout.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/LaidOutItemsOutsideOfLayout.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/LaidOutItemsOutsideOfLayout.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 360 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "portrait" - when: root.width < root.height - - ItemLayout { - item: "red" - anchors.right: parent.right - anchors.bottom: parent.bottom - } - } - ] - } - - Rectangle { - objectName: "itemLaidOut" - width: 40 - height: 30 - color: "red" - Layouts.item: "red" - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/LargeLayout.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/LargeLayout.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/LargeLayout.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/LargeLayout.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Components 0.1 -import Ubuntu.Layouts 0.1 - -ConditionalLayout { - name: "large" - when: layouts.width > units.gu(60) - Row { - anchors.fill: parent - ItemLayout { - item: "item1" - } - ItemLayout { - item: "item2" - } - ItemLayout { - item: "item3" - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/MediumLayout.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/MediumLayout.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/MediumLayout.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/MediumLayout.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Components 0.1 -import Ubuntu.Layouts 0.1 - -ConditionalLayout { - name: "medium" - when: layouts.width > units.gu(40) && layouts.width <= units.gu(60) - Flow { - anchors.fill: parent - ItemLayout { - item: "item1" - } - ItemLayout { - item: "item2" - } - ItemLayout { - item: "item3" - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/NestedLayouts.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/NestedLayouts.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/NestedLayouts.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/NestedLayouts.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Components 0.1 -import Ubuntu.Layouts 0.1 - -Item { - id: root - width: units.gu(40) - height: units.gu(30) - - property string nestedLayout: "" - - Layouts { - objectName: "layouts" - id: layouts - anchors.fill: parent - layouts: [ - ConditionalLayout { - name: "extra-large" - when: layouts.width > units.gu(80) - Item { - anchors.fill: parent - Item { - id: header - ItemLayout { - item: "item3" - } - } - Row { - anchors.fill: parent - anchors.topMargin: header.height - ItemLayout { - item: "item1" - } - ItemLayout { - item: "item2" - } - } - } - }, - ConditionalLayout { - name: "simple" - when: layouts.width <= units.gu(100) - SimpleLayouts{ - id: nested - anchors.fill: parent - onCurrentLayoutChanged: root.nestedLayout = nested.currentLayout - } - } - ] - - // default layout - DefaultLayout{ - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/NoLayouts.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/NoLayouts.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/NoLayouts.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/NoLayouts.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Components 0.1 -import Ubuntu.Layouts 0.1 - -Item { - id: root - width: units.gu(40) - height: units.gu(30) - - Layouts { - objectName: "layouts" - id: layouts - anchors.fill: parent - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/OverlaidInItemLayout.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/OverlaidInItemLayout.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/OverlaidInItemLayout.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/OverlaidInItemLayout.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 300 - height: 360 - - Layouts { - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "portrait" - when: root.width < root.height - - ItemLayout { - objectName: "layout" - item: "red" - x: 20 - y: 30 - width: 40 - height: 30 - - Rectangle { - objectName: "overlay" - width: 10 - height: 10 - color: "green" - z: 100 - } - } - } - ] - - Rectangle { - objectName: "hostedItem" - id: red - width: 40 - height: 30 - color: "red" - Layouts.item: "red" - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/OverlappingCondition.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/OverlappingCondition.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/OverlappingCondition.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/OverlappingCondition.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Components 0.1 -import Ubuntu.Layouts 0.1 - -Item { - id: root - width: units.gu(40) - height: units.gu(30) - - Layouts { - objectName: "layouts" - id: layouts - anchors.fill: parent - layouts: [ - ConditionalLayout { - name: "small" - when: layouts.width <= units.gu(40) - Column { - anchors.fill: parent - ItemLayout { - item: "item1" - } - ItemLayout { - item: "item2" - } - ItemLayout { - item: "item3" - } - } - }, - ConditionalLayout { - name: "medium" - when: layouts.width >= units.gu(40) && layouts.width <= units.gu(60) - Flow { - anchors.fill: parent - ItemLayout { - item: "item1" - } - ItemLayout { - item: "item2" - } - ItemLayout { - item: "item3" - } - } - } - ] - - DefaultLayout{ - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/PositioningOnLayoutChange.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/PositioningOnLayoutChange.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/PositioningOnLayoutChange.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/PositioningOnLayoutChange.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Layouts 0.1 - -Rectangle { - id: root - width: 360 - height: 360 - - Layouts { - objectName: "layoutManager" - id: layoutManager - anchors.fill: parent - - layouts: [ - ConditionalLayout { - name: "portrait" - when: root.width < root.height - - ItemLayout { - item: "red" - anchors.right: parent.right - anchors.bottom: parent.bottom - } - }, - - ConditionalLayout { - name: "landscape" - when: root.width >= root.height - } - ] - - Rectangle { anchors.fill: parent; color: 'yellow'} - - Rectangle { - width: 40 - height: 30 - color: "red" - Layouts.item: "red" - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/ResizingContainers.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/ResizingContainers.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/ResizingContainers.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/ResizingContainers.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Components 0.1 -import Ubuntu.Layouts 0.1 - -Item { - id: root - width: units.gu(40) - height: units.gu(30) - - property alias currentLayout: layouts.currentLayout - - Layouts { - objectName: "layouts" - id: layouts - anchors.fill: parent - layouts: [ - ConditionalLayout { - name: "xlarge" - when: layouts.width >= units.gu(80) - Column { - anchors.fill: parent - ItemLayout { - item: "item1" - width: units.gu(30) - height: units.gu(30) - } - ItemLayout { - item: "item3" - width: units.gu(30) - height: units.gu(30) - } - ItemLayout { - item: "item2" - width: units.gu(40) - height: units.gu(50) - } - } - }, - ConditionalLayout { - name: "large" - when: layouts.width >= units.gu(60) - Column { - anchors.fill: parent - ItemLayout { - item: "item1" - width: units.gu(22) - height: units.gu(22) - } - ItemLayout { - item: "item2" - width: units.gu(22) - height: units.gu(22) - } - ItemLayout { - item: "item3" - width: units.gu(22) - height: units.gu(22) - } - } - }, - ConditionalLayout { - name: "small" - when: layouts.width > units.gu(40) - Row { - anchors.fill: parent - ItemLayout { - item: "item1" - width: units.gu(10) - height: units.gu(10) - } - ItemLayout { - item: "item2" - width: units.gu(10) - height: units.gu(10) - } - ItemLayout { - item: "item3" - width: units.gu(10) - height: units.gu(10) - } - } - } - ] - - // default layout - SizedDefaultLayout{ - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/SimpleLayouts.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/SimpleLayouts.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/SimpleLayouts.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/SimpleLayouts.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Components 0.1 -import Ubuntu.Layouts 0.1 - -Item { - id: root - width: units.gu(40) - height: units.gu(30) - - property alias currentLayout: layouts.currentLayout - - Layouts { - objectName: "layouts" - id: layouts - anchors.fill: parent - layouts: [ - ConditionalLayout { - name: "small" - when: layouts.width <= units.gu(40) - Column { - anchors.fill: parent - ItemLayout { - item: "item1" - } - ItemLayout { - item: "item2" - } - ItemLayout { - item: "item3" - } - } - }, - ConditionalLayout { - name: "medium" - when: layouts.width > units.gu(40) && layouts.width <= units.gu(60) - Flow { - anchors.fill: parent - ItemLayout { - item: "item1" - } - ItemLayout { - item: "item2" - } - ItemLayout { - item: "item3" - } - } - }, - ConditionalLayout { - name: "large" - when: layouts.width > units.gu(60) - Row { - anchors.fill: parent - ItemLayout { - item: "item1" - } - ItemLayout { - item: "item2" - } - ItemLayout { - item: "item3" - } - } - } - ] - - // default layout - DefaultLayout{ - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/SizedDefaultLayout.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/SizedDefaultLayout.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/SizedDefaultLayout.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/SizedDefaultLayout.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Components 0.1 -import Ubuntu.Layouts 0.1 - -Item { - objectName: "defaultLayout" - anchors.fill: parent - Button { - objectName: "item1" - id: label1 - Layouts.item: "item1" - text: "item1" - anchors { - left: parent.left - right: parent.right - } - } - Button { - objectName: "item2" - id: label2 - anchors.bottom: label1.bottom - Layouts.item: "item2" - text: "item2" - anchors { - left: parent.left - top: label1.bottom - right: parent.right - } - } - Button { - objectName: "item3" - id: label3 - anchors.bottom: label2.bottom - Layouts.item: "item3" - text: "item3" - anchors { - left: parent.left - top: label2.bottom - right: parent.right - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/SmallLayout.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/SmallLayout.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/SmallLayout.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/SmallLayout.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.0 -import Ubuntu.Components 0.1 -import Ubuntu.Layouts 0.1 - -ConditionalLayout { - name: "small" - when: layouts.width <= units.gu(40) - Column { - anchors.fill: parent - ItemLayout { - item: "item1" - } - ItemLayout { - item: "item2" - } - ItemLayout { - item: "item3" - } - } -} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/tst_layouts.cpp ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/tst_layouts.cpp --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/tst_layouts.cpp 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/tst_layouts.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,800 +0,0 @@ -/* - * Copyright 2012 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "ullayouts.h" -#include "ucunits.h" -#include -#include - -#define QCOMPARE_RET(actual, expected) \ -do {\ - if (!QTest::qCompare(actual, expected, #actual, #expected, __FILE__, __LINE__))\ - return false;\ -} while (0) - -#define QVERIFY_RET(statement, resturns) \ -do {\ - if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__))\ - return resturns;\ -} while (0) - - -class tst_Layouts : public QObject -{ - Q_OBJECT -private: - QQuickView *view; - -public: - - tst_Layouts() : - view(0) - { - } - - QQuickItem *loadTest(const QString &document) - { - // load the document - view->setSource(QUrl::fromLocalFile(document)); - QTest::waitForEvents(); - - return view->rootObject(); - } - - QQuickItem *testItem(QQuickItem *that, const QString &identifier) - { - if (that->property(identifier.toLocal8Bit()).isValid()) - return that->property(identifier.toLocal8Bit()).value(); - - QList children = that->findChildren(identifier); - return (children.count() > 0) ? children[0] : 0; - } - - -private Q_SLOTS: - void initTestCase() - { - QString modules("../../../modules"); - QVERIFY(QDir(modules).exists()); - - view = new QQuickView; - QQmlEngine *quickEngine = view->engine(); - - view->setGeometry(0,0, UCUnits::instance().gu(40), UCUnits::instance().gu(30)); - //add modules folder so we have access to the plugin from QML - QStringList imports = quickEngine->importPathList(); - imports.prepend(QDir(modules).absolutePath()); - quickEngine->setImportPathList(imports); - } - - void cleanupTestCase() - { - delete view; - } - - void testCase_NoLayouts() - { - QQuickItem *root = loadTest("NoLayouts.qml"); - QVERIFY(root); - - ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); - QVERIFY(layouts); - - QVERIFY(layouts->layoutList().isEmpty()); - } - - void testCase_SimpleLayout() - { - QQuickItem *root = loadTest("SimpleLayouts.qml"); - QVERIFY(root); - - ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); - QVERIFY(layouts); - QVERIFY(!layouts->layoutList().isEmpty()); - - QCOMPARE(layouts->currentLayout(), QString("small")); - - QQuickItem *item = testItem(root, "item1"); - QVERIFY(item); - QVERIFY(item->parentItem()->parentItem()->inherits("QQuickColumn")); - - item = testItem(root, "item2"); - QVERIFY(item); - QVERIFY(item->parentItem()->parentItem()->inherits("QQuickColumn")); - - item = testItem(root, "item3"); - QVERIFY(item); - QVERIFY(item->parentItem()->parentItem()->inherits("QQuickColumn")); - } - - void testCase_SimpleLayout_Medium() - { - QQuickItem *root = loadTest("SimpleLayouts.qml"); - QVERIFY(root); - - ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); - QVERIFY(layouts); - QVERIFY(!layouts->layoutList().isEmpty()); - root->setWidth(UCUnits::instance().gu(55)); - QCOMPARE(root->width(), UCUnits::instance().gu(55)); - QTest::waitForEvents(); - - QCOMPARE(layouts->currentLayout(), QString("medium")); - - QQuickItem *item = testItem(root, "item1"); - QVERIFY(item); - QVERIFY(item->parentItem()->parentItem()->inherits("QQuickFlow")); - - item = testItem(root, "item2"); - QVERIFY(item); - QVERIFY(item->parentItem()->parentItem()->inherits("QQuickFlow")); - - item = testItem(root, "item3"); - QVERIFY(item); - QVERIFY(item->parentItem()->parentItem()->inherits("QQuickFlow")); - } - - void testCase_SimpleLayout_Large() - { - QQuickItem *root = loadTest("SimpleLayouts.qml"); - QVERIFY(root); - - ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); - QVERIFY(layouts); - QVERIFY(!layouts->layoutList().isEmpty()); - root->setWidth(UCUnits::instance().gu(65)); - QCOMPARE(root->width(), UCUnits::instance().gu(65)); - QTest::waitForEvents(); - - QCOMPARE(layouts->currentLayout(), QString("large")); - - QQuickItem *item = testItem(root, "item1"); - QVERIFY(item); - QVERIFY(item->parentItem()->parentItem()->inherits("QQuickRow")); - - item = testItem(root, "item2"); - QVERIFY(item); - QVERIFY(item->parentItem()->parentItem()->inherits("QQuickRow")); - - item = testItem(root, "item3"); - QVERIFY(item); - QVERIFY(item->parentItem()->parentItem()->inherits("QQuickRow")); - } - - void testCase_OverlappingCondition() - { - QQuickItem *root = loadTest("OverlappingCondition.qml"); - QVERIFY(root); - - ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); - QVERIFY(layouts); - QVERIFY(!layouts->layoutList().isEmpty()); - - QCOMPARE(layouts->currentLayout(), QString("small")); - } - - void testCase_ExternalLayouts() - { - QQuickItem *root = loadTest("ExternalLayouts.qml"); - QVERIFY(root); - - ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); - QVERIFY(layouts); - QVERIFY(!layouts->layoutList().isEmpty()); - - QCOMPARE(layouts->currentLayout(), QString("small")); - } - - void testCase_ExternalLayouts_Medium() - { - QQuickItem *root = loadTest("ExternalLayouts.qml"); - QVERIFY(root); - - ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); - QVERIFY(layouts); - QVERIFY(!layouts->layoutList().isEmpty()); - root->setWidth(UCUnits::instance().gu(55)); - - QCOMPARE(layouts->currentLayout(), QString("medium")); - } - - void testCase_ExternalLayouts_Large() - { - QQuickItem *root = loadTest("ExternalLayouts.qml"); - QVERIFY(root); - - ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); - QVERIFY(layouts); - QVERIFY(!layouts->layoutList().isEmpty()); - root->setWidth(UCUnits::instance().gu(65)); - - QCOMPARE(layouts->currentLayout(), QString("large")); - } - - void testCase_NestedLayouts() - { - QQuickItem *root = loadTest("NestedLayouts.qml"); - QVERIFY(root); - - ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); - QVERIFY(layouts); - QVERIFY(!layouts->layoutList().isEmpty()); - - QCOMPARE(layouts->currentLayout(), QString("simple")); - } - - void testCase_NestedLayouts_ExtraLarge() - { - QQuickItem *root = loadTest("NestedLayouts.qml"); - QVERIFY(root); - - ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); - QVERIFY(layouts); - QVERIFY(!layouts->layoutList().isEmpty()); - root->setWidth(UCUnits::instance().gu(90)); - QTest::waitForEvents(); - - QCOMPARE(layouts->currentLayout(), QString("extra-large")); - - root->setWidth(UCUnits::instance().gu(50)); - QTest::waitForEvents(); - - QCOMPARE(root->property("nestedLayout").toString(), QString("medium")); - } - - void testCase_ResizingContainers() - { - QQuickItem *root = loadTest("ResizingContainers.qml"); - QVERIFY(root); - - // fetch the current size of one item - QQuickItem *item = testItem(root, "item1"); - qreal width = item->width(); - qreal height = item->height(); - QQuickItem *item2 = testItem(root, "item2"); - qreal width2 = item2->width(); - qreal height2 = item2->height(); - - ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); - QVERIFY(layouts); - QVERIFY(!layouts->layoutList().isEmpty()); - - root->setWidth(UCUnits::instance().gu(50)); - QTest::waitForEvents(); - QCOMPARE(layouts->currentLayout(), QString("small")); - QCOMPARE(item->width(), UCUnits::instance().gu(10)); - QCOMPARE(item->height(), UCUnits::instance().gu(10)); - - root->setWidth(UCUnits::instance().gu(60)); - QTest::waitForEvents(); - QCOMPARE(layouts->currentLayout(), QString("large")); - QCOMPARE(item->width(), UCUnits::instance().gu(22)); - QCOMPARE(item->height(), UCUnits::instance().gu(22)); - - root->setWidth(UCUnits::instance().gu(80)); - QTest::waitForEvents(); - QCOMPARE(layouts->currentLayout(), QString("xlarge")); - QCOMPARE(item->width(), UCUnits::instance().gu(30)); - QCOMPARE(item->height(), UCUnits::instance().gu(30)); - QCOMPARE(item2->width(), UCUnits::instance().gu(40)); - QCOMPARE(item2->height(), UCUnits::instance().gu(50)); - - root->setWidth(UCUnits::instance().gu(40)); - QTest::waitForEvents(); - QCOMPARE(item->width(), width); - QCOMPARE(item->height(), height); - QCOMPARE(item2->width(), width2); - QCOMPARE(item2->height(), height2); - } - - void testCase_CurrentLayoutChange() - { - QQuickItem *root = loadTest("CurrentLayoutChange.qml"); - QVERIFY(root); - - ULLayouts *layouts = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layouts); - - QSignalSpy spy(layouts, SIGNAL(currentLayoutChanged())); - root->setWidth(root->height() - 10); - QEXPECT_FAIL(0, "Layout change should not happen when component is not defined", Continue); - QCOMPARE(spy.count(), 1); - } - - void testCase_PositioningOnLayoutChange() - { - QQuickItem *root = loadTest("PositioningOnLayoutChange.qml"); - QVERIFY(root); - - ULLayouts *layouts = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layouts); - - QSignalSpy spy(layouts, SIGNAL(currentLayoutChanged())); - root->setWidth(root->height() - 10); - QEXPECT_FAIL(0, "Layout change should not happen when component is not defined", Continue); - QCOMPARE(spy.count(), 1); - - spy.clear(); - root->setWidth(root->height() + 10); - QCOMPARE(spy.count(), 1); - } - - void testCase_LaidOutItemsOutsideOfLayout() - { - QQuickItem *root = loadTest("LaidOutItemsOutsideOfLayout.qml"); - QVERIFY(root); - - QQuickItem *item = qobject_cast(testItem(root, "itemLaidOut")); - QVERIFY(item); - - ULLayoutsAttached *marker = qobject_cast( - qmlAttachedPropertiesObject(item, false)); - QVERIFY(marker); - QVERIFY(!marker->isValid()); - } - - void testCase_OverlaidInItemLayout() - { - QQuickItem *root = loadTest("OverlaidInItemLayout.qml"); - QVERIFY(root); - - QQuickItem *layout = qobject_cast(testItem(root, "layout")); - QVERIFY(layout); - - QQuickItem *item = qobject_cast(testItem(root, "hostedItem")); - QVERIFY(item); - - QCOMPARE(layout->childItems()[0], item); - } - - void testCase_AnchorFilledReparenting() - { - QQuickItem *root = loadTest("AnchorFilledReparenting.qml"); - QVERIFY(root); - - QQuickItem *layout = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layout); - - QQuickItem *item = qobject_cast(testItem(root, "testItem")); - QVERIFY(item); - - QQuickAnchors *anchors = item->property("anchors").value(); - QVERIFY(anchors); - - root->setWidth(root->width() + 100); - QTest::waitForEvents(); - QQuickItem *testLayout = qobject_cast(testItem(root, "testLayout")); - QVERIFY(testLayout); - QCOMPARE(anchors->fill(), testLayout); - - root->setWidth(root->width() - 100); - QTest::waitForEvents(); - QCOMPARE(anchors->fill(), layout); - } - - void testCase_AnchorFilledMargins() - { - QQuickItem *root = loadTest("AnchorFilledMargins.qml"); - QVERIFY(root); - - QQuickItem *layout = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layout); - - QQuickItem *item = qobject_cast(testItem(root, "testItem")); - QVERIFY(item); - - QQuickAnchors *anchors = item->property("anchors").value(); - QVERIFY(anchors); - - root->setWidth(root->width() + 100); - QTest::waitForEvents(); - - QQuickItem *testLayout = qobject_cast(testItem(root, "testLayout")); - QVERIFY(testLayout); - QCOMPARE(anchors->fill(), testLayout); - QCOMPARE(anchors->margins(), 0.0); - - root->setWidth(root->width() - 100); - QTest::waitForEvents(); - QCOMPARE(anchors->fill(), layout); - QCOMPARE(anchors->margins(), 10.0); - } - - void testCase_AnchorFilledSeparateMargins() - { - QQuickItem *root = loadTest("AnchorFilledSeparateMargins.qml"); - QVERIFY(root); - - QQuickItem *layout = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layout); - - QQuickItem *item = qobject_cast(testItem(root, "testItem")); - QVERIFY(item); - - QQuickAnchors *anchors = item->property("anchors").value(); - QVERIFY(anchors); - - root->setWidth(root->width() + 100); - QTest::waitForEvents(); - - QQuickItem *testLayout = qobject_cast(testItem(root, "testLayout")); - QVERIFY(testLayout); - QCOMPARE(anchors->fill(), testLayout); - QCOMPARE(anchors->margins(), 0.0); - QCOMPARE(anchors->leftMargin(), 0.0); - QCOMPARE(anchors->rightMargin(), 0.0); - QCOMPARE(anchors->topMargin(), 0.0); - QCOMPARE(anchors->bottomMargin(), 0.0); - - root->setWidth(root->width() - 100); - QTest::waitForEvents(); - QCOMPARE(anchors->fill(), layout); - QCOMPARE(anchors->leftMargin(), 10.0); - QCOMPARE(anchors->topMargin(), 20.0); - QCOMPARE(anchors->rightMargin(), 30.0); - QCOMPARE(anchors->bottomMargin(), 40.0); - } - - void testCase_AnchorCenteredInDefault() - { - QQuickItem *root = loadTest("AnchorCenteredInDefault.qml"); - QVERIFY(root); - - QQuickItem *layout = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layout); - - QQuickItem *item = qobject_cast(testItem(root, "testItem")); - QVERIFY(item); - - QQuickAnchors *anchors = item->property("anchors").value(); - QVERIFY(anchors); - - root->setWidth(root->width() + 100); - QTest::waitForEvents(); - QQuickItem *testLayout = qobject_cast(testItem(root, "testLayout")); - QVERIFY(testLayout); - QCOMPARE(anchors->fill(), testLayout); - - root->setWidth(root->width() - 100); - QTest::waitForEvents(); - QCOMPARE(anchors->centerIn(), layout); - } - - void testCase_AnchorVerticalCenter() - { - QQuickItem *root = loadTest("AnchorVerticalCenter.qml"); - QVERIFY(root); - - QQuickItem *layout = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layout); - - QQuickItem *item = qobject_cast(testItem(root, "testItem")); - QVERIFY(item); - - QQuickAnchors *anchors = item->property("anchors").value(); - QVERIFY(anchors); - - QCOMPARE(anchors->verticalCenter().item, layout); - - root->setWidth(root->width() + 100); - QTest::waitForEvents(); - QQuickItem *testLayout = qobject_cast(testItem(root, "testLayout")); - QVERIFY(testLayout); - QCOMPARE(anchors->fill(), testLayout); - - root->setWidth(root->width() - 100); - QTest::waitForEvents(); - QCOMPARE(anchors->verticalCenter().item, layout); - } - - void testCase_AnchorVerticalCenterOffset() - { - QQuickItem *root = loadTest("AnchorVerticalCenterOffset.qml"); - QVERIFY(root); - - QQuickItem *layout = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layout); - - QQuickItem *item = qobject_cast(testItem(root, "testItem")); - QVERIFY(item); - - QQuickAnchors *anchors = item->property("anchors").value(); - QVERIFY(anchors); - - QCOMPARE(anchors->verticalCenter().item, layout); - QCOMPARE(anchors->verticalCenterOffset(), 50.0); - - root->setWidth(root->width() + 100); - QTest::waitForEvents(); - QQuickItem *testLayout = qobject_cast(testItem(root, "testLayout")); - QVERIFY(testLayout); - QCOMPARE(anchors->fill(), testLayout); - // no need to check offset as it does not affect the fill - - root->setWidth(root->width() - 100); - QTest::waitForEvents(); - QCOMPARE(anchors->verticalCenter().item, layout); - QCOMPARE(anchors->verticalCenterOffset(), 50.0); - } - - void testCase_AnchorHorizontalCenter() - { - QQuickItem *root = loadTest("AnchorHorizontalCenter.qml"); - QVERIFY(root); - - QQuickItem *layout = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layout); - - QQuickItem *item = qobject_cast(testItem(root, "testItem")); - QVERIFY(item); - - QQuickAnchors *anchors = item->property("anchors").value(); - QVERIFY(anchors); - - QCOMPARE(anchors->horizontalCenter().item, layout); - - root->setWidth(root->width() + 100); - QTest::waitForEvents(); - QQuickItem *testLayout = qobject_cast(testItem(root, "testLayout")); - QVERIFY(testLayout); - QCOMPARE(anchors->fill(), testLayout); - - root->setWidth(root->width() - 100); - QTest::waitForEvents(); - QCOMPARE(anchors->horizontalCenter().item, layout); - } - - void testCase_AnchorHorizontalCenterOffset() - { - QQuickItem *root = loadTest("AnchorHorizontalCenterOffset.qml"); - QVERIFY(root); - - QQuickItem *layout = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layout); - - QQuickItem *item = qobject_cast(testItem(root, "testItem")); - QVERIFY(item); - - QQuickAnchors *anchors = item->property("anchors").value(); - QVERIFY(anchors); - - QCOMPARE(anchors->horizontalCenter().item, layout); - QCOMPARE(anchors->horizontalCenterOffset(), 50.0); - - root->setWidth(root->width() + 100); - QTest::waitForEvents(); - QQuickItem *testLayout = qobject_cast(testItem(root, "testLayout")); - QVERIFY(testLayout); - QCOMPARE(anchors->fill(), testLayout); - // no need to check offset as it does not affect the fill - - root->setWidth(root->width() - 100); - QTest::waitForEvents(); - QCOMPARE(anchors->horizontalCenter().item, layout); - QCOMPARE(anchors->horizontalCenterOffset(), 50.0); - } - - void testCase_AnchorCenterWithOffset() - { - QQuickItem *root = loadTest("AnchorCenterWithOffset.qml"); - QVERIFY(root); - - QQuickItem *layout = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layout); - - QQuickItem *item = qobject_cast(testItem(root, "testItem")); - QVERIFY(item); - - QQuickAnchors *anchors = item->property("anchors").value(); - QVERIFY(anchors); - - QCOMPARE(anchors->centerIn(), layout); - QCOMPARE(anchors->verticalCenterOffset(), 50.0); - QCOMPARE(anchors->horizontalCenterOffset(), 40.0); - - root->setWidth(root->width() + 100); - QTest::waitForEvents(); - QQuickItem *testLayout = qobject_cast(testItem(root, "testLayout")); - QVERIFY(testLayout); - QCOMPARE(anchors->fill(), testLayout); - // no need to check offsets as it does not affect the fill - - root->setWidth(root->width() - 100); - QTest::waitForEvents(); - QCOMPARE(anchors->centerIn(), layout); - QCOMPARE(anchors->verticalCenterOffset(), 50.0); - QCOMPARE(anchors->horizontalCenterOffset(), 40.0); - } - - void testCase_AnchorLeft() - { - QQuickItem *root = loadTest("AnchorLeft.qml"); - QVERIFY(root); - - QQuickItem *layout = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layout); - - QQuickItem *item = qobject_cast(testItem(root, "testItem")); - QVERIFY(item); - - QQuickAnchors *anchors = item->property("anchors").value(); - QVERIFY(anchors); - - QCOMPARE(anchors->left().item, layout); - QCOMPARE(anchors->leftMargin(), 10.0); - - root->setWidth(root->width() + 100); - QTest::waitForEvents(); - QQuickItem *testLayout = qobject_cast(testItem(root, "testLayout")); - QVERIFY(testLayout); - QCOMPARE(anchors->fill(), testLayout); - QCOMPARE(anchors->leftMargin(), 0.0); - - root->setWidth(root->width() - 100); - QTest::waitForEvents(); - QCOMPARE(anchors->left().item, layout); - QCOMPARE(anchors->leftMargin(), 10.0); - } - - void testCase_AnchorTop() - { - QQuickItem *root = loadTest("AnchorTop.qml"); - QVERIFY(root); - - QQuickItem *layout = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layout); - - QQuickItem *item = qobject_cast(testItem(root, "testItem")); - QVERIFY(item); - - QQuickAnchors *anchors = item->property("anchors").value(); - QVERIFY(anchors); - - QCOMPARE(anchors->top().item, layout); - QCOMPARE(anchors->topMargin(), 10.0); - - root->setWidth(root->width() + 100); - QTest::waitForEvents(); - QQuickItem *testLayout = qobject_cast(testItem(root, "testLayout")); - QVERIFY(testLayout); - QCOMPARE(anchors->fill(), testLayout); - QCOMPARE(anchors->topMargin(), 0.0); - - root->setWidth(root->width() - 100); - QTest::waitForEvents(); - QCOMPARE(anchors->top().item, layout); - QCOMPARE(anchors->topMargin(), 10.0); - } - - void testCase_AnchorRight() - { - QQuickItem *root = loadTest("AnchorRight.qml"); - QVERIFY(root); - - QQuickItem *layout = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layout); - - QQuickItem *item = qobject_cast(testItem(root, "testItem")); - QVERIFY(item); - - QQuickAnchors *anchors = item->property("anchors").value(); - QVERIFY(anchors); - - QCOMPARE(anchors->right().item, layout); - QCOMPARE(anchors->rightMargin(), 10.0); - - root->setWidth(root->width() + 100); - QTest::waitForEvents(); - QQuickItem *testLayout = qobject_cast(testItem(root, "testLayout")); - QVERIFY(testLayout); - QCOMPARE(anchors->fill(), testLayout); - QCOMPARE(anchors->rightMargin(), 0.0); - - root->setWidth(root->width() - 100); - QTest::waitForEvents(); - QCOMPARE(anchors->right().item, layout); - QCOMPARE(anchors->rightMargin(), 10.0); - } - - void testCase_AnchorBottom() - { - QQuickItem *root = loadTest("AnchorBottom.qml"); - QVERIFY(root); - - QQuickItem *layout = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layout); - - QQuickItem *item = qobject_cast(testItem(root, "testItem")); - QVERIFY(item); - - QQuickAnchors *anchors = item->property("anchors").value(); - QVERIFY(anchors); - - QCOMPARE(anchors->bottom().item, layout); - QCOMPARE(anchors->bottomMargin(), 10.0); - - root->setWidth(root->width() + 100); - QTest::waitForEvents(); - QQuickItem *testLayout = qobject_cast(testItem(root, "testLayout")); - QVERIFY(testLayout); - QCOMPARE(anchors->fill(), testLayout); - QCOMPARE(anchors->bottomMargin(), 0.0); - - root->setWidth(root->width() - 100); - QTest::waitForEvents(); - QCOMPARE(anchors->bottom().item, layout); - QCOMPARE(anchors->bottomMargin(), 10.0); - } - - void testCase_AnchorAll() - { - QQuickItem *root = loadTest("AnchorAll.qml"); - QVERIFY(root); - - QQuickItem *layout = qobject_cast(testItem(root, "layoutManager")); - QVERIFY(layout); - - QQuickItem *item = qobject_cast(testItem(root, "testItem")); - QVERIFY(item); - - QQuickAnchors *anchors = item->property("anchors").value(); - QVERIFY(anchors); - - QCOMPARE(anchors->left().item, layout); - QCOMPARE(anchors->top().item, layout); - QCOMPARE(anchors->right().item, layout); - QCOMPARE(anchors->bottom().item, layout); - QVERIFY(!anchors->fill()); - QCOMPARE(anchors->margins(), 20.0); - - root->setWidth(root->width() + 100); - QTest::waitForEvents(); - QQuickItem *testLayout = qobject_cast(testItem(root, "testLayout")); - QVERIFY(testLayout); - QCOMPARE(anchors->fill(), testLayout); - QVERIFY(!anchors->left().item); - QVERIFY(!anchors->top().item); - QVERIFY(!anchors->right().item); - QVERIFY(!anchors->bottom().item); - QCOMPARE(anchors->margins(), 0.0); - - root->setWidth(root->width() - 100); - QTest::waitForEvents(); - QCOMPARE(anchors->left().item, layout); - QCOMPARE(anchors->top().item, layout); - QCOMPARE(anchors->right().item, layout); - QCOMPARE(anchors->bottom().item, layout); - QVERIFY(!anchors->fill()); - QCOMPARE(anchors->margins(), 20.0); - } - -}; - -QTEST_MAIN(tst_Layouts) - -#include "tst_layouts.moc" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/tst_layouts.pro ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/tst_layouts.pro --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/tst_layouts/tst_layouts.pro 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/tst_layouts/tst_layouts.pro 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -include(../test-include.pri) -include(../qtprivate_dependency.pri) - -QT += gui -SOURCES += \ - tst_layouts.cpp - -OTHER_FILES += \ - SimpleLayouts.qml \ - NoLayouts.qml \ - OverlappingCondition.qml \ - SmallLayout.qml \ - MediumLayout.qml \ - LargeLayout.qml \ - ExternalLayouts.qml \ - NestedLayouts.qml \ - DefaultLayout.qml \ - ResizingContainers.qml \ - SizedDefaultLayout.qml \ - CurrentLayoutChange.qml \ - PositioningOnLayoutChange.qml \ - LaidOutItemsOutsideOfLayout.qml \ - OverlaidInItemLayout.qml \ - AnchorFilledReparenting.qml \ - AnchorCenteredInDefault.qml \ - AnchorFilledMargins.qml \ - AnchorFilledSeparateMargins.qml \ - AnchorVerticalCenter.qml \ - AnchorVerticalCenterOffset.qml \ - AnchorCenterWithOffset.qml \ - AnchorHorizontalCenter.qml \ - AnchorHorizontalCenterOffset.qml \ - AnchorLeft.qml \ - AnchorRight.qml \ - AnchorTop.qml \ - AnchorBottom.qml \ - AnchorAll.qml diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/unit.pro ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/unit.pro --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit/unit.pro 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit/unit.pro 2013-12-11 12:43:36.000000000 +0000 @@ -24,6 +24,5 @@ tst_i18n \ tst_arguments \ tst_argument \ - tst_layouts \ tst_alarms \ tst_theme diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/layout_dependency.pri ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/layout_dependency.pri --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/layout_dependency.pri 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/layout_dependency.pri 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,9 @@ +COMPONENTS_PATH = ../../../modules/Ubuntu/Layouts +INCLUDEPATH += $$COMPONENTS_PATH/plugin +PRE_TARGETDEPS = $$COMPONENTS_PATH/libUbuntuLayouts.so +LIBS += $$COMPONENTS_PATH/libUbuntuLayouts.so +DEFINES += QUICK_TEST_SOURCE_DIR=\"\\\"$$_PRO_FILE_PWD_\\\"\" + +components.target = $$PRE_TARGETDEPS +components.commands = cd $$COMPONENTS_PATH/plugin && $(QMAKE) && make +QMAKE_EXTRA_TARGETS += components diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/test-include.pri ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/test-include.pri --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/test-include.pri 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/test-include.pri 2013-12-11 12:43:36.000000000 +0000 @@ -1,4 +1,5 @@ include( ../unit/plugin_dependency.pri ) +include( layout_dependency.pri ) include( add_makecheck.pri ) TEMPLATE = app diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tabsmodel.cpp ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tabsmodel.cpp --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tabsmodel.cpp 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tabsmodel.cpp 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,62 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + */ + +#include "tabsmodel.h" + +TabsModel::TabsModel() +{ +} + +int TabsModel::rowCount(const QModelIndex &parent) const +{ + if (parent.isValid()) + return 0; + + return m_list.count(); +} + +QVariant TabsModel::data(const QModelIndex &index, int role) const +{ + if (role == Qt::DisplayRole) { + return m_list[index.row()]; + } + return QVariant(); +} + +void TabsModel::append(const QString &title) +{ + const int count = m_list.count(); + beginInsertRows(QModelIndex(), count, count); + m_list << title; + endInsertRows(); + Q_EMIT countChanged(); +} + +QVariantMap TabsModel::get(int index) +{ + QVariantMap res; + res.insert("title", m_list[index]); + return res; +} + +QHash TabsModel::roleNames() const +{ + QHash roles; + roles[Qt::DisplayRole] = "title"; + return roles; +} + diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tabsmodel.h ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tabsmodel.h --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tabsmodel.h 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tabsmodel.h 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + */ + +#ifndef TABSMODEL_H +#define TABSMODEL_H + +#include +#include + +class TabsModel : public QAbstractListModel +{ + Q_OBJECT + Q_PROPERTY(int count READ rowCount NOTIFY countChanged); + +public: + TabsModel(); + int rowCount(const QModelIndex &parent = QModelIndex()) const; + QVariant data(const QModelIndex&, int) const; + QHash roleNames() const; + + Q_INVOKABLE void append(const QString &title); + Q_INVOKABLE QVariantMap get(int index); + +Q_SIGNALS: + void countChanged(); + +private: + QStringList m_list; +}; + +#endif diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_components.cpp ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_components.cpp --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_components.cpp 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_components.cpp 2013-12-11 12:43:36.000000000 +0000 @@ -15,4 +15,19 @@ * */ #include +#include + +#include "tabsmodel.h" + +class Register +{ +public: + Register() + { + qmlRegisterType("TestObjects", 0, 1, "TabsModel"); + } +}; + +Register r; + QUICK_TEST_MAIN(components) diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_components.pro ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_components.pro --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_components.pro 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_components.pro 2013-12-11 12:43:36.000000000 +0000 @@ -4,6 +4,7 @@ TARGET = tst_components -SOURCES += tst_components.cpp +SOURCES += tst_components.cpp tabsmodel.cpp +HEADERS += tabsmodel.h OTHER_FILES += $$system(ls *.qml) diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_hide_chrome.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_hide_chrome.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_hide_chrome.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_hide_chrome.qml 2013-12-11 12:43:36.000000000 +0000 @@ -79,11 +79,13 @@ return tabBar; } - function test_tabBar_selectionMode_closes_toolbar_bug1223600() { + function test_tabBar_press_closes_toolbar_bug1223600() { testCase.setTabBarSelectionMode(false); var toolbar = testCase.openToolbar(); - testCase.setTabBarSelectionMode(true); + testCase.mousePress(tabs.tabBar); compare(toolbar.opened, false, "Activating TabBar did not close toolbar"); + testCase.mouseRelease(tabs.tabBar); + testCase.setTabBarSelectionMode(false); } function test_toolbar_press_closes_tabBar_bug1223606 () { diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_panel.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_panel.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_panel.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_panel.qml 2013-12-11 12:43:36.000000000 +0000 @@ -31,6 +31,10 @@ right: parent.right } height: parent.height / 2 + Rectangle { + color: "pink" + anchors.fill: parent + } } TestCase { @@ -162,6 +166,35 @@ panel.align = Qt.AlignBottom; } + function test_clickToDeactivate() { + panel.open(); + compare(panel.opened && panel.align === Qt.AlignBottom, true, "Panel is opened and bottom-aligned"); + mouseClick(root, root.width / 2, 5, Qt.LeftButton); + compare(panel.opened, false, "Panel is deactivated by clicking in the view outside of the panel"); + } + + function test_hideTimeout_bug1249031() { + compare(panel.hideTimeout, -1, "Panel hide timeout is initially negative (no timeout)"); + panel.hideTimeout = 2000; + panel.open(); + compare(panel.opened, true, "Panel can be made opened"); + wait(panel.hideTimeout + 500); // add 500 ms margin + compare(panel.opened, false, "Panel automatically closes after timeout"); + + // now, wait in total more than hideTimeout, but less than 2*hideTimeout, + // and have user interaction half-way to verify that the interaction + // resets the timer and the panel is not closed. + panel.open(); + wait(0.6*panel.hideTimeout); + mouseClick(panel, panel.width/2, panel.height/2); + wait(0.6*panel.hideTimeout); + compare(panel.opened, true, "Interacting with panel contents resets the hide timer"); + // verify that the timer is still running by waiting a bit longer: + wait(0.6*panel.hideTimeout); + compare(panel.opened, false, "Interacting with the panel contents does not stop the timer") + panel.hideTimeout = -1; + } + QtObject { id: swipeTests @@ -239,13 +272,6 @@ testCase.mouseRelease(panel, x - dx, y - dy, Qt.LeftButton); testCase.compare(panel.opened, false, "Top-aligned panel deactivated by swiping up (delay: "+moveDelay+""); } - - function test_clickToDeactivate() { - panel.open(); - compare(panel.opened && panel.align === Qt.AlignBottom, true, "Panel is opened and bottom-aligned"); - mouseClick(root, root.width / 2, 5, Qt.LeftButton); - compare(panel.opened, false, "Panel is deactivated by clicking in the view outside of the panel"); - } } } } diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_picker.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_picker.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_picker.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_picker.qml 2013-12-11 12:43:36.000000000 +0000 @@ -186,5 +186,14 @@ mouseClick(linearLong, units.gu(1), units.gu(18)); tryCompare(spy, "count", 2); } + + function test_6_pickerCircularChange() { + var expectedList = picker.circular ? "Picker_WrapAround" : "Picker_Linear"; + verify(findChild(picker, expectedList) !== undefined, "Picker must use " + expectedList); + + picker.circular = !picker.circular; + expectedList = picker.circular ? "Picker_WrapAround" : "Picker_Linear"; + verify(findChild(picker, expectedList) !== undefined, "circular changed, Picker must use " + expectedList); + } } } diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_tabbar.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_tabbar.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_tabbar.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_tabbar.qml 2013-12-11 12:43:36.000000000 +0000 @@ -17,6 +17,7 @@ import QtQuick 2.0 import QtTest 1.0 import Ubuntu.Components 0.1 +import TestObjects 0.1 Item { id: root @@ -29,6 +30,13 @@ width: parent.width } + TabBar { + id: bar2 + anchors.top: parent.top + width: parent.width + model: invalidModel + } + ListView { anchors { fill: parent @@ -68,6 +76,41 @@ } } + ListModel { + id: invalidModel + ListElement { + fruit: "Pear" + } + } + + ListModel { + id: invalidModelTab + ListElement { + tab: "Pear" + } + } + + Item { + id: myTab + property string title: "Pear" + } + + ListModel { + id: validModelTab + } + + ListModel { + id: emptyModelWillBeInvalid + } + + ListModel { + id: emptyModel + } + + TabsModel { + id: pagesCpp + } + Label { id: textSizer text: "Tab 9" @@ -106,6 +149,7 @@ function test_1_modelSet() { bar.model = pages; + compare(bar.model, pages); compare(bar.selectedIndex, 0, "selectedIndex defaults to 0 when model is defined"); } @@ -140,6 +184,7 @@ function test_2_tabSelection(data) { bar.model = pages; + compare(bar.model, pages); if (bar.selectionMode) { // wait till the TabBar goes off from selection mode, with an extra threshold @@ -159,5 +204,49 @@ wait(bar.__styleInstance.headerTextFadeDuration); compare(bar.selectedIndex, data.selectedIndex, "the next tab is selected"); } + + function test_invalidModel() { + bar.model = invalidModel; + compare(bar.model, null, "the model has to be null when setting an invalid model"); + } + + function test_invalidModelTab() { + bar.model = invalidModelTab; + compare(bar.model, null, "the model has to be null when setting an invalid model"); + } + + function test_invalidModelTab2() { + compare(bar2.model, null, "the model has to be null when setting an invalid model"); + } + + function test_validModelTab() { + bar.model = validModelTab; + compare(bar.model, validModelTab); + validModelTab.append({tab: myTab}); + compare(bar.model, validModelTab); + } + + function test_invalidModelEmptyAtTheBeginning() { + bar.model = emptyModelWillBeInvalid; + compare(bar.model, emptyModelWillBeInvalid); + emptyModelWillBeInvalid.append({fruit: "Pear"}); + compare(bar.model, null, "the model has to be null when setting an invalid model"); + } + + function test_addTabAfterShownQML() { + bar.model = emptyModel; + compare(bar.model, emptyModel); + compare(bar.selectedIndex, -1); + emptyModel.append({title:"Title 1"}); + compare(bar.selectedIndex, 0); + } + + function test_addTabAfterShownCpp() { + bar.model = pagesCpp; + compare(bar.model, pagesCpp); + compare(bar.selectedIndex, -1); + pagesCpp.append("Title 1"); + compare(bar.selectedIndex, 0); + } } } diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_tabs.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_tabs.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_tabs.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_tabs.qml 2013-12-11 12:43:36.000000000 +0000 @@ -382,5 +382,13 @@ mouseClick(button, units.gu(1), units.gu(1), Qt.LeftButton); compare(tabs.tabBar.selectionMode, false, "Tab bar deactivated by interacting with the page contents"); } + + function test_tabBar_pressed() { + compare(tabs.tabBar.pressed, false, "Before user interaction, pressed is false"); + mousePress(tabs.tabBar, tabs.tabBar.width/2, tabs.tabBar.height/2); + compare(tabs.tabBar.pressed, true, "Pressing the tab bar makes pressed true"); + mouseRelease(tabs.tabBar, tabs.tabBar.width/2, tabs.tabBar.height/2); + compare(tabs.tabBar.pressed, false, "After releasing, pressed is false"); + } } } diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_toolbar.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_toolbar.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_components/tst_toolbar.qml 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_components/tst_toolbar.qml 2013-12-11 12:43:36.000000000 +0000 @@ -36,6 +36,7 @@ tools: ToolbarItems { id: toolbarItems ToolbarButton { + id: toolbarButton text: "action1" } } @@ -74,12 +75,24 @@ compare(mainView.__propagated.toolbar.opened, false, "Toolbar can be made closed by setting page.tools.opened to false"); } - function test_hideTimeout() { + function test_hideTimeout_bug1249031() { compare(mainView.__propagated.toolbar.hideTimeout, 5000, "Toolbar hide timeout is initially 5 seconds."); mainView.__propagated.toolbar.open(); compare(mainView.__propagated.toolbar.opened, true, "Toolbar can be made opened"); wait(mainView.__propagated.toolbar.hideTimeout + 500); // add 500 ms margin compare(mainView.__propagated.toolbar.opened, false, "Toolbar automatically closes after timeout"); + + // now, wait in total more than hideTimeout, but less than 2*hideTimeout, + // and have user interaction half-way to verify that the interaction + // resets the timer and the toolbar is not closed. + mainView.__propagated.toolbar.open(); + wait(0.6*mainView.__propagated.toolbar.hideTimeout); + mouseClick(toolbarButton, toolbarButton.width/2, toolbarButton.height/2); + wait(0.6*mainView.__propagated.toolbar.hideTimeout); + compare(mainView.__propagated.toolbar.opened, true, "Interacting with toolbar contents resets the hide timer"); + // verify that the timer is still running by waiting a bit longer: + wait(0.6*mainView.__propagated.toolbar.hideTimeout); + compare(mainView.__propagated.toolbar.opened, false, "Interacting with the toolbar contents does not stop the timer") } function test_locked() { diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorAll.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorAll.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorAll.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorAll.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 300 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "landscape" + when: root.width > root.height + ItemLayout { + objectName: "testLayout" + anchors.fill: parent + item: "test" + } + } + ] + + Rectangle { + width: 100 + height: 100 + color: "red" + objectName: "testItem" + Layouts.item: "test" + anchors.left: parent.left + anchors.top: parent.top + anchors.right: parent.right + anchors.bottom: parent.bottom + anchors.margins: 20 + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorBottom.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorBottom.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorBottom.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorBottom.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 300 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "landscape" + when: root.width > root.height + ItemLayout { + objectName: "testLayout" + anchors.fill: parent + item: "test" + } + } + ] + + Rectangle { + width: 100 + height: 100 + color: "red" + objectName: "testItem" + Layouts.item: "test" + anchors.bottom: parent.bottom + anchors.bottomMargin: 10 + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorCenterWithOffset.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorCenterWithOffset.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorCenterWithOffset.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorCenterWithOffset.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,53 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 300 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "landscape" + when: root.width > root.height + ItemLayout { + objectName: "testLayout" + anchors.fill: parent + item: "test" + } + } + ] + + Rectangle { + width: 100 + height: 100 + color: "red" + objectName: "testItem" + Layouts.item: "test" + anchors.centerIn: parent + anchors.verticalCenterOffset: 50 + anchors.horizontalCenterOffset: 40 + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorCenteredInDefault.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorCenteredInDefault.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorCenteredInDefault.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorCenteredInDefault.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,51 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 300 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "landscape" + when: root.width > root.height + ItemLayout { + objectName: "testLayout" + anchors.fill: parent + item: "test" + } + } + ] + + Rectangle { + width: 100 + height: 100 + color: "red" + objectName: "testItem" + Layouts.item: "test" + anchors.centerIn: parent + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorFilledMargins.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorFilledMargins.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorFilledMargins.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorFilledMargins.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 300 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "landscape" + when: root.width > root.height + ItemLayout { + objectName: "testLayout" + anchors.fill: parent + item: "test" + } + } + ] + + Rectangle { + color: "red" + objectName: "testItem" + Layouts.item: "test" + anchors.fill: parent + anchors.margins: 10 + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorFilledReparenting.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorFilledReparenting.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorFilledReparenting.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorFilledReparenting.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 300 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "landscape" + when: root.width > root.height + ItemLayout { + objectName: "testLayout" + anchors.fill: parent + item: "test" + } + } + ] + + Rectangle { + color: "red" + objectName: "testItem" + Layouts.item: "test" + anchors.fill: parent + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorFilledSeparateMargins.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorFilledSeparateMargins.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorFilledSeparateMargins.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorFilledSeparateMargins.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,53 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 300 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "landscape" + when: root.width > root.height + ItemLayout { + objectName: "testLayout" + anchors.fill: parent + item: "test" + } + } + ] + + Rectangle { + color: "red" + objectName: "testItem" + Layouts.item: "test" + anchors.fill: parent + anchors.leftMargin: 10 + anchors.topMargin: 20 + anchors.rightMargin: 30 + anchors.bottomMargin: 40 + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorHorizontalCenter.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorHorizontalCenter.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorHorizontalCenter.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorHorizontalCenter.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,51 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 300 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "landscape" + when: root.width > root.height + ItemLayout { + objectName: "testLayout" + anchors.fill: parent + item: "test" + } + } + ] + + Rectangle { + width: 100 + height: 100 + color: "red" + objectName: "testItem" + Layouts.item: "test" + anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorHorizontalCenterOffset.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorHorizontalCenterOffset.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorHorizontalCenterOffset.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorHorizontalCenterOffset.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 300 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "landscape" + when: root.width > root.height + ItemLayout { + objectName: "testLayout" + anchors.fill: parent + item: "test" + } + } + ] + + Rectangle { + width: 100 + height: 100 + color: "red" + objectName: "testItem" + Layouts.item: "test" + anchors.horizontalCenter: parent.horizontalCenter + anchors.horizontalCenterOffset: 50.0 + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorLeft.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorLeft.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorLeft.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorLeft.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 300 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "landscape" + when: root.width > root.height + ItemLayout { + objectName: "testLayout" + anchors.fill: parent + item: "test" + } + } + ] + + Rectangle { + width: 100 + height: 100 + color: "red" + objectName: "testItem" + Layouts.item: "test" + anchors.left: parent.left + anchors.leftMargin: 10 + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorRight.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorRight.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorRight.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorRight.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 300 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "landscape" + when: root.width > root.height + ItemLayout { + objectName: "testLayout" + anchors.fill: parent + item: "test" + } + } + ] + + Rectangle { + width: 100 + height: 100 + color: "red" + objectName: "testItem" + Layouts.item: "test" + anchors.right: parent.right + anchors.rightMargin: 10 + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorTop.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorTop.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorTop.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorTop.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 300 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "landscape" + when: root.width > root.height + ItemLayout { + objectName: "testLayout" + anchors.fill: parent + item: "test" + } + } + ] + + Rectangle { + width: 100 + height: 100 + color: "red" + objectName: "testItem" + Layouts.item: "test" + anchors.top: parent.top + anchors.topMargin: 10 + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorVerticalCenter.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorVerticalCenter.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorVerticalCenter.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorVerticalCenter.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,51 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 300 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "landscape" + when: root.width > root.height + ItemLayout { + objectName: "testLayout" + anchors.fill: parent + item: "test" + } + } + ] + + Rectangle { + width: 100 + height: 100 + color: "red" + objectName: "testItem" + Layouts.item: "test" + anchors.verticalCenter: parent.verticalCenter + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorVerticalCenterOffset.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorVerticalCenterOffset.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/AnchorVerticalCenterOffset.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/AnchorVerticalCenterOffset.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 300 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "landscape" + when: root.width > root.height + ItemLayout { + objectName: "testLayout" + anchors.fill: parent + item: "test" + } + } + ] + + Rectangle { + width: 100 + height: 100 + color: "red" + objectName: "testItem" + Layouts.item: "test" + anchors.verticalCenter: parent.verticalCenter + anchors.verticalCenterOffset: 50 + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/CurrentLayoutChange.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/CurrentLayoutChange.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/CurrentLayoutChange.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/CurrentLayoutChange.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 360 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + + layouts: [ + ConditionalLayout { + name: "portrait" + when: root.width < root.height + }, + + ConditionalLayout { + name: "landscape" + when: root.width >= root.height + } + ] + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/DefaultLayout.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/DefaultLayout.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/DefaultLayout.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/DefaultLayout.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Components 0.1 +import Ubuntu.Layouts 0.1 + +Item { + objectName: "defaultLayout" + anchors.fill: parent + Label { + objectName: "item1" + id: label1 + Layouts.item: "item1" + text: "item1" + } + Label { + objectName: "item2" + id: label2 + anchors.bottom: label1.bottom + Layouts.item: "item2" + text: "item2" + } + Label { + objectName: "item3" + id: label3 + anchors.bottom: label2.bottom + Layouts.item: "item3" + text: "item3" + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/ExternalLayouts.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/ExternalLayouts.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/ExternalLayouts.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/ExternalLayouts.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,40 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Components 0.1 +import Ubuntu.Layouts 0.1 + +Item { + id: root + width: units.gu(40) + height: units.gu(30) + + Layouts { + objectName: "layouts" + id: layouts + anchors.fill: parent + layouts: [ + SmallLayout{}, + MediumLayout {}, + LargeLayout {} + ] + + // default layout + DefaultLayout{ + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/LaidOutItemsOutsideOfLayout.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/LaidOutItemsOutsideOfLayout.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/LaidOutItemsOutsideOfLayout.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/LaidOutItemsOutsideOfLayout.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,51 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 360 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "portrait" + when: root.width < root.height + + ItemLayout { + item: "red" + anchors.right: parent.right + anchors.bottom: parent.bottom + } + } + ] + } + + Rectangle { + objectName: "itemLaidOut" + width: 40 + height: 30 + color: "red" + Layouts.item: "red" + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/LargeLayout.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/LargeLayout.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/LargeLayout.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/LargeLayout.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,36 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Components 0.1 +import Ubuntu.Layouts 0.1 + +ConditionalLayout { + name: "large" + when: layouts.width > units.gu(60) + Row { + anchors.fill: parent + ItemLayout { + item: "item1" + } + ItemLayout { + item: "item2" + } + ItemLayout { + item: "item3" + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/MediumLayout.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/MediumLayout.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/MediumLayout.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/MediumLayout.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,36 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Components 0.1 +import Ubuntu.Layouts 0.1 + +ConditionalLayout { + name: "medium" + when: layouts.width > units.gu(40) && layouts.width <= units.gu(60) + Flow { + anchors.fill: parent + ItemLayout { + item: "item1" + } + ItemLayout { + item: "item2" + } + ItemLayout { + item: "item3" + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/NestedLayouts.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/NestedLayouts.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/NestedLayouts.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/NestedLayouts.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,71 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Components 0.1 +import Ubuntu.Layouts 0.1 + +Item { + id: root + width: units.gu(40) + height: units.gu(30) + + property string nestedLayout: "" + + Layouts { + objectName: "layouts" + id: layouts + anchors.fill: parent + layouts: [ + ConditionalLayout { + name: "extra-large" + when: layouts.width > units.gu(80) + Item { + anchors.fill: parent + Item { + id: header + ItemLayout { + item: "item3" + } + } + Row { + anchors.fill: parent + anchors.topMargin: header.height + ItemLayout { + item: "item1" + } + ItemLayout { + item: "item2" + } + } + } + }, + ConditionalLayout { + name: "simple" + when: layouts.width <= units.gu(100) + SimpleLayouts{ + id: nested + anchors.fill: parent + onCurrentLayoutChanged: root.nestedLayout = nested.currentLayout + } + } + ] + + // default layout + DefaultLayout{ + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/NoLayouts.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/NoLayouts.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/NoLayouts.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/NoLayouts.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Components 0.1 +import Ubuntu.Layouts 0.1 + +Item { + id: root + width: units.gu(40) + height: units.gu(30) + + Layouts { + objectName: "layouts" + id: layouts + anchors.fill: parent + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/OverlaidInItemLayout.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/OverlaidInItemLayout.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/OverlaidInItemLayout.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/OverlaidInItemLayout.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,62 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 300 + height: 360 + + Layouts { + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "portrait" + when: root.width < root.height + + ItemLayout { + objectName: "layout" + item: "red" + x: 20 + y: 30 + width: 40 + height: 30 + + Rectangle { + objectName: "overlay" + width: 10 + height: 10 + color: "green" + z: 100 + } + } + } + ] + + Rectangle { + objectName: "hostedItem" + id: red + width: 40 + height: 30 + color: "red" + Layouts.item: "red" + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/OverlappingCondition.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/OverlappingCondition.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/OverlappingCondition.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/OverlappingCondition.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,68 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Components 0.1 +import Ubuntu.Layouts 0.1 + +Item { + id: root + width: units.gu(40) + height: units.gu(30) + + Layouts { + objectName: "layouts" + id: layouts + anchors.fill: parent + layouts: [ + ConditionalLayout { + name: "small" + when: layouts.width <= units.gu(40) + Column { + anchors.fill: parent + ItemLayout { + item: "item1" + } + ItemLayout { + item: "item2" + } + ItemLayout { + item: "item3" + } + } + }, + ConditionalLayout { + name: "medium" + when: layouts.width >= units.gu(40) && layouts.width <= units.gu(60) + Flow { + anchors.fill: parent + ItemLayout { + item: "item1" + } + ItemLayout { + item: "item2" + } + ItemLayout { + item: "item3" + } + } + } + ] + + DefaultLayout{ + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/PositioningOnLayoutChange.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/PositioningOnLayoutChange.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/PositioningOnLayoutChange.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/PositioningOnLayoutChange.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Layouts 0.1 + +Rectangle { + id: root + width: 360 + height: 360 + + Layouts { + objectName: "layoutManager" + id: layoutManager + anchors.fill: parent + + layouts: [ + ConditionalLayout { + name: "portrait" + when: root.width < root.height + + ItemLayout { + item: "red" + anchors.right: parent.right + anchors.bottom: parent.bottom + } + }, + + ConditionalLayout { + name: "landscape" + when: root.width > root.height + } + ] + + Rectangle { anchors.fill: parent; color: 'yellow'} + + Rectangle { + width: 40 + height: 30 + color: "red" + Layouts.item: "red" + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/ResizingContainers.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/ResizingContainers.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/ResizingContainers.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/ResizingContainers.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,105 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Components 0.1 +import Ubuntu.Layouts 0.1 + +Item { + id: root + width: units.gu(40) + height: units.gu(30) + + property alias currentLayout: layouts.currentLayout + + Layouts { + objectName: "layouts" + id: layouts + anchors.fill: parent + layouts: [ + ConditionalLayout { + name: "xlarge" + when: layouts.width >= units.gu(80) + Column { + anchors.fill: parent + ItemLayout { + item: "item1" + width: units.gu(30) + height: units.gu(30) + } + ItemLayout { + item: "item3" + width: units.gu(30) + height: units.gu(30) + } + ItemLayout { + item: "item2" + width: units.gu(40) + height: units.gu(50) + } + } + }, + ConditionalLayout { + name: "large" + when: layouts.width >= units.gu(60) + Column { + anchors.fill: parent + ItemLayout { + item: "item1" + width: units.gu(22) + height: units.gu(22) + } + ItemLayout { + item: "item2" + width: units.gu(22) + height: units.gu(22) + } + ItemLayout { + item: "item3" + width: units.gu(22) + height: units.gu(22) + } + } + }, + ConditionalLayout { + name: "small" + when: layouts.width > units.gu(40) + Row { + anchors.fill: parent + ItemLayout { + item: "item1" + width: units.gu(10) + height: units.gu(10) + } + ItemLayout { + item: "item2" + width: units.gu(10) + height: units.gu(10) + } + ItemLayout { + item: "item3" + width: units.gu(10) + height: units.gu(10) + } + } + } + ] + + // default layout + SizedDefaultLayout{ + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/SimpleLayouts.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/SimpleLayouts.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/SimpleLayouts.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/SimpleLayouts.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Components 0.1 +import Ubuntu.Layouts 0.1 + +Item { + id: root + width: units.gu(40) + height: units.gu(30) + + property alias currentLayout: layouts.currentLayout + + Layouts { + objectName: "layouts" + id: layouts + anchors.fill: parent + layouts: [ + ConditionalLayout { + name: "small" + when: layouts.width <= units.gu(40) + Column { + anchors.fill: parent + ItemLayout { + item: "item1" + } + ItemLayout { + item: "item2" + } + ItemLayout { + item: "item3" + } + } + }, + ConditionalLayout { + name: "medium" + when: layouts.width > units.gu(40) && layouts.width <= units.gu(60) + Flow { + anchors.fill: parent + ItemLayout { + item: "item1" + } + ItemLayout { + item: "item2" + } + ItemLayout { + item: "item3" + } + } + }, + ConditionalLayout { + name: "large" + when: layouts.width > units.gu(60) + Row { + anchors.fill: parent + ItemLayout { + item: "item1" + } + ItemLayout { + item: "item2" + } + ItemLayout { + item: "item3" + } + } + } + ] + + // default layout + DefaultLayout{ + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/SizedDefaultLayout.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/SizedDefaultLayout.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/SizedDefaultLayout.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/SizedDefaultLayout.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Components 0.1 +import Ubuntu.Layouts 0.1 + +Item { + objectName: "defaultLayout" + anchors.fill: parent + Button { + objectName: "item1" + id: label1 + Layouts.item: "item1" + text: "item1" + anchors { + left: parent.left + right: parent.right + } + } + Button { + objectName: "item2" + id: label2 + anchors.bottom: label1.bottom + Layouts.item: "item2" + text: "item2" + anchors { + left: parent.left + top: label1.bottom + right: parent.right + } + } + Button { + objectName: "item3" + id: label3 + anchors.bottom: label2.bottom + Layouts.item: "item3" + text: "item3" + anchors { + left: parent.left + top: label2.bottom + right: parent.right + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/SmallLayout.qml ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/SmallLayout.qml --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/SmallLayout.qml 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/SmallLayout.qml 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,36 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.0 +import Ubuntu.Components 0.1 +import Ubuntu.Layouts 0.1 + +ConditionalLayout { + name: "small" + when: layouts.width <= units.gu(40) + Column { + anchors.fill: parent + ItemLayout { + item: "item1" + } + ItemLayout { + item: "item2" + } + ItemLayout { + item: "item3" + } + } +} diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/tst_layouts.cpp ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/tst_layouts.cpp --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/tst_layouts.cpp 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/tst_layouts.cpp 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,891 @@ +/* + * Copyright 2012 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "ullayouts.h" +#include "ucunits.h" +#include +#include + +#define QCOMPARE_RET(actual, expected) \ +do {\ + if (!QTest::qCompare(actual, expected, #actual, #expected, __FILE__, __LINE__))\ + return false;\ +} while (0) + +#define QVERIFY_RET(statement, resturns) \ +do {\ + if (!QTest::qVerify((statement), #statement, "", __FILE__, __LINE__))\ + return resturns;\ +} while (0) + + +class tst_Layouts : public QObject +{ + Q_OBJECT +private: + QString m_modulePath; + +public: + + tst_Layouts() + { + } + + QQuickView * loadTest(const QString &file) + { + QQuickView *view = new QQuickView; + view->engine()->addImportPath(m_modulePath); + + view->setSource(QUrl::fromLocalFile(file)); + if (!view->rootObject()) { + delete view; + view = 0; + } else { + view->show(); + QTest::qWaitForWindowExposed(view); + } + return view; + } + + QQuickItem *testItem(QQuickItem *that, const QString &identifier) + { + if (that->property(identifier.toLocal8Bit()).isValid()) + return that->property(identifier.toLocal8Bit()).value(); + + QList children = that->findChildren(identifier); + return (children.count() > 0) ? children[0] : 0; + } + + +private Q_SLOTS: + void initTestCase() + { + QString modules("../../../modules"); + QVERIFY(QDir(modules).exists()); + + m_modulePath = QDir(modules).absolutePath(); + } + + void cleanupTestCase() + { + } + + void testCase_NoLayouts() + { + QScopedPointer view(loadTest("NoLayouts.qml")); + QVERIFY(view); + + ULLayouts *layouts = qobject_cast(testItem(view->rootObject(), "layouts")); + QVERIFY(layouts); + + QVERIFY(layouts->layoutList().isEmpty()); + } + + void testCase_SimpleLayout() + { + QScopedPointer view(loadTest("SimpleLayouts.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); + QVERIFY(layouts); + QVERIFY(!layouts->layoutList().isEmpty()); + + QCOMPARE(layouts->currentLayout(), QString("small")); + + QQuickItem *item = testItem(root, "item1"); + QVERIFY(item); + QVERIFY(item->parentItem()->parentItem()->inherits("QQuickColumn")); + + item = testItem(root, "item2"); + QVERIFY(item); + QVERIFY(item->parentItem()->parentItem()->inherits("QQuickColumn")); + + item = testItem(root, "item3"); + QVERIFY(item); + QVERIFY(item->parentItem()->parentItem()->inherits("QQuickColumn")); + } + + void testCase_SimpleLayout_Medium() + { + QScopedPointer view(loadTest("SimpleLayouts.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); + QVERIFY(layouts); + + QVERIFY(!layouts->layoutList().isEmpty()); + QSignalSpy layoutChangeSpy(layouts, SIGNAL(currentLayoutChanged())); + + root->setWidth(UCUnits::instance().gu(55)); + QCOMPARE(root->width(), UCUnits::instance().gu(55)); + layoutChangeSpy.wait(100); + QCOMPARE(layoutChangeSpy.count(), 1); + + QCOMPARE(layouts->currentLayout(), QString("medium")); + + QQuickItem *item = testItem(root, "item1"); + QVERIFY(item); + QVERIFY(item->parentItem()->parentItem()->inherits("QQuickFlow")); + + item = testItem(root, "item2"); + QVERIFY(item); + QVERIFY(item->parentItem()->parentItem()->inherits("QQuickFlow")); + + item = testItem(root, "item3"); + QVERIFY(item); + QVERIFY(item->parentItem()->parentItem()->inherits("QQuickFlow")); + } + + void testCase_SimpleLayout_Large() + { + QScopedPointer view(loadTest("SimpleLayouts.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); + QVERIFY(layouts); + QVERIFY(!layouts->layoutList().isEmpty()); + QSignalSpy layoutChangeSpy(layouts, SIGNAL(currentLayoutChanged())); + + root->setWidth(UCUnits::instance().gu(65)); + QCOMPARE(root->width(), UCUnits::instance().gu(65)); + layoutChangeSpy.wait(100); + QCOMPARE(layoutChangeSpy.count(), 1); + + QCOMPARE(layouts->currentLayout(), QString("large")); + + QQuickItem *item = testItem(root, "item1"); + QVERIFY(item); + QVERIFY(item->parentItem()->parentItem()->inherits("QQuickRow")); + + item = testItem(root, "item2"); + QVERIFY(item); + QVERIFY(item->parentItem()->parentItem()->inherits("QQuickRow")); + + item = testItem(root, "item3"); + QVERIFY(item); + QVERIFY(item->parentItem()->parentItem()->inherits("QQuickRow")); + } + + void testCase_OverlappingCondition() + { + QScopedPointer view(loadTest("OverlappingCondition.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); + QVERIFY(layouts); + QVERIFY(!layouts->layoutList().isEmpty()); + + QCOMPARE(layouts->currentLayout(), QString("small")); + } + + void testCase_ExternalLayouts() + { + QScopedPointer view(loadTest("ExternalLayouts.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); + QVERIFY(layouts); + QVERIFY(!layouts->layoutList().isEmpty()); + + QCOMPARE(layouts->currentLayout(), QString("small")); + } + + void testCase_ExternalLayouts_Medium() + { + QScopedPointer view(loadTest("ExternalLayouts.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); + QVERIFY(layouts); + QVERIFY(!layouts->layoutList().isEmpty()); + QSignalSpy layoutChangeSpy(layouts, SIGNAL(currentLayoutChanged())); + + root->setWidth(UCUnits::instance().gu(55)); + layoutChangeSpy.wait(100); + QCOMPARE(layoutChangeSpy.count(), 1); + + QCOMPARE(layouts->currentLayout(), QString("medium")); + } + + void testCase_ExternalLayouts_Large() + { + QScopedPointer view(loadTest("ExternalLayouts.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); + QVERIFY(layouts); + QVERIFY(!layouts->layoutList().isEmpty()); + QSignalSpy layoutChangeSpy(layouts, SIGNAL(currentLayoutChanged())); + + root->setWidth(UCUnits::instance().gu(65)); + layoutChangeSpy.wait(100); + QCOMPARE(layoutChangeSpy.count(), 1); + + QCOMPARE(layouts->currentLayout(), QString("large")); + } + + void testCase_NestedLayouts() + { + QScopedPointer view(loadTest("NestedLayouts.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); + QVERIFY(layouts); + QVERIFY(!layouts->layoutList().isEmpty()); + + QCOMPARE(layouts->currentLayout(), QString("simple")); + } + + void testCase_NestedLayouts_ExtraLarge() + { + QScopedPointer view(loadTest("NestedLayouts.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); + QVERIFY(layouts); + QVERIFY(!layouts->layoutList().isEmpty()); + QSignalSpy layoutChangeSpy(layouts, SIGNAL(currentLayoutChanged())); + + root->setWidth(UCUnits::instance().gu(90)); + layoutChangeSpy.wait(100); + QCOMPARE(layoutChangeSpy.count(), 1); + + QCOMPARE(layouts->currentLayout(), QString("extra-large")); + + root->setWidth(UCUnits::instance().gu(50)); + layoutChangeSpy.wait(100); + QCOMPARE(layoutChangeSpy.count(), 2); + + QCOMPARE(root->property("nestedLayout").toString(), QString("medium")); + } + + void testCase_ResizingContainers() + { + QScopedPointer view(loadTest("ResizingContainers.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + // fetch the current size of one item + QQuickItem *item = testItem(root, "item1"); + qreal width = item->width(); + qreal height = item->height(); + QQuickItem *item2 = testItem(root, "item2"); + qreal width2 = item2->width(); + qreal height2 = item2->height(); + + ULLayouts *layouts = qobject_cast(testItem(root, "layouts")); + QVERIFY(layouts); + QVERIFY(!layouts->layoutList().isEmpty()); + QSignalSpy layoutChangeSpy(layouts, SIGNAL(currentLayoutChanged())); + + root->setWidth(UCUnits::instance().gu(50)); + layoutChangeSpy.wait(100); + QCOMPARE(layouts->currentLayout(), QString("small")); + QCOMPARE(item->width(), UCUnits::instance().gu(10)); + QCOMPARE(item->height(), UCUnits::instance().gu(10)); + + root->setWidth(UCUnits::instance().gu(60)); + layoutChangeSpy.wait(100); + QCOMPARE(layouts->currentLayout(), QString("large")); + QCOMPARE(item->width(), UCUnits::instance().gu(22)); + QCOMPARE(item->height(), UCUnits::instance().gu(22)); + + root->setWidth(UCUnits::instance().gu(80)); + layoutChangeSpy.wait(100); + QCOMPARE(layouts->currentLayout(), QString("xlarge")); + QCOMPARE(item->width(), UCUnits::instance().gu(30)); + QCOMPARE(item->height(), UCUnits::instance().gu(30)); + QCOMPARE(item2->width(), UCUnits::instance().gu(40)); + QCOMPARE(item2->height(), UCUnits::instance().gu(50)); + + root->setWidth(UCUnits::instance().gu(40)); + layoutChangeSpy.wait(100); + QCOMPARE(item->width(), width); + QCOMPARE(item->height(), height); + QCOMPARE(item2->width(), width2); + QCOMPARE(item2->height(), height2); + } + + void testCase_CurrentLayoutChange() + { + QScopedPointer view(loadTest("CurrentLayoutChange.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + ULLayouts *layouts = qobject_cast(testItem(root, "layoutManager")); + QVERIFY(layouts); + + QSignalSpy spy(layouts, SIGNAL(currentLayoutChanged())); + root->setWidth(root->height() - 10); + spy.wait(100); + QEXPECT_FAIL(0, "Layout change should not happen when component is not defined", Continue); + QCOMPARE(spy.count(), 1); + } + + void testCase_PositioningOnLayoutChange() + { + QScopedPointer view(loadTest("PositioningOnLayoutChange.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + ULLayouts *layouts = qobject_cast(testItem(root, "layoutManager")); + QVERIFY(layouts); + + QSignalSpy spy(layouts, SIGNAL(currentLayoutChanged())); + root->setWidth(root->height() + 10); + spy.wait(100); + QEXPECT_FAIL(0, "Layout change should not happen when component is not defined", Continue); + QCOMPARE(spy.count(), 1); + + spy.clear(); + root->setWidth(root->height() - 10); + spy.wait(100); + QCOMPARE(spy.count(), 1); + } + + void testCase_LaidOutItemsOutsideOfLayout() + { + QScopedPointer view(loadTest("LaidOutItemsOutsideOfLayout.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *item = qobject_cast(testItem(root, "itemLaidOut")); + QVERIFY(item); + + ULLayoutsAttached *marker = qobject_cast( + qmlAttachedPropertiesObject(item, false)); + QVERIFY(marker); + QVERIFY(!marker->isValid()); + } + + void testCase_OverlaidInItemLayout() + { + QScopedPointer view(loadTest("OverlaidInItemLayout.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *layout = qobject_cast(testItem(root, "layout")); + QVERIFY(layout); + + QQuickItem *item = qobject_cast(testItem(root, "hostedItem")); + QVERIFY(item); + + QCOMPARE(layout->childItems()[0], item); + } + + void testCase_AnchorFilledReparenting() + { + QScopedPointer view(loadTest("AnchorFilledReparenting.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *layout = testItem(root, "layoutManager"); + QVERIFY(layout); + QSignalSpy layoutChangeSpy(layout, SIGNAL(currentLayoutChanged())); + + QQuickItem *item = testItem(root, "testItem"); + QVERIFY(item); + + QQuickAnchors *anchors = item->property("anchors").value(); + QVERIFY(anchors); + + root->setWidth(root->width() + 100); + layoutChangeSpy.wait(100); + QQuickItem *testLayout = testItem(root, "testLayout"); + QVERIFY(testLayout); + QCOMPARE(anchors->fill(), testLayout); + + root->setWidth(root->width() - 100); + layoutChangeSpy.wait(100); + QCOMPARE(anchors->fill(), layout); + } + + void testCase_AnchorFilledMargins() + { + QScopedPointer view(loadTest("AnchorFilledMargins.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *layout = testItem(root, "layoutManager"); + QVERIFY(layout); + QSignalSpy layoutChangeSpy(layout, SIGNAL(currentLayoutChanged())); + + QQuickItem *item = testItem(root, "testItem"); + QVERIFY(item); + + QQuickAnchors *anchors = item->property("anchors").value(); + QVERIFY(anchors); + + root->setWidth(root->width() + 100); + layoutChangeSpy.wait(100); + + QQuickItem *testLayout = testItem(root, "testLayout"); + QVERIFY(testLayout); + QCOMPARE(anchors->fill(), testLayout); + QCOMPARE(anchors->margins(), 0.0); + + root->setWidth(root->width() - 100); + layoutChangeSpy.wait(100); + QCOMPARE(anchors->fill(), layout); + QCOMPARE(anchors->margins(), 10.0); + } + + void testCase_AnchorFilledSeparateMargins() + { + QScopedPointer view(loadTest("AnchorFilledSeparateMargins.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *layout = testItem(root, "layoutManager"); + QVERIFY(layout); + QSignalSpy layoutChangeSpy(layout, SIGNAL(currentLayoutChanged())); + + QQuickItem *item = testItem(root, "testItem"); + QVERIFY(item); + + QQuickAnchors *anchors = item->property("anchors").value(); + QVERIFY(anchors); + + root->setWidth(root->width() + 100); + layoutChangeSpy.wait(100); + + QQuickItem *testLayout = testItem(root, "testLayout"); + QVERIFY(testLayout); + QCOMPARE(anchors->fill(), testLayout); + QCOMPARE(anchors->margins(), 0.0); + QCOMPARE(anchors->leftMargin(), 0.0); + QCOMPARE(anchors->rightMargin(), 0.0); + QCOMPARE(anchors->topMargin(), 0.0); + QCOMPARE(anchors->bottomMargin(), 0.0); + + root->setWidth(root->width() - 100); + layoutChangeSpy.wait(100); + QCOMPARE(anchors->fill(), layout); + QCOMPARE(anchors->leftMargin(), 10.0); + QCOMPARE(anchors->topMargin(), 20.0); + QCOMPARE(anchors->rightMargin(), 30.0); + QCOMPARE(anchors->bottomMargin(), 40.0); + } + + void testCase_AnchorCenteredInDefault() + { + QScopedPointer view(loadTest("AnchorCenteredInDefault.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *layout = testItem(root, "layoutManager"); + QVERIFY(layout); + QSignalSpy layoutChangeSpy(layout, SIGNAL(currentLayoutChanged())); + + QQuickItem *item = testItem(root, "testItem"); + QVERIFY(item); + + QQuickAnchors *anchors = item->property("anchors").value(); + QVERIFY(anchors); + + root->setWidth(root->width() + 100); + layoutChangeSpy.wait(100); + QQuickItem *testLayout = testItem(root, "testLayout"); + QVERIFY(testLayout); + QCOMPARE(anchors->fill(), testLayout); + + root->setWidth(root->width() - 100); + layoutChangeSpy.wait(100); + QCOMPARE(anchors->centerIn(), layout); + } + + void testCase_AnchorVerticalCenter() + { + QScopedPointer view(loadTest("AnchorVerticalCenter.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *layout = testItem(root, "layoutManager"); + QVERIFY(layout); + QSignalSpy layoutChangeSpy(layout, SIGNAL(currentLayoutChanged())); + + QQuickItem *item = testItem(root, "testItem"); + QVERIFY(item); + + QQuickAnchors *anchors = item->property("anchors").value(); + QVERIFY(anchors); + + QCOMPARE(anchors->verticalCenter().item, layout); + + root->setWidth(root->width() + 100); + layoutChangeSpy.wait(100); + QQuickItem *testLayout = testItem(root, "testLayout"); + QVERIFY(testLayout); + QCOMPARE(anchors->fill(), testLayout); + + root->setWidth(root->width() - 100); + layoutChangeSpy.wait(100); + QCOMPARE(anchors->verticalCenter().item, layout); + } + + void testCase_AnchorVerticalCenterOffset() + { + QScopedPointer view(loadTest("AnchorVerticalCenterOffset.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *layout = testItem(root, "layoutManager"); + QVERIFY(layout); + QSignalSpy layoutChangeSpy(layout, SIGNAL(currentLayoutChanged())); + + QQuickItem *item = testItem(root, "testItem"); + QVERIFY(item); + + QQuickAnchors *anchors = item->property("anchors").value(); + QVERIFY(anchors); + + QCOMPARE(anchors->verticalCenter().item, layout); + QCOMPARE(anchors->verticalCenterOffset(), 50.0); + + root->setWidth(root->width() + 100); + layoutChangeSpy.wait(100); + QQuickItem *testLayout = qobject_cast(testItem(root, "testLayout")); + QVERIFY(testLayout); + QCOMPARE(anchors->fill(), testLayout); + // no need to check offset as it does not affect the fill + + root->setWidth(root->width() - 100); + layoutChangeSpy.wait(100); + QCOMPARE(anchors->verticalCenter().item, layout); + QCOMPARE(anchors->verticalCenterOffset(), 50.0); + } + + void testCase_AnchorHorizontalCenter() + { + QScopedPointer view(loadTest("AnchorHorizontalCenter.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *layout = testItem(root, "layoutManager"); + QVERIFY(layout); + QSignalSpy layoutChangeSpy(layout, SIGNAL(currentLayoutChanged())); + + QQuickItem *item = testItem(root, "testItem"); + QVERIFY(item); + + QQuickAnchors *anchors = item->property("anchors").value(); + QVERIFY(anchors); + + QCOMPARE(anchors->horizontalCenter().item, layout); + + root->setWidth(root->width() + 100); + layoutChangeSpy.wait(100); + QQuickItem *testLayout = testItem(root, "testLayout"); + QVERIFY(testLayout); + QCOMPARE(anchors->fill(), testLayout); + + root->setWidth(root->width() - 100); + layoutChangeSpy.wait(100); + QCOMPARE(anchors->horizontalCenter().item, layout); + } + + void testCase_AnchorHorizontalCenterOffset() + { + QScopedPointer view(loadTest("AnchorHorizontalCenterOffset.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *layout = testItem(root, "layoutManager"); + QVERIFY(layout); + QSignalSpy layoutChangeSpy(layout, SIGNAL(currentLayoutChanged())); + + QQuickItem *item = testItem(root, "testItem"); + QVERIFY(item); + + QQuickAnchors *anchors = item->property("anchors").value(); + QVERIFY(anchors); + + QCOMPARE(anchors->horizontalCenter().item, layout); + QCOMPARE(anchors->horizontalCenterOffset(), 50.0); + + root->setWidth(root->width() + 100); + layoutChangeSpy.wait(100); + QQuickItem *testLayout = testItem(root, "testLayout"); + QVERIFY(testLayout); + QCOMPARE(anchors->fill(), testLayout); + // no need to check offset as it does not affect the fill + + root->setWidth(root->width() - 100); + layoutChangeSpy.wait(100); + QCOMPARE(anchors->horizontalCenter().item, layout); + QCOMPARE(anchors->horizontalCenterOffset(), 50.0); + } + + void testCase_AnchorCenterWithOffset() + { + QScopedPointer view(loadTest("AnchorCenterWithOffset.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *layout = testItem(root, "layoutManager"); + QVERIFY(layout); + QSignalSpy layoutChangeSpy(layout, SIGNAL(currentLayoutChanged())); + + QQuickItem *item = testItem(root, "testItem"); + QVERIFY(item); + + QQuickAnchors *anchors = item->property("anchors").value(); + QVERIFY(anchors); + + QCOMPARE(anchors->centerIn(), layout); + QCOMPARE(anchors->verticalCenterOffset(), 50.0); + QCOMPARE(anchors->horizontalCenterOffset(), 40.0); + + root->setWidth(root->width() + 100); + layoutChangeSpy.wait(100); + QQuickItem *testLayout = testItem(root, "testLayout"); + QVERIFY(testLayout); + QCOMPARE(anchors->fill(), testLayout); + // no need to check offsets as it does not affect the fill + + root->setWidth(root->width() - 100); + layoutChangeSpy.wait(100); + QCOMPARE(anchors->centerIn(), layout); + QCOMPARE(anchors->verticalCenterOffset(), 50.0); + QCOMPARE(anchors->horizontalCenterOffset(), 40.0); + } + + void testCase_AnchorLeft() + { + QScopedPointer view(loadTest("AnchorLeft.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *layout = testItem(root, "layoutManager"); + QVERIFY(layout); + QSignalSpy layoutChangeSpy(layout, SIGNAL(currentLayoutChanged())); + + QQuickItem *item = testItem(root, "testItem"); + QVERIFY(item); + + QQuickAnchors *anchors = item->property("anchors").value(); + QVERIFY(anchors); + + QCOMPARE(anchors->left().item, layout); + QCOMPARE(anchors->leftMargin(), 10.0); + + root->setWidth(root->width() + 100); + layoutChangeSpy.wait(100); + QQuickItem *testLayout = testItem(root, "testLayout"); + QVERIFY(testLayout); + QCOMPARE(anchors->fill(), testLayout); + QCOMPARE(anchors->leftMargin(), 0.0); + + root->setWidth(root->width() - 100); + layoutChangeSpy.wait(100); + QCOMPARE(anchors->left().item, layout); + QCOMPARE(anchors->leftMargin(), 10.0); + } + + void testCase_AnchorTop() + { + QScopedPointer view(loadTest("AnchorTop.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *layout = testItem(root, "layoutManager"); + QVERIFY(layout); + QSignalSpy layoutChangeSpy(layout, SIGNAL(currentLayoutChanged())); + + QQuickItem *item = testItem(root, "testItem"); + QVERIFY(item); + + QQuickAnchors *anchors = item->property("anchors").value(); + QVERIFY(anchors); + + QCOMPARE(anchors->top().item, layout); + QCOMPARE(anchors->topMargin(), 10.0); + + root->setWidth(root->width() + 100); + layoutChangeSpy.wait(100); + QQuickItem *testLayout = testItem(root, "testLayout"); + QVERIFY(testLayout); + QCOMPARE(anchors->fill(), testLayout); + QCOMPARE(anchors->topMargin(), 0.0); + + root->setWidth(root->width() - 100); + layoutChangeSpy.wait(100); + QCOMPARE(anchors->top().item, layout); + QCOMPARE(anchors->topMargin(), 10.0); + } + + void testCase_AnchorRight() + { + QScopedPointer view(loadTest("AnchorRight.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *layout = testItem(root, "layoutManager"); + QVERIFY(layout); + QSignalSpy layoutChangeSpy(layout, SIGNAL(currentLayoutChanged())); + + QQuickItem *item = testItem(root, "testItem"); + QVERIFY(item); + + QQuickAnchors *anchors = item->property("anchors").value(); + QVERIFY(anchors); + + QCOMPARE(anchors->right().item, layout); + QCOMPARE(anchors->rightMargin(), 10.0); + + root->setWidth(root->width() + 100); + layoutChangeSpy.wait(100); + QQuickItem *testLayout = testItem(root, "testLayout"); + QVERIFY(testLayout); + QCOMPARE(anchors->fill(), testLayout); + QCOMPARE(anchors->rightMargin(), 0.0); + + root->setWidth(root->width() - 100); + layoutChangeSpy.wait(100); + QCOMPARE(anchors->right().item, layout); + QCOMPARE(anchors->rightMargin(), 10.0); + } + + void testCase_AnchorBottom() + { + QScopedPointer view(loadTest("AnchorBottom.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *layout = testItem(root, "layoutManager"); + QVERIFY(layout); + QSignalSpy layoutChangeSpy(layout, SIGNAL(currentLayoutChanged())); + + QQuickItem *item = testItem(root, "testItem"); + QVERIFY(item); + + QQuickAnchors *anchors = item->property("anchors").value(); + QVERIFY(anchors); + + QCOMPARE(anchors->bottom().item, layout); + QCOMPARE(anchors->bottomMargin(), 10.0); + + root->setWidth(root->width() + 100); + layoutChangeSpy.wait(100); + QQuickItem *testLayout = testItem(root, "testLayout"); + QVERIFY(testLayout); + QCOMPARE(anchors->fill(), testLayout); + QCOMPARE(anchors->bottomMargin(), 0.0); + + root->setWidth(root->width() - 100); + layoutChangeSpy.wait(100); + QCOMPARE(anchors->bottom().item, layout); + QCOMPARE(anchors->bottomMargin(), 10.0); + } + + void testCase_AnchorAll() + { + QScopedPointer view(loadTest("AnchorAll.qml")); + QVERIFY(view); + QQuickItem *root = view->rootObject(); + QVERIFY(root); + + QQuickItem *layout = testItem(root, "layoutManager"); + QVERIFY(layout); + QSignalSpy layoutChangeSpy(layout, SIGNAL(currentLayoutChanged())); + + QQuickItem *item = testItem(root, "testItem"); + QVERIFY(item); + + QQuickAnchors *anchors = item->property("anchors").value(); + QVERIFY(anchors); + + QCOMPARE(anchors->left().item, layout); + QCOMPARE(anchors->top().item, layout); + QCOMPARE(anchors->right().item, layout); + QCOMPARE(anchors->bottom().item, layout); + QVERIFY(!anchors->fill()); + QCOMPARE(anchors->margins(), 20.0); + + root->setWidth(root->width() + 100); + layoutChangeSpy.wait(100); + QQuickItem *testLayout = testItem(root, "testLayout"); + QVERIFY(testLayout); + QCOMPARE(anchors->fill(), testLayout); + QVERIFY(!anchors->left().item); + QVERIFY(!anchors->top().item); + QVERIFY(!anchors->right().item); + QVERIFY(!anchors->bottom().item); + QCOMPARE(anchors->margins(), 0.0); + + root->setWidth(root->width() - 100); + layoutChangeSpy.wait(100); + QCOMPARE(anchors->left().item, layout); + QCOMPARE(anchors->top().item, layout); + QCOMPARE(anchors->right().item, layout); + QCOMPARE(anchors->bottom().item, layout); + QVERIFY(!anchors->fill()); + QCOMPARE(anchors->margins(), 20.0); + } + +}; + +QTEST_MAIN(tst_Layouts) + +#include "tst_layouts.moc" diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/tst_layouts.pro ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/tst_layouts.pro --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/tst_layouts/tst_layouts.pro 1970-01-01 00:00:00.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/tst_layouts/tst_layouts.pro 2013-12-11 12:43:36.000000000 +0000 @@ -0,0 +1,37 @@ +include(../test-include.pri) +include(../../unit/qtprivate_dependency.pri) + +QT += gui +SOURCES += \ + tst_layouts.cpp + +OTHER_FILES += \ + SimpleLayouts.qml \ + NoLayouts.qml \ + OverlappingCondition.qml \ + SmallLayout.qml \ + MediumLayout.qml \ + LargeLayout.qml \ + ExternalLayouts.qml \ + NestedLayouts.qml \ + DefaultLayout.qml \ + ResizingContainers.qml \ + SizedDefaultLayout.qml \ + CurrentLayoutChange.qml \ + PositioningOnLayoutChange.qml \ + LaidOutItemsOutsideOfLayout.qml \ + OverlaidInItemLayout.qml \ + AnchorFilledReparenting.qml \ + AnchorCenteredInDefault.qml \ + AnchorFilledMargins.qml \ + AnchorFilledSeparateMargins.qml \ + AnchorVerticalCenter.qml \ + AnchorVerticalCenterOffset.qml \ + AnchorCenterWithOffset.qml \ + AnchorHorizontalCenter.qml \ + AnchorHorizontalCenterOffset.qml \ + AnchorLeft.qml \ + AnchorRight.qml \ + AnchorTop.qml \ + AnchorBottom.qml \ + AnchorAll.qml diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/unit_x11.pro ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/unit_x11.pro --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/tests/unit_x11/unit_x11.pro 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/tests/unit_x11/unit_x11.pro 2013-12-11 12:43:36.000000000 +0000 @@ -1,3 +1,3 @@ TEMPLATE = subdirs -SUBDIRS += tst_components tst_test tst_inversemousearea tst_recreateview tst_statesaver tst_theme_engine tst_orientation +SUBDIRS += tst_components tst_test tst_inversemousearea tst_recreateview tst_statesaver tst_theme_engine tst_orientation tst_layouts diff -Nru ubuntu-ui-toolkit-0.1.46+14.04.20131129/ubuntu-sdk.pro ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/ubuntu-sdk.pro --- ubuntu-ui-toolkit-0.1.46+14.04.20131129/ubuntu-sdk.pro 2013-11-29 20:24:35.000000000 +0000 +++ ubuntu-ui-toolkit-0.1.46+14.04.20131129+doxfix/ubuntu-sdk.pro 2013-12-11 12:43:36.000000000 +0000 @@ -35,13 +35,25 @@ license.commands = ./tests/license/checklicense.sh QMAKE_EXTRA_TARGETS += license +DOC_SRC = . +equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 2) { + DOC_SRC = documentation +} + DOC_PATH=$$system(pwd)/documentation docs.target = docs -docs.commands += qdoc $$DOC_PATH/ubuntu-ui-toolkit-qtcreator.qdocconf 2> $$DOC_PATH/qdoc.err; -docs.commands += cat $$DOC_PATH/qdoc.err; +# Offline docs for QtCreator +docs.commands += SRC=$$DOC_SRC qdoc $$DOC_PATH/ubuntu-ui-toolkit-qtcreator.qdocconf 2> $$DOC_PATH/qdoc.err; +# FIXME: With Qt 5.2 this warning shows up, forcibly omit it from errors +docs.commands += cat $$DOC_PATH/qdoc.err | grep -v \"qdoc: warning: No documentation for \'global\'\" > $$DOC_PATH/qdoc.err; docs.commands += test ! -s $$DOC_PATH/qdoc.err || exit 1; docs.commands += qhelpgenerator -o "$$DOC_PATH/html/ubuntuuserinterfacetoolkit.qch" "$$DOC_PATH/html/ubuntuuserinterfacetoolkit.qhp"; -docs.commands += qdoc $$DOC_PATH/ubuntu-ui-toolkit-online.qdocconf; +# Online docs. Run qdoc twice: the second run with indexes for cross-referencing +# other APIs but discard errors because qdoc inherits all doc bugs otherwise +docs.commands += SRC=$$DOC_SRC qdoc $$DOC_PATH/ubuntu-ui-toolkit-online.qdocconf 2> $$DOC_PATH/qdoc.err; +docs.commands += cat $$DOC_PATH/qdoc.err | grep -v \"qdoc: warning: No documentation for \'global\'\" > $$DOC_PATH/qdoc.err; +docs.commands += test ! -s $$DOC_PATH/qdoc.err || exit 1; +docs.commands += SRC=$$DOC_SRC qdoc $$DOC_PATH/ubuntu-ui-toolkit-online-indexes.qdocconf 2> /dev/null; docs.commands += $$DOC_PATH/fix-markup.sh $$DOC_PATH; QMAKE_EXTRA_TARGETS += docs