util: Remove unused class CloseButton
This looks like it was used to create the close buttons in the overview at some point, we're no longer using it nowadays though, so remove it. https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1298
This commit is contained in:
parent
a3257e8df5
commit
f0ee9cdcf8
@ -1,9 +1,9 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
/* exported findUrls, spawn, spawnCommandLine, spawnApp, trySpawnCommandLine,
|
/* exported findUrls, spawn, spawnCommandLine, spawnApp, trySpawnCommandLine,
|
||||||
formatTime, formatTimeSpan, createTimeLabel, insertSorted,
|
formatTime, formatTimeSpan, createTimeLabel, insertSorted,
|
||||||
makeCloseButton, ensureActorVisibleInScrollView, wiggle */
|
ensureActorVisibleInScrollView, wiggle */
|
||||||
|
|
||||||
const { Clutter, Gio, GLib, GObject, Shell, St, GnomeDesktop } = imports.gi;
|
const { Clutter, Gio, GLib, Shell, St, GnomeDesktop } = imports.gi;
|
||||||
const Gettext = imports.gettext;
|
const Gettext = imports.gettext;
|
||||||
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
@ -363,51 +363,6 @@ function insertSorted(array, val, cmp) {
|
|||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
var CloseButton = GObject.registerClass(
|
|
||||||
class CloseButton extends St.Button {
|
|
||||||
_init(boxpointer) {
|
|
||||||
super._init({
|
|
||||||
style_class: 'notification-close',
|
|
||||||
x_expand: true,
|
|
||||||
y_expand: true,
|
|
||||||
x_align: Clutter.ActorAlign.END,
|
|
||||||
y_align: Clutter.ActorAlign.START,
|
|
||||||
});
|
|
||||||
|
|
||||||
this._boxPointer = boxpointer;
|
|
||||||
if (boxpointer)
|
|
||||||
this._boxPointer.connect('arrow-side-changed', this._sync.bind(this));
|
|
||||||
}
|
|
||||||
|
|
||||||
_computeBoxPointerOffset() {
|
|
||||||
if (!this._boxPointer || !this._boxPointer.get_stage())
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
let side = this._boxPointer.arrowSide;
|
|
||||||
if (side == St.Side.TOP)
|
|
||||||
return this._boxPointer.getArrowHeight();
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
_sync() {
|
|
||||||
let themeNode = this.get_theme_node();
|
|
||||||
|
|
||||||
let offY = this._computeBoxPointerOffset();
|
|
||||||
this.translation_x = themeNode.get_length('-shell-close-overlap-x');
|
|
||||||
this.translation_y = themeNode.get_length('-shell-close-overlap-y') + offY;
|
|
||||||
}
|
|
||||||
|
|
||||||
vfunc_style_changed() {
|
|
||||||
this._sync();
|
|
||||||
super.vfunc_style_changed();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function makeCloseButton(boxpointer) {
|
|
||||||
return new CloseButton(boxpointer);
|
|
||||||
}
|
|
||||||
|
|
||||||
function ensureActorVisibleInScrollView(scrollView, actor) {
|
function ensureActorVisibleInScrollView(scrollView, actor) {
|
||||||
let adjustment = scrollView.vscroll.adjustment;
|
let adjustment = scrollView.vscroll.adjustment;
|
||||||
let [value, lower_, upper, stepIncrement_, pageIncrement_, pageSize] = adjustment.get_values();
|
let [value, lower_, upper, stepIncrement_, pageIncrement_, pageSize] = adjustment.get_values();
|
||||||
|
Loading…
Reference in New Issue
Block a user