[gnome-shell/T29763: 55/249] Remove the dash, we are no longer using it on EOS



commit 2fd013df7ee327cba69f38a27ef47737aa1b9356
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.
    
     * 2020-03-16: Rebase conflicts
    
    https://phabricator.endlessm.com/T18032

 js/perf/core.js           |   4 --
 js/perf/hwtest.js         |   2 -
 js/ui/appDisplay.js       |   4 +-
 js/ui/overview.js         |  21 ---------
 js/ui/overviewControls.js | 108 +---------------------------------------------
 js/ui/viewSelector.js     |  27 ++----------
 6 files changed, 8 insertions(+), 158 deletions(-)
---
diff --git a/js/perf/core.js b/js/perf/core.js
index deebe19398..90ea5da7e0 100644
--- a/js/perf/core.js
+++ b/js/perf/core.js
@@ -127,12 +127,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 17b7cdb71c..75ae1460ad 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 9d65b99832..e3d71ebe05 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1925,7 +1925,9 @@ var AppIcon = GObject.registerClass({
     }
 
     getDragActor() {
-        return this.app.create_icon_texture(Main.overview.dash.iconSize);
+        // 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 f916ca2317..60daca7f6e 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -138,10 +138,6 @@ class OverviewActor extends St.BoxLayout {
         this.add_actor(panelGhost);
     }
 
-    get dash() {
-        return this._controls.dash;
-    }
-
     get searchEntry() {
         return this._searchEntry;
     }
@@ -160,16 +156,6 @@ var Overview = class {
         this._sessionUpdated();
     }
 
-    get dash() {
-        return this._overview.dash;
-    }
-
-    get dashIconSize() {
-        logError(new Error('Usage of Overview.\'dashIconSize\' is deprecated, ' +
-            'use \'dash.iconSize\' property instead'));
-        return this.dash.iconSize;
-    }
-
     get viewSelector() {
         return this._overview.viewSelector;
     }
@@ -686,13 +672,6 @@ var Overview = class {
         return this.viewSelector.getActivePage();
     }
 
-    getShowAppsButton() {
-        logError(new Error('Usage of Overview.\'getShowAppsButton\' is deprecated, ' +
-            'use \'dash.showAppsButton\' property instead'));
-
-        return this.dash.showAppsButton;
-    }
-
     get searchEntry() {
         return this._overview.searchEntry;
     }
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index cc430f918d..fe1d3db4d6 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;
@@ -322,77 +321,6 @@ class ThumbnailsSlider extends SlidingControl {
     }
 });
 
-var DashSlider = GObject.registerClass(
-class DashSlider extends SlidingControl {
-    _init(dash) {
-        super._init({ slideDirection: SlideDirection.LEFT });
-
-        this._dash = dash;
-
-        // SlideLayout reads the actor's expand flags to decide
-        // whether to allocate the natural size to its child, or the whole
-        // available allocation
-        this._dash.x_expand = true;
-
-        this.x_expand = true;
-        this.x_align = Clutter.ActorAlign.START;
-        this.y_expand = true;
-
-        this.add_actor(this._dash);
-
-        this._dash.connect('icon-size-changed', this._updateSlide.bind(this));
-    }
-
-    _getSlide() {
-        if (this._visible || this._inDrag)
-            return 1;
-        else
-            return 0;
-    }
-
-    _onWindowDragBegin() {
-        this.fadeHalf();
-    }
-
-    _onWindowDragEnd() {
-        this.fadeIn();
-    }
-});
-
-var DashSpacer = GObject.registerClass(
-class DashSpacer extends St.Widget {
-    _init(params) {
-        super._init(params);
-
-        this._bindConstraint = null;
-    }
-
-    setDashActor(dashActor) {
-        if (this._bindConstraint) {
-            this.remove_constraint(this._bindConstraint);
-            this._bindConstraint = null;
-        }
-
-        if (dashActor) {
-            this._bindConstraint = new Clutter.BindConstraint({ source: dashActor,
-                                                                coordinate: Clutter.BindCoordinate.SIZE });
-            this.add_constraint(this._bindConstraint);
-        }
-    }
-
-    vfunc_get_preferred_width(forHeight) {
-        if (this._bindConstraint)
-            return this._bindConstraint.source.get_preferred_width(forHeight);
-        return super.vfunc_get_preferred_width(forHeight);
-    }
-
-    vfunc_get_preferred_height(forWidth) {
-        if (this._bindConstraint)
-            return this._bindConstraint.source.get_preferred_height(forWidth);
-        return super.vfunc_get_preferred_height(forWidth);
-    }
-});
-
 var ControlsLayout = GObject.registerClass({
     Signals: { 'allocation-changed': { flags: GObject.SignalFlags.RUN_LAST } },
 }, class ControlsLayout extends Clutter.BinLayout {
@@ -413,11 +341,6 @@ class ControlsManager extends St.Widget {
             clip_to_allocation: true,
         });
 
-        this.dash = new Dash.Dash();
-        this._dashSlider = new DashSlider(this.dash);
-        this._dashSpacer = new DashSpacer();
-        this._dashSpacer.setDashActor(this._dashSlider);
-
         let workspaceManager = global.workspace_manager;
         let activeWorkspaceIndex = workspaceManager.get_active_workspace_index();
 
@@ -439,7 +362,7 @@ class ControlsManager extends St.Widget {
         this._thumbnailsSlider = new ThumbnailsSlider(this._thumbnailsBox);
 
         this.viewSelector = new ViewSelector.ViewSelector(searchEntry,
-            this._workspaceAdjustment, this.dash.showAppsButton);
+            this._workspaceAdjustment);
         this.viewSelector.connect('page-changed', this._setVisibility.bind(this));
         this.viewSelector.connect('page-empty', this._onPageEmpty.bind(this));
 
@@ -447,16 +370,11 @@ class ControlsManager extends St.Widget {
                                          x_expand: true, y_expand: true });
         this.add_actor(this._group);
 
