Close dialogs with Esc-key
This commit is contained in:
parent
ca5cb99a4c
commit
1d9ff30420
4 changed files with 9 additions and 1 deletions
|
@ -787,7 +787,8 @@ var weightChangeHandler = func {
|
||||||
#
|
#
|
||||||
var showWeightDialog = func {
|
var showWeightDialog = func {
|
||||||
var name = "WeightAndFuel";
|
var name = "WeightAndFuel";
|
||||||
var title = "Weight and Fuel Settings";
|
# menu entry is "Fuel and Payload"
|
||||||
|
var title = "Fuel and Payload Settings";
|
||||||
|
|
||||||
#
|
#
|
||||||
# General Dialog Structure
|
# General Dialog Structure
|
||||||
|
@ -806,6 +807,8 @@ var showWeightDialog = func {
|
||||||
w.set("pref-height", 16);
|
w.set("pref-height", 16);
|
||||||
w.set("legend", "");
|
w.set("legend", "");
|
||||||
w.set("default", 0);
|
w.set("default", 0);
|
||||||
|
# "Esc" causes dialog-close
|
||||||
|
w.set("key", "Esc");
|
||||||
w.setBinding("dialog-close");
|
w.setBinding("dialog-close");
|
||||||
|
|
||||||
dialog[name].addChild("hrule");
|
dialog[name].addChild("hrule");
|
||||||
|
|
|
@ -216,6 +216,8 @@ var dialog = {
|
||||||
|
|
||||||
var w = titlebar.addChild("button");
|
var w = titlebar.addChild("button");
|
||||||
w.node.setValues({ "pref-width": 16, "pref-height": 16, legend: "", default: 0 });
|
w.node.setValues({ "pref-width": 16, "pref-height": 16, legend: "", default: 0 });
|
||||||
|
# "Esc" causes dialog-close
|
||||||
|
w.set("key", "Esc");
|
||||||
w.setBinding("nasal", "multiplayer.dialog.del()");
|
w.setBinding("nasal", "multiplayer.dialog.del()");
|
||||||
|
|
||||||
me.dialog.addChild("hrule");
|
me.dialog.addChild("hrule");
|
||||||
|
|
|
@ -69,6 +69,8 @@ var dialog = {
|
||||||
|
|
||||||
var w = titlebar.addChild("button");
|
var w = titlebar.addChild("button");
|
||||||
w.node.setValues({ "pref-width": 16, "pref-height": 16, legend: "", default: 0 });
|
w.node.setValues({ "pref-width": 16, "pref-height": 16, legend: "", default: 0 });
|
||||||
|
# "Esc" causes dialog-close
|
||||||
|
w.set("key", "Esc");
|
||||||
w.setBinding("nasal", "performance_monitor.dialog.del()");
|
w.setBinding("nasal", "performance_monitor.dialog.del()");
|
||||||
|
|
||||||
me.dialog.addChild("hrule");
|
me.dialog.addChild("hrule");
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
<button>
|
<button>
|
||||||
<legend></legend>
|
<legend></legend>
|
||||||
|
<key>Esc</key>
|
||||||
<pref-width>16</pref-width>
|
<pref-width>16</pref-width>
|
||||||
<pref-height>16</pref-height>
|
<pref-height>16</pref-height>
|
||||||
<border>2</border>
|
<border>2</border>
|
||||||
|
|
Loading…
Reference in a new issue