on xenial help sign in
fix size of items
commitc5d2e653ee1470b10a17819663262ec20fcd8ce0 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 20 Jun 2013, 17:24 (13 years ago) parentb1b4fee
3 files changed+57−33
Launcher/LauncherDelegate.qml+27−21 Launcher/LauncherPanel.qml+30−12 Launcher/graphics/home@18.png
Launcher/LauncherDelegate.qml+27−21
@@ -42,40 +42,46 @@ Item {
4242 signal longtap()
4343 signal released()
4444
45− UbuntuShape {
45+ Item {
4646 id: iconItem
47− color: Qt.rgba(0, 0, 1, 0.5)
4847 width: parent.width
4948 height: parent.height
5049 anchors.centerIn: parent
51− radius: "medium"
5250
53− image: Image {
54− id: iconImage
55− source: "../graphics/applicationIcons/" + root.iconName + ".png"
56− }
57−
58− MouseArea {
59− id: mouseArea
60− anchors.fill: parent
61− onClicked: root.clicked()
62− onCanceled: root.released()
63− preventStealing: false
51+ UbuntuShape {
52+ color: Qt.rgba(0, 0, 1, 0.5)
53+ width: parent.width - units.gu(1)
54+ height: parent.height - units.gu(1)
55+ anchors.centerIn: parent
56+ radius: "medium"
6457
65− onPressAndHold: {
66− root.state = "moving"
58+ image: Image {
59+ id: iconImage
60+ source: "../graphics/applicationIcons/" + root.iconName + ".png"
6761 }
68− onReleased: {
69− root.state = "docked"
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+ }
73+ onReleased: {
74+ root.state = "docked"
75+ }
7076 }
71− }
7277
78+ }
7379 BorderImage {
7480 id: overlayHighlight
7581 anchors.centerIn: iconItem
7682 rotation: inverted ? 180 : 0
7783 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)
7985 height: width
8086 }
8187 }
@@ -209,7 +215,7 @@ Item {
209215 if (index == 0 || index == iconRepeater.count-1) {
210216 if (priv.distanceFromEdge < 0) {
211217 // 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))
213219 }
214220 return 1; // Don't make first/last item transparent as long as inside the view
215221 }
Launcher/LauncherPanel.qml+30−12
@@ -17,6 +17,7 @@
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919import Unity 0.1
20+import "../Components/ListItems"
2021
2122Item {
2223 id: root
@@ -24,7 +25,7 @@ Item {
2425 rotation: inverted ? 180 : 0
2526
2627 property var model
27− property bool inverted: true
28+ property bool inverted: false
2829 property bool dragging: false
2930 property bool moving: launcherFlickable.moving
3031 property int dragPosition: 0
@@ -61,24 +62,41 @@ Item {
6162
6263 Column {
6364 id: mainColumn
64− anchors.fill: parent
65− anchors.margins: units.gu(1)
66− spacing: units.gu(1)
65+ anchors {
66+ fill: parent
67+ topMargin: units.gu(0.5)
68+ bottomMargin: units.gu(1)
69+ leftMargin: units.gu(0.5)
70+ rightMargin: units.gu(0.5)
71+ }
72+ spacing: units.gu(0.5)
6773
68− LauncherDelegate {
74+ MouseArea {
6975 id: dashItem
70− objectName: "dashItem"
71− width: launcherFlickable.itemSize
72− height: launcherFlickable.itemSize
73− anchors.horizontalCenter: parent.horizontalCenter
74− iconName: "dash"
76+ width: parent.width
77+ height: units.gu(6.5)
7578 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+ }
7686 }
87+ ThinDivider {
88+ anchors {
89+ left: parent.left
90+ right: parent.right
91+ margins: -mainColumn.anchors.leftMargin
92+ }
93+ }
94+
7795 Flickable {
7896 id: launcherFlickable
7997 anchors.left: parent.left
8098 anchors.right: parent.right
81− height: parent.height - dashItem.height - parent.spacing
99+ height: parent.height - dashItem.height - parent.spacing*2
82100 contentHeight: launcherColumn.height
83101
84102 property int itemSize: width
@@ -86,7 +104,7 @@ Item {
86104 Column {
87105 id: launcherColumn
88106 width: parent.width
89− spacing: units.gu(1)
107+ //spacing: units.gu(1)
90108 anchors.horizontalCenter: parent.horizontalCenter
91109
92110 Repeater {
Launcher/graphics/home@18.pngnew file

Binary file not shown.