From f0ee9cdcf86f9f44ad6cdc8a903474eedf98a824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Tue, 2 Jun 2020 16:16:36 +0200 Subject: [PATCH] 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 --- js/misc/util.js | 49 ++----------------------------------------------- 1 file changed, 2 insertions(+), 47 deletions(-) diff --git a/js/misc/util.js b/js/misc/util.js index c68604e87..314d7660f 100644 --- a/js/misc/util.js +++ b/js/misc/util.js @@ -1,9 +1,9 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* exported findUrls, spawn, spawnCommandLine, spawnApp, trySpawnCommandLine, 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 Main = imports.ui.main; @@ -363,51 +363,6 @@ function insertSorted(array, val, cmp) { 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) { let adjustment = scrollView.vscroll.adjustment; let [value, lower_, upper, stepIncrement_, pageIncrement_, pageSize] = adjustment.get_values();