-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextension.js
52 lines (44 loc) · 1.51 KB
/
extension.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const Main = imports.ui.main;
const ThumbnailsBox = imports.ui.workspaceThumbnail.ThumbnailsBox
const workspaceThumbnail = imports.ui.workspaceThumbnail
function enable () {
// Hides the search textbox
this.c = {
searchEntry: Main.overview.searchEntry,
searchController: Main.overview._overview.controls._searchController,
}
this.c.searchEntry.hide()
this.connectedId = this.c.searchController.connect('notify::search-active', () => {
if (this.c.searchController.searchActive) {
this.c.searchEntry.show();
} else {
this.c.searchEntry.hide();
}
})
// Makes the workspace thumbnails always visible
this.bkp = ThumbnailsBox.prototype._updateShouldShow
ThumbnailsBox.prototype._updateShouldShow = function() {
if (!this._shouldShow) {
this._shouldShow = true;
this.notify('should-show');
}
}
// Increases the workspace thumbnail size to 0.08
this.bkp_MAX_THUMBNAIL_SCALE = workspaceThumbnail.MAX_THUMBNAIL_SCALE
workspaceThumbnail.MAX_THUMBNAIL_SCALE = 0.08
}
function disable () {
// Undo - Hides the search textbox
if (this.connectedId) {
this.c.searchController.disconnect(this.connectedId)
}
this.c.searchEntry.show()
// Undo - Makes the workspace thumbnails always visible
if (this.bkp) {
ThumbnailsBox.prototype._updateShouldShow = this.bkp
}
// Undo - Increases the workspace thumbnail size to 0.08
if (this.bkp_MAX_THUMBNAIL_SCALE) {
workspaceThumbnail.MAX_THUMBNAIL_SCALE = this.bkp_MAX_THUMBNAIL_SCALE
}
}