appDisplay: Introduce moveItem API
This is a simplistic API that basically removes the icon from it's old location, and adds it to its new location. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
This commit is contained in:
parent
8e24ac6b26
commit
1e31caf0b8
@ -456,6 +456,17 @@ var BaseAppView = GObject.registerClass({
|
|||||||
return [targetPage, targetPosition, dragLocation];
|
return [targetPage, targetPosition, dragLocation];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_moveItem(item, newPage, newPosition) {
|
||||||
|
const [page, position] = this._grid.getItemPosition(item);
|
||||||
|
if (page === newPage && position === newPosition)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (page !== -1 && position !== -1)
|
||||||
|
this._removeItem(item);
|
||||||
|
|
||||||
|
this._addItem(item, newPage, newPosition);
|
||||||
|
}
|
||||||
|
|
||||||
vfunc_allocate(box) {
|
vfunc_allocate(box) {
|
||||||
const width = box.get_width();
|
const width = box.get_width();
|
||||||
const height = box.get_height();
|
const height = box.get_height();
|
||||||
|
Loading…
Reference in New Issue
Block a user