on xenial help sign in
Merged mzanetti's branch fixing issues for launcher-icons of apps not pinned or running.
0045682Mirco Müller
plugins/Unity/Launcher/dbusinterface.cpp+5−1
@@ -158,7 +158,11 @@ bool DBusInterface::handleMessage(const QDBusMessage& message, const QDBusConnec
158 return false;
158 return false;
159 }
159 }
160
160
161+ if (message.member() == "Get" && (message.arguments().count() != 2 || message.arguments()[0].toString() != "com.canonical.Unity.Launcher.Item")) {
162+ return false;
163+ }
164+
161− if (message.member() != "GetAll" && message.arguments()[0].toString() != "com.canonical.Unity.Launcher.Item") {
165+ if (message.member() == "Set" && (message.arguments().count() != 3 || message.arguments()[0].toString() != "com.canonical.Unity.Launcher.Item")) {
162 return false;
166 return false;
163 }
167 }
164
168
plugins/Unity/Launcher/launchermodel.cpp+1−2
@@ -357,7 +357,7 @@ void LauncherModel::countChanged(const QString &appId, int count)
357 }
357 }
358}
358}
359
359
360−void LauncherModel::countVisibleChanged(const QString &appId, int countVisible)
360+void LauncherModel::countVisibleChanged(const QString &appId, bool countVisible)
361{
361{
362 int idx = findApplication(appId);
362 int idx = findApplication(appId);
363 if (idx >= 0) {
363 if (idx >= 0) {
@@ -385,7 +385,6 @@ void LauncherModel::countVisibleChanged(const QString &appId, int countVisible)
385 beginInsertRows(QModelIndex(), m_list.count(), m_list.count());
385 beginInsertRows(QModelIndex(), m_list.count(), m_list.count());
386 m_list.append(item);
386 m_list.append(item);
387 endInsertRows();
387 endInsertRows();
388− Q_EMIT hint();
389 }
388 }
390 }
389 }
391 m_asAdapter->syncItems(m_list);
390 m_asAdapter->syncItems(m_list);
plugins/Unity/Launcher/launchermodel.h+1−1
@@ -73,7 +73,7 @@ private:
73
73
74private Q_SLOTS:
74private Q_SLOTS:
75 void countChanged(const QString &appId, int count);
75 void countChanged(const QString &appId, int count);
76− void countVisibleChanged(const QString &appId, int count);
76+ void countVisibleChanged(const QString &appId, bool count);
77 void progressChanged(const QString &appId, int progress);
77 void progressChanged(const QString &appId, int progress);
78
78
79 void applicationAdded(const QModelIndex &parent, int row);
79 void applicationAdded(const QModelIndex &parent, int row);
qml/Launcher/LauncherPanel.qml+19−18
@@ -119,12 +119,6 @@ Rectangle {
119 // need to be smaller than this size to avoid breakage.
119 // need to be smaller than this size to avoid breakage.
120 property int extensionSize: 0
120 property int extensionSize: 0
121
121
122− // These properties are needed to facilitate implicitly unfolding the
123− // launcher to the peeking icon, if it is not already fully flat
124− // and in view for the user
125− property real moveToIndexYFrom
126− property real moveToIndexYTo
127−
128 // Setting extensionSize after the list has been populated because it has
122 // Setting extensionSize after the list has been populated because it has
129 // the potential to mess up with the intial positioning in combination
123 // the potential to mess up with the intial positioning in combination
130 // with snapping to the center of the list. This catches all the cases
124 // with snapping to the center of the list. This catches all the cases
@@ -138,14 +132,6 @@ Rectangle {
138 flick(0, clickFlickSpeed)
132 flick(0, clickFlickSpeed)
139 }
133 }
140
134
141− UbuntuNumberAnimation {
142− id: moveToIndexAnimation
143− target: launcherListView
144− property: "contentY"
145− from: launcherListView.moveToIndexYFrom
146− to: launcherListView.moveToIndexYTo
147− }
148−
149 // The height of the area where icons start getting folded
135 // The height of the area where icons start getting folded
150 property int foldingStartHeight: units.gu(6.5)
136 property int foldingStartHeight: units.gu(6.5)
151 // The height of the area where the items reach the final folding angle
137 // The height of the area where the items reach the final folding angle
@@ -177,6 +163,17 @@ Rectangle {
177 to: launcherListView.contentHeight - launcherListView.height + launcherListView.originY - launcherListView.topMargin
163 to: launcherListView.contentHeight - launcherListView.height + launcherListView.originY - launcherListView.topMargin
178 }
164 }
179
165
166+ UbuntuNumberAnimation {
167+ id: moveAnimation
168+ target: launcherListView
169+ property: "contentY"
170+ function moveTo(contentY) {
171+ from = launcherListView.contentY;
172+ to = contentY;
173+ start();
174+ }
175+ }
176+
180 displaced: Transition {
177 displaced: Transition {
181 NumberAnimation { properties: "x,y"; duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
178 NumberAnimation { properties: "x,y"; duration: UbuntuAnimation.FastDuration; easing: UbuntuAnimation.StandardEasing }
182 }
179 }
@@ -236,10 +233,14 @@ Rectangle {
236 onAlertingChanged: {
233 onAlertingChanged: {
237 if(alerting) {
234 if(alerting) {
238 if (!dragging && (launcherListView.peekingIndex === -1 || launcher.visibleWidth > 0)) {
235 if (!dragging && (launcherListView.peekingIndex === -1 || launcher.visibleWidth > 0)) {
239− launcherListView.moveToIndexYFrom = launcherListView.contentY
236+ var itemPosition = index * launcherListView.itemHeight;
240− launcherListView.positionViewAtIndex(index, ListView.Center)
237+ var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin
238+ var distanceToEnd = index == 0 || index == launcherListView.count - 1 ? 0 : launcherListView.itemHeight
239+ if (itemPosition + launcherListView.itemHeight + distanceToEnd > launcherListView.contentY + launcherListView.topMargin + height) {
241− launcherListView.moveToIndexYTo = launcherListView.contentY
240+ moveAnimation.moveTo(itemPosition + launcherListView.itemHeight - launcherListView.topMargin - height + distanceToEnd);
242− moveToIndexAnimation.start()
241+ } else if (itemPosition - distanceToEnd < launcherListView.contentY + launcherListView.topMargin) {
242+ moveAnimation.moveTo(itemPosition - distanceToEnd - launcherListView.topMargin);
243+ }
243 if (!dragging && launcher.state !== "visible") {
244 if (!dragging && launcher.state !== "visible") {
244 peekingAnimation.start()
245 peekingAnimation.start()
245 }
246 }