appIndicator: Use native checks to look for equal emblems
Marco Trevisan (TreviƱo)
3 years ago
567 | 567 | } |
568 | 568 | |
569 | 569 | if (this.gicon) { |
570 | if (!this._emblem || !this.gicon.get_emblems().includes(this._emblem)) { | |
570 | if (!this.gicon.get_emblems().some(e => e.equal(this._emblem))) { | |
571 | 571 | this.gicon.clear_emblems(); |
572 | 572 | if (this._emblem) |
573 | 573 | this.gicon.add_emblem(this._emblem); |
623 | 623 | |
624 | 624 | _updateOverlayIcon() { |
625 | 625 | // remove old icon |
626 | if (this.gicon && this.gicon.get_emblems().length) { | |
627 | let [emblem] = this.gicon.get_emblems(); | |
628 | ||
629 | if (emblem.inUse) | |
630 | emblem.inUse = false | |
626 | if (this.gicon) { | |
627 | let emblems = this.gicon.get_emblems(); | |
628 | if (emblems.length == 1) { | |
629 | let [emblem] = emblems; | |
630 | ||
631 | if (emblem.inUse) | |
632 | emblem.inUse = false | |
633 | } | |
631 | 634 | } |
632 | 635 | |
633 | 636 | // KDE hardcodes the overlay icon size to 10px (normal icon size 16px) |