[gnome-shell/T27795: 75/138] Remove the dash, we are no longer using it on EOS



commit eadf4b749fa2d6041bf93c947fb51110b162e0f2
Author: Mario Sanchez Prada <mario endlessm com>
Date:   Thu Feb 15 15:32:59 2018 +0000

    Remove the dash, we are no longer using it on EOS
    
    Do not ever instance the dash or any of its related classes, and
    adapt code and callers accordingly where needed. Specifically, this
    required to remove any occurrendce of 'showAppsButton', which was used
    from many different places, and won't longer be available now that we
    are not using the dash, where it used to live.
    
    Also, note that I actually removed some code to prevent _redisplay()
    from being executed, since otherwise we could hit an error when trying
    to process the icons, that won't necessarily exist.
    
    https://phabricator.endlessm.com/T18032

 js/perf/core.js           |  4 ----
 js/perf/hwtest.js         |  2 --
 js/ui/appDisplay.js       |  4 +++-
 js/ui/overview.js         | 11 -----------
 js/ui/overviewControls.js | 38 ++------------------------------------
 js/ui/viewSelector.js     | 22 +++-------------------
 6 files changed, 8 insertions(+), 73 deletions(-)
---
diff --git a/js/perf/core.js b/js/perf/core.js
index a2af0f9be9..67f88f043b 100644
--- a/js/perf/core.js
+++ b/js/perf/core.js
@@ -126,12 +126,8 @@ function *run() {
 
     for (let i = 0; i < 2; i++) {
         Scripting.scriptEvent('applicationsShowStart');
-        // eslint-disable-next-line require-atomic-updates
-        Main.overview._dash.showAppsButton.checked = true;
         yield Scripting.waitLeisure();
         Scripting.scriptEvent('applicationsShowDone');
-        // eslint-disable-next-line require-atomic-updates
-        Main.overview._dash.showAppsButton.checked = false;
         yield Scripting.waitLeisure();
     }
 }
