on xenial help sign in
Review suggestions
3c64a91Andrea Cimitan
qml/Components/LazyImage.qml+4−12
@@ -85,16 +85,13 @@ Item {
85 height: root.initialHeight
85 height: root.initialHeight
86 width: root.initialWidth
86 width: root.initialWidth
87 anchors.centerIn: root.scaleTo == "fit" ? parent : undefined
87 anchors.centerIn: root.scaleTo == "fit" ? parent : undefined
88−
88+ active: useUbuntuShape
89 opacity: 0
89 opacity: 0
90 visible: opacity != 0
90 visible: opacity != 0
91−
91+ sourceComponent: UbuntuShape {}
92− sourceComponent: useUbuntuShape ? ubuntuShapeComponent : itemComponent
93 onLoaded: {
92 onLoaded: {
94− if (sourceComponent === ubuntuShapeComponent) {
95− item.image = image;
93+ item.image = image;
96− item.borderSource = Qt.binding(function() { return root.borderSource })
94+ item.borderSource = Qt.binding(function() { return root.borderSource })
97− }
98 }
95 }
99
96
100 Image {
97 Image {
@@ -120,11 +117,6 @@ Item {
120 }
117 }
121 }
118 }
122
119
123− Component {
124− id: itemComponent
125− Item {}
126− }
127−
128 Component {
120 Component {
129 id: ubuntuShapeComponent
121 id: ubuntuShapeComponent
130 UbuntuShape {}
122 UbuntuShape {}
qml/Dash/Previews/Preview.qml+2−2
@@ -100,8 +100,8 @@ Item {
100 anchors {
100 anchors {
101 left: parent.left
101 left: parent.left
102 right: parent.right
102 right: parent.right
103− leftMargin: units.gu(1)
103+ leftMargin: widgetMargins
104− rightMargin: units.gu(1)
104+ rightMargin: widgetMargins
105 }
105 }
106
106
107 onTriggered: {
107 onTriggered: {
qml/Dash/Previews/PreviewVideoPlayback.qml+2−1
@@ -30,12 +30,13 @@ PreviewWidget {
30 implicitWidth: units.gu(35)
30 implicitWidth: units.gu(35)
31 implicitHeight: childrenRect.height
31 implicitHeight: childrenRect.height
32
32
33+ widgetMargins: -units.gu(1)
34+
33 LazyImage {
35 LazyImage {
34 objectName: "screenshot"
36 objectName: "screenshot"
35 anchors {
37 anchors {
36 left: parent.left
38 left: parent.left
37 right: parent.right
39 right: parent.right
38− margins: -units.gu(2) // to counterbalance the margins of each Preview and have them touch the edges
39 }
40 }
40 scaleTo: "width"
41 scaleTo: "width"
41 source: {
42 source: {
qml/Dash/Previews/PreviewWidget.qml+3
@@ -34,6 +34,9 @@ Item {
34 //! Should the widget show in expanded mode (For those that support it)
34 //! Should the widget show in expanded mode (For those that support it)
35 property bool expanded: true
35 property bool expanded: true
36
36
37+ //! Set margins width.
38+ property real widgetMargins: units.gu(1)
39+
37 /*! \brief This signal should be emitted when a preview action was triggered.
40 /*! \brief This signal should be emitted when a preview action was triggered.
38 *
41 *
39 * \param widgetId, actionId Respective identifiers from widgetData.
42 * \param widgetId, actionId Respective identifiers from widgetData.
qml/Dash/Previews/PreviewWidgetFactory.qml+3
@@ -40,6 +40,9 @@ Loader {
40 //! Set to true if the parent preview is displayed.
40 //! Set to true if the parent preview is displayed.
41 property bool isCurrentPreview: false
41 property bool isCurrentPreview: false
42
42
43+ //! Set margins width.
44+ property real widgetMargins: status === Loader.Ready ? item.widgetMargins : units.gu(1)
45+
43 //! Triggered signal forwarded from the widgets.
46 //! Triggered signal forwarded from the widgets.
44 signal triggered(string widgetId, string actionId, var data)
47 signal triggered(string widgetId, string actionId, var data)
45
48
qml/Dash/Previews/PreviewZoomableImage.qml+2−1
@@ -30,6 +30,8 @@ PreviewWidget {
30 implicitWidth: units.gu(35)
30 implicitWidth: units.gu(35)
31 implicitHeight: lazyImage.height
31 implicitHeight: lazyImage.height
32
32
33+ widgetMargins: -units.gu(1)
34+
33 property Item rootItem: QuickUtils.rootItem(root)
35 property Item rootItem: QuickUtils.rootItem(root)
34
36
35 LazyImage {
37 LazyImage {
@@ -38,7 +40,6 @@ PreviewWidget {
38 anchors {
40 anchors {
39 left: parent.left
41 left: parent.left
40 right: parent.right
42 right: parent.right
41− margins: -units.gu(2) // to counterbalance the margins of each Preview and have them touch the edges
42 }
43 }
43 scaleTo: "width"
44 scaleTo: "width"
44 source: widgetData["source"]
45 source: widgetData["source"]