workspaceThumnails: Add :should-show property
We currently have two components that show or hide the minimap: - the thumbnails hide themselves in case of a single static workspace - overview controls show the minimap when no search is active That obviously doesn't work correctly. To fix this, change thumbnails to set a new :should-show property instead of the visibility, and let the overview controls take it into account when changing the visibility. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3739 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1696>
This commit is contained in:
@ -303,6 +303,9 @@ class ControlsManager extends St.Widget {
|
||||
|
||||
this._thumbnailsBox =
|
||||
new WorkspaceThumbnail.ThumbnailsBox(this._workspaceAdjustment);
|
||||
this._thumbnailsBox.connect('notify::should-show',
|
||||
() => this._updateThumbnailsBox());
|
||||
|
||||
this._workspacesDisplay = new WorkspacesView.WorkspacesDisplay(
|
||||
this,
|
||||
this._workspaceAdjustment,
|
||||
@ -426,10 +429,11 @@ class ControlsManager extends St.Widget {
|
||||
}
|
||||
|
||||
_updateThumbnailsBox(animate = false) {
|
||||
const { shouldShow } = this._thumbnailsBox;
|
||||
const { searchActive } = this._searchController;
|
||||
const [opacity, scale, translationY] = this._getThumbnailsBoxParams();
|
||||
|
||||
const thumbnailsBoxVisible = !searchActive && opacity !== 0;
|
||||
const thumbnailsBoxVisible = shouldShow && !searchActive && opacity !== 0;
|
||||
if (thumbnailsBoxVisible) {
|
||||
this._thumbnailsBox.opacity = 0;
|
||||
this._thumbnailsBox.visible = thumbnailsBoxVisible;
|
||||
|
Reference in New Issue
Block a user