diff --git a/js/perf/hwtest.js b/js/perf/hwtest.js
index 5b8934332d..4000f751f7 100644
--- a/js/perf/hwtest.js
+++ b/js/perf/hwtest.js
@@ -126,8 +126,6 @@ function *run() {
     yield Scripting.sleep(1000);
 
     Scripting.scriptEvent('applicationsShowStart');
-    // eslint-disable-next-line require-atomic-updates
-    Main.overview._dash.showAppsButton.checked = true;
 
     yield Scripting.waitLeisure();
     Scripting.scriptEvent('applicationsShowDone');
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 13398236c5..0e0bf2f3e7 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1991,7 +1991,9 @@ var AppIcon = class AppIcon {
     }
 
     getDragActor() {
-        return this.app.create_icon_texture(Main.overview.dashIconSize);
+        // This is a temporary change not to depend on the dash while
+        // we don't implement our own Drag'n'Drop mechanism in EOS.
+        return this.app.create_icon_texture(IconGrid.ICON_SIZE);
     }
 
     // Returns the original actor that should align with the actor
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 559aa8ee79..212e30bdbe 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -221,7 +221,6 @@ var Overview = class {
 
         // Create controls
         this._controls = new OverviewControls.ControlsManager(this._searchEntry);
-        this._dash = this._controls.dash;
         this.viewSelector = this._controls.viewSelector;
 
         // Add our same-line elements after the search entry
@@ -235,12 +234,6 @@ var Overview = class {
 
         this._overview.add_actor(this._panelGhost);
 
-        // TODO - recalculate everything when desktop size changes
-        this.dashIconSize = this._dash.iconSize;
-        this._dash.connect('icon-size-changed', () => {
-            this.dashIconSize = this._dash.iconSize;
-        });
-
         this.viewSelector.connect('page-changed', this._onPageChanged.bind(this));
         Main.layoutManager.connect('startup-prepared', this._onStartupPrepared.bind(this));
         Main.layoutManager.connect('monitors-changed', this._relayout.bind(this));
@@ -733,9 +726,5 @@ var Overview = class {
     getActivePage() {
         return this.viewSelector.getActivePage();
     }
-
-    getShowAppsButton() {
-        return this._dash.showAppsButton;
-    }
 };
 Signals.addSignalMethods(Overview.prototype);
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index 0edf8cd5d1..c168c8cf58 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -3,7 +3,6 @@
 
 const { Clutter, GObject, Meta, St } = imports.gi;
 
-const Dash = imports.ui.dash;
 const Main = imports.ui.main;
 const Params = imports.misc.params;
 const ViewSelector = imports.ui.viewSelector;
@@ -418,16 +417,10 @@ var ControlsLayout = GObject.registerClass({
 
 var ControlsManager = class {
     constructor(searchEntry) {
-        this.dash = new Dash.Dash();
-        this._dashSlider = new DashSlider(this.dash);
-        this._dashSpacer = new DashSpacer();
-        this._dashSpacer.setDashActor(this._dashSlider.actor);
-
         this._thumbnailsBox = new WorkspaceThumbnail.ThumbnailsBox();
         this._thumbnailsSlider = new ThumbnailsSlider(this._thumbnailsBox);
 
-        this.viewSelector = new ViewSelector.ViewSelector(searchEntry,
-                                                          this.dash.showAppsButton);
+        this.viewSelector = new ViewSelector.ViewSelector(searchEntry);
         this.viewSelector.connect('page-changed', this._setVisibility.bind(this));
         this.viewSelector.connect('page-empty', this._onPageEmpty.bind(this));
 
@@ -439,16 +432,11 @@ var ControlsManager = class {
                                          x_expand: true, y_expand: true });
         this.actor.add_actor(this._group);
 
-        this.actor.add_actor(this._dashSlider.actor);
-
-        this._group.add_actor(this._dashSpacer);
         this._group.add(this.viewSelector.actor, { x_fill: true,
                                                    expand: true });
         this._group.add_actor(this._thumbnailsSlider.actor);
 
         layout.connect('allocation-changed', this._updateWorkspacesGeometry.bind(this));
-
-        Main.overview.connect('showing', this._updateSpacerVisibility.bind(this));
     }
 
     _updateWorkspacesGeometry() {
@@ -457,15 +445,11 @@ var ControlsManager = class {
         let geometry = { x: x, y: y, width: width, height: height };
 
         let spacing = this.actor.get_theme_node().get_length('spacing');
-        let dashWidth = this._dashSlider.getVisibleWidth() + spacing;
         let thumbnailsWidth = this._thumbnailsSlider.getNonExpandedWidth() + spacing;
 
-        geometry.width -= dashWidth;
         geometry.width -= thumbnailsWidth;
 
-        if (this.actor.get_text_direction() == Clutter.TextDirection.LTR)
-            geometry.x += dashWidth;
-        else
+        if (this.actor.get_text_direction() == Clutter.TextDirection.RTL)
             geometry.x += thumbnailsWidth;
 
         this.viewSelector.setWorkspacesFullGeometry(geometry);
@@ -481,33 +465,15 @@ var ControlsManager = class {
             return;
 
         let activePage = this.viewSelector.getActivePage();
-        let dashVisible = (activePage == ViewSelector.ViewPage.WINDOWS ||
-                           activePage == ViewSelector.ViewPage.APPS);
         let thumbnailsVisible = (activePage == ViewSelector.ViewPage.WINDOWS);
 
-        if (dashVisible)
-            this._dashSlider.slideIn();
-        else
-            this._dashSlider.slideOut();
-
         if (thumbnailsVisible)
             this._thumbnailsSlider.slideIn();
         else
             this._thumbnailsSlider.slideOut();
     }
 
-    _updateSpacerVisibility() {
-        if (Main.overview.animationInProgress && !Main.overview.visibleTarget)
-            return;
-
-        let activePage = this.viewSelector.getActivePage();
-        this._dashSpacer.visible = (activePage == ViewSelector.ViewPage.WINDOWS);
-    }
-
     _onPageEmpty() {
-        this._dashSlider.pageEmpty();
         this._thumbnailsSlider.pageEmpty();
-
-        this._updateSpacerVisibility();
     }
 };
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index a91dfca28d..58eab12e39 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -124,12 +124,9 @@ var ShowOverviewAction = GObject.registerClass({
 });
 
 var ViewSelector = class {
-    constructor(searchEntry, showAppsButton) {
+    constructor(searchEntry) {
         this.actor = new Shell.Stack({ name: 'viewSelector' });
 
-        this._showAppsButton = showAppsButton;
-        this._showAppsButton.connect('notify::checked', this._onShowAppsButtonToggled.bind(this));
-
         this._activePage = null;
 
         this._searchActive = false;
@@ -259,7 +256,6 @@ var ViewSelector = class {
     }
 
     showApps() {
-        this._showAppsButton.checked = true;
         Main.overview.show();
     }
 
@@ -270,7 +266,7 @@ var ViewSelector = class {
         // (used for the Windows picker) visible to prevent situations where that actor
         // would intercept clicks meant for the desktop's icons grid.
         if (!Main.layoutManager.startingUp)
-            this._workspacesDisplay.show(true);
+            this._workspacesDisplay.show(viewPage == ViewPage.APPS);
 
         this._showPage(this._pageFromViewPage(viewPage));
     }
@@ -281,8 +277,6 @@ var ViewSelector = class {
         this._workspacesPage.opacity = 255;
 
         this._workspacesDisplay.animateFromOverview(this._activePage != this._workspacesPage);
-
-        this._showAppsButton.checked = false;
     }
 
     setWorkspacesFullGeometry(geom) {
@@ -380,15 +374,9 @@ var ViewSelector = class {
     }
 
     _a11yFocusPage(page) {
-        this._showAppsButton.checked = page == this._appsPage;
         page.navigate_focus(null, St.DirectionType.TAB_FORWARD, false);
     }
 
-    _onShowAppsButtonToggled() {
-        this._showPage(this._showAppsButton.checked
-            ? this._appsPage : this._workspacesPage);
-    }
-
     _onStageKeyPress(actor, event) {
         // Ignore events while anything but the overview has
         // pushed a modal (system modals, looking glass, ...)
@@ -400,8 +388,6 @@ var ViewSelector = class {
         if (symbol == Clutter.Escape) {
             if (this._searchActive)
                 this.reset();
-            else if (this._showAppsButton.checked)
-                this._showAppsButton.checked = false;
             else
                 Main.overview.hide();
             return Clutter.EVENT_STOP;
@@ -420,9 +406,7 @@ var ViewSelector = class {
     }
 
     _searchCancelled() {
-        this._showPage(this._showAppsButton.checked
-            ? this._appsPage
-            : this._workspacesPage);
+        this._showPage(this._appsPage);
 
         // Leave the entry focused when it doesn't have any text;
         // when replacing a selected search term, Clutter emits


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