padOsd: Refactor function setting label after edition into separate function

https://bugzilla.gnome.org/show_bug.cgi?id=782033
This commit is contained in:
Carlos Garnacho 2017-07-06 00:03:12 +02:00
parent 7db7b7dcbd
commit 44908cf470

View File

@ -550,11 +550,7 @@ const PadDiagram = new Lang.Class({
this.add_actor(label);
},
stopEdition: function (str) {
this._editorActor.hide();
if (this._curEdited) {
let [label, action, idx, dir] = this._curEdited;
_applyLabel: function(label, action, idx, dir, str) {
if (str != null) {
label.set_text(str);
@ -562,6 +558,14 @@ const PadDiagram = new Lang.Class({
this._allocateChild(label, x, y, arrangement);
}
label.show();
},
stopEdition: function (str) {
this._editorActor.hide();
if (this._curEdited) {
let [label, action, idx, dir] = this._curEdited;
this._applyLabel(label, action, idx, dir, str);
this._curEdited = null;
}
},