replace addTopChrome with uiGroup.add_actor, fixes #7

This commit is contained in:
JerryXiao 2022-06-07 18:13:53 +08:00
parent 6149951ac1
commit 3443a18445
Signed by: Jerry
GPG key ID: 22618F758B5BE2E5

View file

@ -41,8 +41,8 @@ class Extension {
for (let monitor of Main.layoutManager.monitors) { for (let monitor of Main.layoutManager.monitors) {
let label_1 = new St.Label({style_class: 'label-1', text: text1, opacity}) let label_1 = new St.Label({style_class: 'label-1', text: text1, opacity})
let label_2 = new St.Label({style_class: 'label-2', text: text2, opacity}) let label_2 = new St.Label({style_class: 'label-2', text: text2, opacity})
Main.layoutManager.addTopChrome(label_2, {"trackFullscreen": false}) Main.layoutManager.uiGroup.add_actor(label_2, {"trackFullscreen": false})
Main.layoutManager.addTopChrome(label_1, {"trackFullscreen": false}) Main.layoutManager.uiGroup.add_actor(label_1, {"trackFullscreen": false})
this.labels.push(label_1) this.labels.push(label_1)
this.labels.push(label_2) this.labels.push(label_2)
let h = Math.max(0, Math.floor(monitor.height * vl2 - label_2.height)) let h = Math.max(0, Math.floor(monitor.height * vl2 - label_2.height))
@ -54,7 +54,7 @@ class Extension {
cleanup() { cleanup() {
for (let label of this.labels) { for (let label of this.labels) {
Main.layoutManager.removeChrome(label) Main.layoutManager.uiGroup.remove_actor(label)
label.destroy() label.destroy()
} }
this.labels = [] this.labels = []