From 47dc3043dfa7f62923cba5a8d0675715f463f5d4 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 13 Nov 2020 14:33:32 -0300 Subject: [PATCH 1/3] appDisplay: Adjust label collapse and expand times As per design feedback, these times are too slow. Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3333 https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1496 --- js/ui/appDisplay.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 6c7d1f4570..4bc662ea9a 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -32,8 +32,8 @@ var SCROLL_TIMEOUT_TIME = 150; var APP_ICON_SCALE_IN_TIME = 500; var APP_ICON_SCALE_IN_DELAY = 700; -var APP_ICON_TITLE_EXPAND_TIME = 250; -var APP_ICON_TITLE_COLLAPSE_TIME = 150; +var APP_ICON_TITLE_EXPAND_TIME = 200; +var APP_ICON_TITLE_COLLAPSE_TIME = 100; const FOLDER_DIALOG_ANIMATION_TIME = 200; -- GitLab From 5d27a5a42a7e3e36eb88c54b63a2b314480705d0 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 13 Nov 2020 14:34:22 -0300 Subject: [PATCH 2/3] appDisplay: Factor out function The function to update the multiline state of the title label will be reused by the next commit, so move it into a separate method. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1496 --- js/ui/appDisplay.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 4bc662ea9a..9c09a84c97 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1495,7 +1495,7 @@ class AppViewItem extends St.Button { } } - _onHover() { + _updateMultiline() { if (!this.icon.label) return; @@ -1524,6 +1524,10 @@ class AppViewItem extends St.Button { }); } + _onHover() { + this._updateMultiline(); + } + _onDragBegin() { this._dragging = true; this.scaleAndFade(); -- GitLab From 548d3b62d7bc08fe2423c7520ce8e2b6bdcfaff7 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 13 Nov 2020 14:35:29 -0300 Subject: [PATCH 3/3] appDisplay: Expand titles on keyboard focus as well In addition to hover, expand wrapped app titles when keyboard focus is in as well. This gives keyboard users a chance to read the app name. Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3333 https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1496 --- js/ui/appDisplay.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 9c09a84c97..ab4bb6c863 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1512,15 +1512,15 @@ class AppViewItem extends St.Button { label.disconnect(id); }); - const { hover } = this; + const expand = this.hover || this.has_key_focus(); label.save_easing_state(); - label.set_easing_duration(hover + label.set_easing_duration(expand ? APP_ICON_TITLE_EXPAND_TIME : APP_ICON_TITLE_COLLAPSE_TIME); clutterText.set({ - line_wrap: hover, - line_wrap_mode: hover ? Pango.WrapMode.WORD_CHAR : Pango.WrapMode.NONE, - ellipsize: hover ? Pango.EllipsizeMode.NONE : Pango.EllipsizeMode.END, + line_wrap: expand, + line_wrap_mode: expand ? Pango.WrapMode.WORD_CHAR : Pango.WrapMode.NONE, + ellipsize: expand ? Pango.EllipsizeMode.NONE : Pango.EllipsizeMode.END, }); } @@ -1608,6 +1608,16 @@ class AppViewItem extends St.Button { x > this.width - IconGrid.RIGHT_DIVIDER_LEEWAY; } + vfunc_key_focus_in() { + this._updateMultiline(); + super.vfunc_key_focus_in(); + } + + vfunc_key_focus_out() { + this._updateMultiline(); + super.vfunc_key_focus_out(); + } + handleDragOver(source, _actor, x) { if (source === this) return DND.DragMotionResult.NO_DROP; -- GitLab