[gnome-shell/gbsneto/custom-icon-positions: 24/35] appDisplay: Introduce moveItem API



commit 42c1bd42d90d5234b717142e1cade819489e58ef
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue May 26 10:58:56 2020 -0300

    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

 js/ui/appDisplay.js | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 05608cad16..7bef3f0944 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -537,6 +537,13 @@ var BaseAppView = GObject.registerClass({
         this._grid.removeNudges();
     }
 
+    moveItem(item, newPage, newPosition) {
+        if (this._grid.contains(item))
+            this._removeItem(item);
+
+        this._addItem(item, newPage, newPosition);
+    }
+
     adaptToSize(width, height) {
         let box = new Clutter.ActorBox();
         box.x1 = 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]