Highlight favorites while dragging appIcons

This commit is contained in:
Charles Gagnon
2018-12-28 20:33:41 -05:00
parent 5e0f64ed5a
commit e2eeb02901
2 changed files with 16 additions and 0 deletions

View File

@@ -49,6 +49,10 @@
background-color: rgba(238, 238, 236, 0.1);
}
#dashtopanelScrollview .app-well-app .favorite {
background-color: rgba(80, 150, 255, 0.4);
}
#dashtopanelScrollview .app-well-app-running-dot {
margin-bottom: 0;
}

View File

@@ -391,6 +391,8 @@ var taskbar = new Lang.Class({
this._box.insert_child_at_index(this._emptyDropTarget, 0);
this._emptyDropTarget.show(true);
}
this._toggleFavortieHighlight(true);
},
_onDragCancelled: function() {
@@ -415,6 +417,8 @@ var taskbar = new Lang.Class({
this._clearEmptyDropTarget();
this._showAppsIcon.setDragApp(null);
DND.removeDragMonitor(this._dragMonitor);
this._toggleFavortieHighlight();
},
_onDragMotion: function(dragEvent) {
@@ -432,6 +436,14 @@ var taskbar = new Lang.Class({
return DND.DragMotionResult.CONTINUE;
},
_toggleFavortieHighlight: function(show) {
let appFavorites = AppFavorites.getAppFavorites();
let cssFuncName = (show ? 'add' : 'remove') + '_style_class_name';
this._getAppIcons().filter(appIcon => appFavorites.isFavorite(appIcon.app.get_id()))
.forEach(fav => fav._container[cssFuncName]('favorite'));
},
_appIdListToHash: function(apps) {
let ids = {};
for (let i = 0; i < apps.length; i++)