diff options
Diffstat (limited to 'examples/quick/demos')
-rw-r--r-- | examples/quick/demos/rssnews/content/CategoryDelegate.qml | 60 | ||||
-rw-r--r-- | examples/quick/demos/rssnews/content/NewsDelegate.qml | 21 |
2 files changed, 23 insertions, 58 deletions
diff --git a/examples/quick/demos/rssnews/content/CategoryDelegate.qml b/examples/quick/demos/rssnews/content/CategoryDelegate.qml index cb48715609..93d688a29c 100644 --- a/examples/quick/demos/rssnews/content/CategoryDelegate.qml +++ b/examples/quick/demos/rssnews/content/CategoryDelegate.qml @@ -39,7 +39,6 @@ ****************************************************************************/ import QtQuick 2.2 -import QtGraphicalEffects 1.0 Rectangle { id: delegate @@ -54,56 +53,21 @@ Rectangle { source: image } - Item { - id: title - anchors.fill: parent + Text { + id: titleText - Text { - id: titleText - - anchors { - left: parent.left; leftMargin: 20 - right: parent.right; rightMargin: 20 - top: parent.top; topMargin: 20 - } - font { pixelSize: 18; bold: true } - text: name - color: selected ? "#ffffff" : "#ebebdd" - Behavior on color { ColorAnimation { duration: 150 } } + anchors { + left: parent.left; leftMargin: 20 + right: parent.right; rightMargin: 20 + top: parent.top; topMargin: 20 } - DropShadow { - source: titleText - anchors.fill: titleText - horizontalOffset: selected ? 3 : 1 - verticalOffset: selected ? 3 : 1 - radius: 4 - color: "#2f1000" - samples: 8 - - Behavior on horizontalOffset { NumberAnimation { duration: 300 } } - Behavior on verticalOffset { NumberAnimation { duration: 300 } } - } - - states: [ - State { - name: "selected" - when: selected - PropertyChanges { target: title; scale: "1.1" } - }] - - transitions: [ - Transition { - to: "selected" - SequentialAnimation { - id: titleAnimation - PropertyAnimation { target: title; property: "scale"; duration: 300 } - } - }, - Transition { - to: "" - animations: titleAnimation - }] + font { pixelSize: 18; bold: true } + text: name + color: selected ? "#ffffff" : "#ebebdd" + scale: selected ? 1.15 : 1.0 + Behavior on color { ColorAnimation { duration: 150 } } + Behavior on scale { PropertyAnimation { duration: 300 } } } BusyIndicator { diff --git a/examples/quick/demos/rssnews/content/NewsDelegate.qml b/examples/quick/demos/rssnews/content/NewsDelegate.qml index fee1119b08..280e4d1631 100644 --- a/examples/quick/demos/rssnews/content/NewsDelegate.qml +++ b/examples/quick/demos/rssnews/content/NewsDelegate.qml @@ -39,11 +39,11 @@ ****************************************************************************/ import QtQuick 2.2 -import QtQuick.Layouts 1.1 -ColumnLayout { +Column { id: delegate width: delegate.ListView.view.width + spacing: 8 // Returns a string representing how long ago an event occurred function timeSinceEvent(pubDate) { @@ -77,13 +77,15 @@ ColumnLayout { return result; } - RowLayout { - Layout.maximumWidth: parent.width + Item { height: 8; width: delegate.width } - ColumnLayout { - Layout.alignment: Qt.AlignTop + Row { + width: parent.width + spacing: 8 + Column { Item { + width: 4 height: titleText.font.pixelSize / 4 } @@ -97,7 +99,7 @@ ColumnLayout { id: titleText text: title - Layout.maximumWidth: delegate.width - titleImage.width + width: delegate.width - titleImage.width wrapMode: Text.WordWrap font.pixelSize: 26 font.bold: true @@ -105,11 +107,10 @@ ColumnLayout { } Text { - Layout.maximumWidth: delegate.width + width: delegate.width font.pixelSize: 12 textFormat: Text.RichText font.italic: true - Layout.alignment: Qt.AlignLeft text: timeSinceEvent(pubDate) + " (<a href=\"" + link + "\">Link</a>)" onLinkActivated: { Qt.openUrlExternally(link) @@ -120,7 +121,7 @@ ColumnLayout { id: descriptionText text: description - Layout.maximumWidth: parent.width + width: parent.width wrapMode: Text.WordWrap font.pixelSize: 14 textFormat: Text.StyledText |