cleanup: Replace signal connections with virtual functions
Inheriting from actors allows to use virtual functions instead of signal connections for multiple cases, so just use them when possible. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/559
This commit is contained in:

committed by
Florian Müllner

parent
320df13b65
commit
55b57421dc
@ -895,8 +895,6 @@ var EmojiSelection = GObject.registerClass({
|
||||
|
||||
this._populateSections();
|
||||
|
||||
this.connect('notify::mapped', () => this._emojiPager.setCurrentPage(0));
|
||||
|
||||
this._emojiPager = new EmojiPager(this._sections, 11, 3);
|
||||
this._emojiPager.connect('page-changed', (pager, sectionLabel, page, nPages) => {
|
||||
this._onPageChanged(sectionLabel, page, nPages);
|
||||
@ -918,6 +916,16 @@ var EmojiSelection = GObject.registerClass({
|
||||
this._emojiPager.setCurrentPage(0);
|
||||
}
|
||||
|
||||
vfunc_map() {
|
||||
this._emojiPager.setCurrentPage(0);
|
||||
super.vfunc_map();
|
||||
}
|
||||
|
||||
vfunc_unmap() {
|
||||
super.vfunc_unmap();
|
||||
this._emojiPager.setCurrentPage(0);
|
||||
}
|
||||
|
||||
_onPageChanged(sectionLabel, page, nPages) {
|
||||
this._pageIndicator.setNPages(nPages);
|
||||
this._pageIndicator.setCurrentPage(page);
|
||||
|
Reference in New Issue
Block a user