animationUtils: Group together various animation helpers
The environment module is used to initialize the environment, yet it currently also defines the adjustAnimationTime() function. Ideally it should not export any utility functions, in particular once converted to ESM. The function cannot be moved to the existing Utils module, as that depends on an initialized environment, and can therefore not be imported from environment.js, so use that opportunity to group together several animation helpers in a new animationUtils module. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2822>
This commit is contained in:
@ -14,7 +14,7 @@ const IconGrid = imports.ui.iconGrid;
|
||||
const Main = imports.ui.main;
|
||||
const ParentalControlsManager = imports.misc.parentalControlsManager;
|
||||
const RemoteSearch = imports.ui.remoteSearch;
|
||||
const Util = imports.misc.util;
|
||||
const {ensureActorVisibleInScrollView} = imports.misc.animationUtils;
|
||||
|
||||
const { Highlighter } = imports.misc.util;
|
||||
|
||||
@ -746,7 +746,7 @@ var SearchResultsView = GObject.registerClass({
|
||||
}
|
||||
|
||||
_focusChildChanged(provider) {
|
||||
Util.ensureActorVisibleInScrollView(this._scrollView, provider.focusChild);
|
||||
ensureActorVisibleInScrollView(this._scrollView, provider.focusChild);
|
||||
}
|
||||
|
||||
_ensureProviderDisplay(provider) {
|
||||
@ -877,7 +877,7 @@ var SearchResultsView = GObject.registerClass({
|
||||
|
||||
if (selected) {
|
||||
result.add_style_pseudo_class('selected');
|
||||
Util.ensureActorVisibleInScrollView(this._scrollView, result);
|
||||
ensureActorVisibleInScrollView(this._scrollView, result);
|
||||
} else {
|
||||
result.remove_style_pseudo_class('selected');
|
||||
}
|
||||
|
Reference in New Issue
Block a user