-        this.add_actor(this._dashSlider);
-
-        this._group.add_actor(this._dashSpacer);
         this._group.add_child(this.viewSelector);
         this._group.add_actor(this._thumbnailsSlider);
 
         layout.connect('allocation-changed', this._updateWorkspacesGeometry.bind(this));
 
-        Main.overview.connect('showing', this._updateSpacerVisibility.bind(this));
-
         this.connect('destroy', this._onDestroy.bind(this));
     }
 
@@ -482,15 +400,11 @@ class ControlsManager extends St.Widget {
         let geometry = { x, y, width, height };
 
         let spacing = this.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.get_text_direction() == Clutter.TextDirection.LTR)
-            geometry.x += dashWidth;
-        else
+        if (this.get_text_direction() == Clutter.TextDirection.RTL)
             geometry.x += thumbnailsWidth;
 
         this.viewSelector.setWorkspacesFullGeometry(geometry);
@@ -506,33 +420,15 @@ class ControlsManager extends St.Widget {
             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 5c0dd9bb75..f51f1a8f83 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -128,15 +128,12 @@ var ViewSelector = GObject.registerClass({
         'page-empty': {},
     },
 }, class ViewSelector extends Shell.Stack {
-    _init(searchEntry, workspaceAdjustment, showAppsButton) {
+    _init(searchEntry, workspaceAdjustment) {
         super._init({
             name: 'viewSelector',
             x_expand: true,
         });
 
-        this._showAppsButton = showAppsButton;
-        this._showAppsButton.connect('notify::checked', this._onShowAppsButtonToggled.bind(this));
-
         this._activePage = null;
 
         this._searchActive = false;
@@ -262,23 +259,17 @@ var ViewSelector = GObject.registerClass({
     }
 
     _toggleAppsPage() {
-        this._showAppsButton.checked = !this._showAppsButton.checked;
         Main.overview.show();
     }
 
     showApps() {
-        this._showAppsButton.checked = true;
         Main.overview.show();
     }
 
     show() {
         this.reset();
-        this._workspacesDisplay.show(this._showAppsButton.checked);
+        this._workspacesDisplay.show(true);
         this._activePage = null;
-        if (this._showAppsButton.checked)
-            this._showPage(this._appsPage);
-        else
-            this._showPage(this._workspacesPage);
 
         if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
             Main.overview.fadeOutDesktop();
@@ -291,8 +282,6 @@ var ViewSelector = GObject.registerClass({
 
         this._workspacesDisplay.animateFromOverview(this._activePage != this._workspacesPage);
 
-        this._showAppsButton.checked = false;
-
         if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
             Main.overview.fadeInDesktop();
     }
@@ -390,15 +379,9 @@ var ViewSelector = GObject.registerClass({
     }
 
     _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, ...)
@@ -410,8 +393,6 @@ var ViewSelector = GObject.registerClass({
         if (symbol === Clutter.KEY_Escape) {
             if (this._searchActive)
                 this.reset();
-            else if (this._showAppsButton.checked)
-                this._showAppsButton.checked = false;
             else
                 Main.overview.hide();
             return Clutter.EVENT_STOP;
@@ -430,9 +411,7 @@ var ViewSelector = GObject.registerClass({
     }
 
     _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]