dash: Make the show apps button insensitive when we're dragging a non-favorite

This doesn't handle the tooltip case, unfortunately. That will come in a bit.

https://bugzilla.gnome.org/show_bug.cgi?id=685313
This commit is contained in:
Jasper St. Pierre 2012-10-02 20:53:07 -03:00
parent f994ada576
commit 52871c781a

View File

@ -285,8 +285,16 @@ const ShowAppsIcon = new Lang.Class({
this.setLabelText(_("Show Applications"));
},
// Rely on the dragged item being a favorite
handleDragOver: function(source, actor, x, y, time) {
let app = getAppFromSource(source);
if (app == null)
return DND.DragMotionResult.NO_DROP;
let id = app.get_id();
let isFavorite = AppFavorites.getAppFavorites().isFavorite(id);
if (!isFavorite)
return DND.DragMotionResult.NO_DROP;
return DND.DragMotionResult.MOVE_DROP;
},