padOsd: Refactor function setting label after edition into separate function
https://bugzilla.gnome.org/show_bug.cgi?id=782033
This commit is contained in:
parent
4427197343
commit
7991a53189
@ -550,18 +550,22 @@ const PadDiagram = new Lang.Class({
|
|||||||
this.add_actor(label);
|
this.add_actor(label);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_applyLabel: function(label, action, idx, dir, str) {
|
||||||
|
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();
|
||||||
|
},
|
||||||
|
|
||||||
stopEdition: function (str) {
|
stopEdition: function (str) {
|
||||||
this._editorActor.hide();
|
this._editorActor.hide();
|
||||||
|
|
||||||
if (this._curEdited) {
|
if (this._curEdited) {
|
||||||
let [label, action, idx, dir] = this._curEdited;
|
let [label, action, idx, dir] = this._curEdited;
|
||||||
if (str != null) {
|
this._applyLabel(label, action, idx, dir, str);
|
||||||
label.set_text(str);
|
|
||||||
|
|
||||||
let [found, x, y, arrangement] = this.getLabelCoords(action, idx, dir);
|
|
||||||
this._allocateChild(label, x, y, arrangement);
|
|
||||||
}
|
|
||||||
label.show();
|
|
||||||
this._curEdited = null;
|
this._curEdited = null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user