diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 6c7d1f4570390a37a034b91e69435844b24930b8..ab4bb6c863df02943c298f9a2c9983613c426ed1 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; @@ -1495,7 +1495,7 @@ class AppViewItem extends St.Button { } } - _onHover() { + _updateMultiline() { if (!this.icon.label) return; @@ -1512,18 +1512,22 @@ 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, }); } + _onHover() { + this._updateMultiline(); + } + _onDragBegin() { this._dragging = true; this.scaleAndFade(); @@ -1604,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;