[gnome-shell/wip/carlosg/pad-osd-fixes: 9/12] padOsd: Only allocate child labels within allocate vfunc
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/pad-osd-fixes: 9/12] padOsd: Only allocate child labels within allocate vfunc
- Date: Fri, 29 May 2020 15:37:26 +0000 (UTC)
commit eabadc3e7095b1fc2569802b13284ab3abe56fe2
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri May 29 16:05:57 2020 +0200
padOsd: Only allocate child labels within allocate vfunc
Make both start/stop edition and label updates queue a relayout, and
only deal with child allocations in the allocate method.
js/ui/padOsd.js | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/padOsd.js b/js/ui/padOsd.js
index 68ea573e02..36bceee982 100644
--- a/js/ui/padOsd.js
+++ b/js/ui/padOsd.js
@@ -592,15 +592,13 @@ var PadDiagram = GObject.registerClass({
let str = getText(params.action, params.idx, params.dir);
params.label.set_text(str);
}
+
+ this.queue_relayout();
}
_applyLabel(label, action, idx, dir, str) {
- if (str != null) {
+ if (str != null)
label.set_text(str);
-
- let [found_, x, y, arrangement] = this._getLabelCoords(action, idx, dir);
- this._allocateChild(label, x, y, arrangement);
- }
label.show();
}
@@ -620,6 +618,8 @@ var PadDiagram = GObject.registerClass({
this._prevEdited = this._curEdited;
this._curEdited = null;
}
+
+ this.queue_relayout();
}
startEdition(action, idx, dir) {
@@ -641,6 +641,7 @@ var PadDiagram = GObject.registerClass({
return;
this._editorActor.show();
editedLabel.hide();
+ this.queue_relayout();
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]