[gnome-shell] overviewControls: Remove DashFader
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] overviewControls: Remove DashFader
- Date: Wed, 10 Feb 2021 15:49:14 +0000 (UTC)
commit 73b94c390147e710948c370b4bd40fe5eaaa0fff
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Feb 9 17:50:29 2021 +0100
overviewControls: Remove DashFader
By now there is so little left of the old sliding controls that the
split from the actual dash makes little sense.
https://gitlab.gnome.org/Teams/Design/os-mockups/-/issues/89
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1660>
js/ui/dash.js | 45 ++++++++++++++++++++++++++++++++++-----------
js/ui/overviewControls.js | 41 +----------------------------------------
2 files changed, 35 insertions(+), 51 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 6b4c114e79..52b07a51c1 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -9,6 +9,7 @@ const AppFavorites = imports.ui.appFavorites;
const DND = imports.ui.dnd;
const IconGrid = imports.ui.iconGrid;
const Main = imports.ui.main;
+const Overview = imports.ui.overview;
var DASH_ANIMATION_TIME = 200;
var DASH_ITEM_LABEL_SHOW_TIME = 150;
@@ -352,21 +353,27 @@ var Dash = GObject.registerClass({
this._appSystem.connect('app-state-changed', this._queueRedisplay.bind(this));
Main.overview.connect('item-drag-begin',
- this._onDragBegin.bind(this));
+ this._onItemDragBegin.bind(this));
Main.overview.connect('item-drag-end',
- this._onDragEnd.bind(this));
+ this._onItemDragEnd.bind(this));
Main.overview.connect('item-drag-cancelled',
- this._onDragCancelled.bind(this));
+ this._onItemDragCancelled.bind(this));
+ Main.overview.connect('window-drag-begin',
+ this._onWindowDragBegin.bind(this));
+ Main.overview.connect('window-drag-cancelled',
+ this._onWindowDragEnd.bind(this));
+ Main.overview.connect('window-drag-end',
+ this._onWindowDragEnd.bind(this));
// Translators: this is the name of the dock/favorites area on
// the left of the overview
Main.ctrlAltTabManager.addGroup(this, _("Dash"), 'user-bookmarks-symbolic');
}
- _onDragBegin() {
+ _onItemDragBegin() {
this._dragCancelled = false;
this._dragMonitor = {
- dragMotion: this._onDragMotion.bind(this),
+ dragMotion: this._onItemDragMotion.bind(this),
};
DND.addDragMonitor(this._dragMonitor);
@@ -377,26 +384,26 @@ var Dash = GObject.registerClass({
}
}
- _onDragCancelled() {
+ _onItemDragCancelled() {
this._dragCancelled = true;
- this._endDrag();
+ this._endItemDrag();
}
- _onDragEnd() {
+ _onItemDragEnd() {
if (this._dragCancelled)
return;
- this._endDrag();
+ this._endItemDrag();
}
- _endDrag() {
+ _endItemDrag() {
this._clearDragPlaceholder();
this._clearEmptyDropTarget();
this._showAppsIcon.setDragApp(null);
DND.removeDragMonitor(this._dragMonitor);
}
- _onDragMotion(dragEvent) {
+ _onItemDragMotion(dragEvent) {
let app = getAppFromSource(dragEvent.source);
if (app == null)
return DND.DragMotionResult.CONTINUE;
@@ -415,6 +422,22 @@ var Dash = GObject.registerClass({
return DND.DragMotionResult.CONTINUE;
}
+ _onWindowDragBegin() {
+ this.ease({
+ opacity: 128,
+ duration: Overview.ANIMATION_TIME / 2,
+ mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+ });
+ }
+
+ _onWindowDragEnd() {
+ this.ease({
+ opacity: 255,
+ duration: Overview.ANIMATION_TIME / 2,
+ mode: Clutter.AnimationMode.EASE_IN_QUAD,
+ });
+ }
+
_appIdListToHash(apps) {
let ids = {};
for (let i = 0; i < apps.length; i++)
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index e87c5042a8..b27a1d9f65 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -4,45 +4,7 @@
const { Clutter, GObject, St } = imports.gi;
const Dash = imports.ui.dash;
-const Main = imports.ui.main;
const ViewSelector = imports.ui.viewSelector;
-const Overview = imports.ui.overview;
-
-var SIDE_CONTROLS_ANIMATION_TIME = Overview.ANIMATION_TIME;
-
-var DashFader = GObject.registerClass(
-class DashFader extends St.Widget {
- _init(dash) {
- super._init({
- x_expand: true,
- x_align: Clutter.ActorAlign.CENTER,
- y_align: Clutter.ActorAlign.END,
- });
-
- this._dash = dash;
- this.add_child(this._dash);
-
- Main.overview.connect('window-drag-begin', this._onWindowDragBegin.bind(this));
- Main.overview.connect('window-drag-cancelled', this._onWindowDragEnd.bind(this));
- Main.overview.connect('window-drag-end', this._onWindowDragEnd.bind(this));
- }
-
- _onWindowDragBegin() {
- this.ease({
- opacity: 128,
- duration: SIDE_CONTROLS_ANIMATION_TIME / 2,
- mode: Clutter.AnimationMode.EASE_OUT_QUAD,
- });
- }
-
- _onWindowDragEnd() {
- this.ease({
- opacity: 255,
- duration: SIDE_CONTROLS_ANIMATION_TIME / 2,
- mode: Clutter.AnimationMode.EASE_IN_QUAD,
- });
- }
-});
var ControlsManager = GObject.registerClass(
class ControlsManager extends St.Widget {
@@ -55,7 +17,6 @@ class ControlsManager extends St.Widget {
});
this.dash = new Dash.Dash();
- this._dashFader = new DashFader(this.dash);
let workspaceManager = global.workspace_manager;
let activeWorkspaceIndex = workspaceManager.get_active_workspace_index();
@@ -86,7 +47,7 @@ class ControlsManager extends St.Widget {
this.add_actor(this._group);
this._group.add_child(this.viewSelector);
- this._group.add_actor(this._dashFader);
+ this._group.add_actor(this.dash);
this.connect('destroy', this._onDestroy.bind(this));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]