[gnome-shell/gbsneto/custom-icon-positions: 14/36] appDisplay: Introduce moveItem API
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/custom-icon-positions: 14/36] appDisplay: Introduce moveItem API
- Date: Wed, 24 Jun 2020 20:20:52 +0000 (UTC)
commit 019196bb5d1e0b937c0e5cdac10e3a21c7b1621c
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 | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 78a5048122..3eb605a162 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -470,6 +470,17 @@ var BaseAppView = GObject.registerClass({
return [item, dragLocation];
}
+ moveItem(item, newPage, newPosition) {
+ const [page, position] = this._grid.getItemPosition(item);
+ if (page === newPage && position === newPosition)
+ return;
+
+ if (this._grid.contains(item))
+ this._removeItem(item);
+
+ this._addItem(item, newPage, newPosition);
+ }
+
adaptToSize(width, height) {
let box = new Clutter.ActorBox({
x2: width,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]