on xenial help sign in
fix size of items
c5d2e65Michael Zanetti
Launcher/LauncherDelegate.qml+27−21
@@ -42,40 +42,46 @@ Item {
42 signal longtap()
42 signal longtap()
43 signal released()
43 signal released()
44
44
45− UbuntuShape {
45+ Item {
46 id: iconItem
46 id: iconItem
47− color: Qt.rgba(0, 0, 1, 0.5)
48 width: parent.width
47 width: parent.width
49 height: parent.height
48 height: parent.height
50 anchors.centerIn: parent
49 anchors.centerIn: parent
51− radius: "medium"
52
50
53− image: Image {
51+ UbuntuShape {
54− id: iconImage
52+ color: Qt.rgba(0, 0, 1, 0.5)
55− source: "../graphics/applicationIcons/" + root.iconName + ".png"
53+ width: parent.width - units.gu(1)
56− }
54+ height: parent.height - units.gu(1)
57−
58− MouseArea {
59− id: mouseArea
60− anchors.fill: parent
55+ anchors.centerIn: parent
61− onClicked: root.clicked()
56+ radius: "medium"
62− onCanceled: root.released()
63− preventStealing: false
64
57
65− onPressAndHold: {
58+ image: Image {
66− root.state = "moving"
59+ id: iconImage
60+ source: "../graphics/applicationIcons/" + root.iconName + ".png"
67 }
61 }
62+
63+ MouseArea {
64+ id: mouseArea
65+ anchors.fill: parent
66+ onClicked: root.clicked()
67+ onCanceled: root.released()
68+ preventStealing: false
69+
70+ onPressAndHold: {
71+ root.state = "moving"
72+ }
68− onReleased: {
73+ onReleased: {
69− root.state = "docked"
74+ root.state = "docked"
75+ }
70 }
76 }
71− }
72
77
78+ }
73 BorderImage {
79 BorderImage {
74 id: overlayHighlight
80 id: overlayHighlight
75 anchors.centerIn: iconItem
81 anchors.centerIn: iconItem
76 rotation: inverted ? 180 : 0
82 rotation: inverted ? 180 : 0
77 source: root.highlighted || mouseArea.pressed ? "graphics/selected.sci" : "graphics/non-selected.sci"
83 source: root.highlighted || mouseArea.pressed ? "graphics/selected.sci" : "graphics/non-selected.sci"
78− width: iconItem.width + units.gu(1.5)
84+ width: root.width + units.gu(0.5)
79 height: width
85 height: width
80 }
86 }
81 }
87 }
@@ -209,7 +215,7 @@ Item {
209 if (index == 0 || index == iconRepeater.count-1) {
215 if (index == 0 || index == iconRepeater.count-1) {
210 if (priv.distanceFromEdge < 0) {
216 if (priv.distanceFromEdge < 0) {
211 // Fade from 1 to 0 in the distance of 2 items height (which is when the next item reaches the edge)
217 // Fade from 1 to 0 in the distance of 2 items height (which is when the next item reaches the edge)
212− return 1.0 - (-priv.distanceFromEdge / (priv.totalUnfoldedHeight * 2))
218+ return 1.0 - (-priv.distanceFromEdge / (priv.foldingAreaHeight * 3))
213 }
219 }
214 return 1; // Don't make first/last item transparent as long as inside the view
220 return 1; // Don't make first/last item transparent as long as inside the view
215 }
221 }
Launcher/LauncherPanel.qml+30−12
@@ -17,6 +17,7 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19import Unity 0.1
19import Unity 0.1
20+import "../Components/ListItems"
20
21
21Item {
22Item {
22 id: root
23 id: root
@@ -24,7 +25,7 @@ Item {
24 rotation: inverted ? 180 : 0
25 rotation: inverted ? 180 : 0
25
26
26 property var model
27 property var model
27− property bool inverted: true
28+ property bool inverted: false
28 property bool dragging: false
29 property bool dragging: false
29 property bool moving: launcherFlickable.moving
30 property bool moving: launcherFlickable.moving
30 property int dragPosition: 0
31 property int dragPosition: 0
@@ -61,24 +62,41 @@ Item {
61
62
62 Column {
63 Column {
63 id: mainColumn
64 id: mainColumn
65+ anchors {
64− anchors.fill: parent
66+ fill: parent
65− anchors.margins: units.gu(1)
67+ topMargin: units.gu(0.5)
68+ bottomMargin: units.gu(1)
69+ leftMargin: units.gu(0.5)
70+ rightMargin: units.gu(0.5)
71+ }
66− spacing: units.gu(1)
72+ spacing: units.gu(0.5)
67
73
68− LauncherDelegate {
74+ MouseArea {
69 id: dashItem
75 id: dashItem
70− objectName: "dashItem"
76+ width: parent.width
71− width: launcherFlickable.itemSize
77+ height: units.gu(6.5)
72− height: launcherFlickable.itemSize
73− anchors.horizontalCenter: parent.horizontalCenter
74− iconName: "dash"
75 onClicked: root.dashItemSelected(0)
78 onClicked: root.dashItemSelected(0)
79+ Image {
80+ objectName: "dashItem"
81+ width: units.gu(5.5)
82+ height: width
83+ anchors.centerIn: parent
84+ source: "graphics/home.png"
85+ }
76 }
86 }
87+ ThinDivider {
88+ anchors {
89+ left: parent.left
90+ right: parent.right
91+ margins: -mainColumn.anchors.leftMargin
92+ }
93+ }
94+
77 Flickable {
95 Flickable {
78 id: launcherFlickable
96 id: launcherFlickable
79 anchors.left: parent.left
97 anchors.left: parent.left
80 anchors.right: parent.right
98 anchors.right: parent.right
81− height: parent.height - dashItem.height - parent.spacing
99+ height: parent.height - dashItem.height - parent.spacing*2
82 contentHeight: launcherColumn.height
100 contentHeight: launcherColumn.height
83
101
84 property int itemSize: width
102 property int itemSize: width
@@ -86,7 +104,7 @@ Item {
86 Column {
104 Column {
87 id: launcherColumn
105 id: launcherColumn
88 width: parent.width
106 width: parent.width
89− spacing: units.gu(1)
107+ //spacing: units.gu(1)
90 anchors.horizontalCenter: parent.horizontalCenter
108 anchors.horizontalCenter: parent.horizontalCenter
91
109
92 Repeater {
110 Repeater {
Launcher/graphics/home@18.pngnew file

Binary file not shown.