diff --git a/data/theme/gnome-shell-sass/_drawing.scss b/data/theme/gnome-shell-sass/_drawing.scss index 217aac99264c964a34c275064dd291bca1c35ee5..fcf43b495658c4481414089536bde151a4923049 100644 --- a/data/theme/gnome-shell-sass/_drawing.scss +++ b/data/theme/gnome-shell-sass/_drawing.scss @@ -259,26 +259,23 @@ @mixin overview_icon($color, $flat: true) { transition-duration: 400ms; .overview-icon { @extend %tile; } + + border: none; + @if $flat { .overview-icon { background-color: transparent;} } @else { .overview-icon { background-color: transparentize($color, .81);} } - &:hover .overview-icon { background-color: transparentize($color, .9);} &:selected .overview-icon, - &:focus .overview-icon { - background-color: transparentize($color, .87); - &:hover .overview-icon { background-color: transparentize($color, .84);} - &:active .overview-icon { background-color: transparentize($color, .87);} - } + &:focus .overview-icon { background-color: transparentize($color, .87); } + &:active .overview-icon { background-color: transparentize($color, .84);} + &:outlined .overview-icon, - &:checked .overview-icon { - background-color: transparentize($color, .81); - &:active .overview-icon { background-color: transparentize($color, .78);} - &:hover .overview-icon { background-color: transparentize($color, .75);} - } + &:checked .overview-icon { background-color: transparentize($color, .81); } + &:drop .overview-icon { border: 2px solid transparentize($selected_bg_color, .2); //already 2px transparent so no jumping background-color: transparentize($selected_bg_color, .8); diff --git a/data/theme/gnome-shell-sass/widgets/_dash.scss b/data/theme/gnome-shell-sass/widgets/_dash.scss index 8f5d5f939b887a4a2f5ea9b4f1c02591e68fd9b2..604fccb434b06c031ee2bcd092c57f6fd7ec70b5 100644 --- a/data/theme/gnome-shell-sass/widgets/_dash.scss +++ b/data/theme/gnome-shell-sass/widgets/_dash.scss @@ -50,6 +50,9 @@ $dash_border_radius: $modal_radius + $dash_padding; // show apps button .show-apps { @include overview_icon($osd_fg_color);} + .show-apps.app-unpin-hovering .overview-icon { + background-color: transparentize($osd_fg_color, .87); + } .show-apps, .app-well-app { padding-bottom: $dash_padding; diff --git a/data/theme/gnome-shell-sass/widgets/_search-results.scss b/data/theme/gnome-shell-sass/widgets/_search-results.scss index 644c53db58d3634879e8611a0deac0fa9c61fe45..32d1b0542de6b760283a58ac3be99ac36436904f 100644 --- a/data/theme/gnome-shell-sass/widgets/_search-results.scss +++ b/data/theme/gnome-shell-sass/widgets/_search-results.scss @@ -44,6 +44,8 @@ .grid-search-results { spacing: $base_padding*5; margin:0 $base_margin*3; + + margin-top: 5px; // items scale up 5px in each direction on hover } // Search results with icons diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index cf76732e96b425601e4d203000afaf9b429e54bc..1525a1bb3b902e6ea05388f827a571f4f187a66b 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1930,8 +1930,7 @@ class AppViewItem extends St.Button { this._otherIconIsHovering = false; this._expandTitleOnHover = expandTitleOnHover; - if (expandTitleOnHover) - this.connect('notify::hover', this._onHover.bind(this)); + this.connect('notify::hover', this._onHover.bind(this)); this.connect('destroy', this._onDestroy.bind(this)); } @@ -1977,8 +1976,27 @@ class AppViewItem extends St.Button { }); } + _updateHoverScale() { + const allocationHeight = this.allocation.get_height(); + const scaleUpFactor = (allocationHeight + 10) / allocationHeight; + + this.icon.icon.ease({ + duration: 150, + scale_x: this.hover ? scaleUpFactor : 1, + scale_y: this.hover ? scaleUpFactor : 1, + }); + + this.icon.label?.ease({ + duration: 150, + translation_y: this.hover ? 2 : 0, + }); + } + _onHover() { - this._updateMultiline(); + if (this._expandTitleOnHover) + this._updateMultiline(); + + this._updateHoverScale(); } _onDragBegin() { diff --git a/js/ui/dash.js b/js/ui/dash.js index a40377cf7b05b5e7c5d10cc332ed98382b8740bb..d3a3e79ebac87c4b290f7db13f3b09eb0da6a1f7 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -191,29 +191,26 @@ class DashItemContainer extends St.Widget { }); var ShowAppsIcon = GObject.registerClass( -class ShowAppsIcon extends DashItemContainer { - _init() { - super._init(); - - this.toggleButton = new St.Button({ +class ShowAppsIcon extends AppDisplay.AppViewItem { + _init(container) { + super._init({ style_class: 'show-apps', track_hover: true, can_focus: true, toggle_mode: true, - }); + }, false); this._iconActor = null; + + this._delegate = this; + this._container = container; + this.icon = new IconGrid.BaseIcon(_('Show Applications'), { setSizeManually: true, showLabel: false, createIcon: this._createIcon.bind(this), }); this.icon.y_align = Clutter.ActorAlign.CENTER; - - this.toggleButton.add_actor(this.icon); - this.toggleButton._delegate = this; - - this.setChild(this.toggleButton); - this.setDragApp(null); + this.set_child(this.icon); } _createIcon(size) { @@ -241,14 +238,17 @@ class ShowAppsIcon extends DashItemContainer { setDragApp(app) { let canRemove = this._canRemoveApp(app); - this.toggleButton.set_hover(canRemove); + this.set_hover(canRemove); if (this._iconActor) this._iconActor.set_hover(canRemove); - if (canRemove) - this.setLabelText(_('Unpin')); - else - this.setLabelText(_("Show Applications")); + if (canRemove) { + this._container.setLabelText(_('Unpin')); + this.add_style_class_name('app-unpin-hovering'); + } else { + this._container.setLabelText(_('Show Applications')); + this.remove_style_class_name('app-unpin-hovering'); + } } handleDragOver(source, _actor, _x, _y, _time) { @@ -343,13 +343,19 @@ var Dash = GObject.registerClass({ this._dashContainer.add_child(this._box); - this._showAppsIcon = new ShowAppsIcon(); - this._showAppsIcon.show(false); + this._showAppsIconContainer = new DashItemContainer(); + + this._showAppsIcon = new ShowAppsIcon(this._showAppsIconContainer); this._showAppsIcon.icon.setIconSize(this.iconSize); - this._hookUpLabel(this._showAppsIcon); - this._dashContainer.add_child(this._showAppsIcon); + this._showAppsIconContainer.setChild(this._showAppsIcon); + this._showAppsIconContainer.show(false); + this._hookUpLabel(this._showAppsIconContainer); + + this._showAppsIcon.setDragApp(null); + + this._dashContainer.add_child(this._showAppsIconContainer); - this.showAppsButton = this._showAppsIcon.toggleButton; + this.showAppsButton = this._showAppsIcon; this._background = new St.Widget({ style_class: 'dash-background', @@ -582,7 +588,7 @@ var Dash = GObject.registerClass({ !actor.animatingOut; }); - iconChildren.push(this._showAppsIcon); + iconChildren.push(this._showAppsIconContainer); if (this._maxWidth === -1 || this._maxHeight === -1) return; diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index 599374fa35922daa040f33818630c97bc6575491..ca0447c24c88d2a04995410da4364ab8ca6ff21b 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -124,6 +124,7 @@ class BaseIcon extends Shell.SquareBin { this.icon.destroy(); this.iconSize = size; this.icon = this.createIcon(this.iconSize); + this.icon.set_pivot_point(0.5, 0.5); this._iconBin.child = this.icon; }