diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index 474fe5905..8298276a1 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -520,7 +520,7 @@ StTooltip { .places-section { spacing-columns: 4px; - spacing-rows: 8px; + spacing-rows: 4px; } .places-item-box { @@ -537,14 +537,6 @@ StTooltip { border: 1px solid #666666; } -.places-actions { - spacing: 2px; -} - -#placesDevices { - padding-top: 4px; -} - /* Recent items */ .recent-docs-item-box { diff --git a/js/ui/placeDisplay.js b/js/ui/placeDisplay.js index 9361d67fa..d9cca2b27 100644 --- a/js/ui/placeDisplay.js +++ b/js/ui/placeDisplay.js @@ -479,22 +479,9 @@ DashPlaceDisplay.prototype = { this.actor = new St.Table({ style_class: 'places-section', homogeneous: true }); - this._actionsBox = new St.BoxLayout({ style_class: 'places-actions', - vertical: true }); - - this._devBox = new St.BoxLayout({ style_class: 'places-actions', - name: 'placesDevices', - vertical: true }); - - this._dirsBox = new St.BoxLayout({ style_class: 'places-actions', - vertical: true }); - - // Subdivide left into actions and devices - this.actor.add(this._actionsBox, { row: 0, col: 0 }); - this.actor.add(this._devBox, { row: 1, col: 0 }); - - // Bookmarks span the entire right - this.actor.add(this._dirsBox, { row: 0, col: 1, row_span: 2 }); + this._defaultsList = []; + this._bookmarksList = []; + this._mountsList = []; Main.placesManager.connect('defaults-updated', Lang.bind(this, this._updateDefaults)); Main.placesManager.connect('bookmarks-updated', Lang.bind(this, this._updateBookmarks)); @@ -506,27 +493,40 @@ DashPlaceDisplay.prototype = { }, _updateDefaults: function() { - this._actionsBox.destroy_children(); + for (let i = 0; i < this._defaultsList.length; i++) + this._defaultsList[i].destroy(); + this._defaultsList = []; let places = Main.placesManager.getDefaultPlaces(); - for (let i = 0; i < places.length; i++) - this._actionsBox.add(new DashPlaceDisplayItem(places[i]).actor); + for (let i = 0; i < places.length; i++) { + this._defaultsList[i] = new DashPlaceDisplayItem(places[i]).actor; + this.actor.add(this._defaultsList[i], {row: i, col: 0}); + } + this._updateMounts(); }, _updateMounts: function() { - this._devBox.destroy_children(); + for (let i = 0; i < this._mountsList.length; i++) + this._mountsList[i].destroy(); + this._mountsList = []; let places = Main.placesManager.getMounts(); - for (let i = 0; i < places.length; i++) - this._devBox.add(new DashPlaceDisplayItem(places[i]).actor); + for (let i = 0; i < places.length; i++) { + this._mountsList[i] = new DashPlaceDisplayItem(places[i]).actor; + this.actor.add(this._mountsList[i], {row: this._defaultsList.length + i, col: 0}); + } }, _updateBookmarks: function() { - this._dirsBox.destroy_children(); + for (let i = 0; i < this._bookmarksList.length; i++) + this._bookmarksList[i].destroy(); + this._bookmarksList = []; let places = Main.placesManager.getBookmarks(); - for (let i = 0; i < places.length; i ++) - this._dirsBox.add(new DashPlaceDisplayItem(places[i]).actor); + for (let i = 0; i < places.length; i ++) { + this._bookmarksList[i] = new DashPlaceDisplayItem(places[i]).actor; + this.actor.add(this._bookmarksList[i], {row: i, col: 1}); + } } };