st: Add StDirectionType enum

In order to replace GTK+'s GtkDirectionType. It's bit-compatible with it,
too. All callers have been updated to use it.

This is a purely accessory change in terms of X11 Display usage cleanup,
but helps see better what is left.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
This commit is contained in:
Carlos Garnacho
2018-11-27 13:58:25 +01:00
parent a977c1388a
commit c59c5eb893
21 changed files with 80 additions and 84 deletions

View File

@ -2,7 +2,6 @@
const Clutter = imports.gi.Clutter;
const GObject = imports.gi.GObject;
const Gtk = imports.gi.Gtk;
const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell;
const Signals = imports.signals;
@ -956,8 +955,8 @@ var PaginatedIconGrid = GObject.registerClass({
this._translatedChildren = [];
this.emit('space-opened');
} else {
this._translateChildren(childrenUp, Gtk.DirectionType.UP, nRowsUp);
this._translateChildren(childrenDown, Gtk.DirectionType.DOWN, nRowsDown);
this._translateChildren(childrenUp, St.DirectionType.UP, nRowsUp);
this._translateChildren(childrenDown, St.DirectionType.DOWN, nRowsDown);
this._translatedChildren = childrenUp.concat(childrenDown);
}
}
@ -967,7 +966,7 @@ var PaginatedIconGrid = GObject.registerClass({
if (translationY == 0)
return;
if (direction == Gtk.DirectionType.UP)
if (direction == St.DirectionType.UP)
translationY *= -1;
for (let i = 0; i < children.length; i++) {