1
0
Fork 0

GUI clean up from Michael HABARTA. Part 1

This commit is contained in:
Stuart Buchanan 2015-03-14 22:33:05 +00:00
parent abe0d5842f
commit 9f0a780279
4 changed files with 81 additions and 55 deletions

View file

@ -252,7 +252,7 @@
</button> </button>
<button> <button>
<legend>Take screen shot</legend> <legend>Take Screenshot</legend>
<equal>true</equal> <equal>true</equal>
<default>false</default> <default>false</default>
<binding> <binding>

View file

@ -434,8 +434,8 @@
<halign>fill</halign> <halign>fill</halign>
<stretch>true</stretch> <stretch>true</stretch>
<pref-width>260</pref-width> <pref-width>260</pref-width>
<pref-height>60</pref-height> <pref-height>70</pref-height>
<slider>1</slider> <slider>15</slider>
<editable>false</editable> <editable>false</editable>
<wrap>true</wrap> <wrap>true</wrap>
<live>true</live> <live>true</live>

View file

@ -8,10 +8,6 @@
<default-padding>1</default-padding> <default-padding>1</default-padding>
<color> <color>
<red type="float">0.41</red>
<green type="float">0.4</green>
<blue type="float">0.42</blue>
<alpha type="float">1.0</alpha>
<alpha type="float">1.0</alpha> <alpha type="float">1.0</alpha>
</color> </color>
@ -132,8 +128,9 @@
c.getNode("red", 1).setValue(0.2); c.getNode("red", 1).setValue(0.2);
c.getNode("green", 1).setValue(1.0); c.getNode("green", 1).setValue(1.0);
c.getNode("blue", 1).setValue(0.2); c.getNode("blue", 1).setValue(0.2);
# Now create an yellow version for when the condition
# Now create an amber version for when the condition
# is not met. # is not met.
t = table.getChild("text", txtcount, 1); t = table.getChild("text", txtcount, 1);
txtcount += 1; txtcount += 1;
@ -154,8 +151,8 @@
c = t.getNode("color", 1); c = t.getNode("color", 1);
c.getNode("red", 1).setValue(1.0); c.getNode("red", 1).setValue(1.0);
c.getNode("green", 1).setValue(1.0); c.getNode("green", 1).setValue(0.7);
c.getNode("blue", 1).setValue(0.2); c.getNode("blue", 1).setValue(0.2);
vis = t.getNode("visible", 1).getNode("not", 1); vis = t.getNode("visible", 1).getNode("not", 1);
props.copy(condition, vis); props.copy(condition, vis);
@ -271,9 +268,6 @@
var setTransparency = func(updateDialog){ var setTransparency = func(updateDialog){
var alpha = (getprop("/sim/gui/dialogs/checklist/transparent") or 0); var alpha = (getprop("/sim/gui/dialogs/checklist/transparent") or 0);
dlgRoot.getNode("color/alpha").setValue(1-alpha*0.3); dlgRoot.getNode("color/alpha").setValue(1-alpha*0.3);
dlgRoot.getNode("color/red").setValue(0.41-alpha*0.2);
dlgRoot.getNode("color/green").setValue(0.4-alpha*0.2);
dlgRoot.getNode("color/blue").setValue(0.42-alpha*0.2);
var n = props.Node.new({ "dialog-name": "checklist" }); var n = props.Node.new({ "dialog-name": "checklist" });
if (updateDialog) if (updateDialog)
{ {
@ -299,7 +293,7 @@
<label>Aircraft Checklists</label> <label>Aircraft Checklists</label>
</text> </text>
<empty><stretch>1</stretch></empty> <empty><stretch>true</stretch></empty>
<button> <button>
<pref-width>16</pref-width> <pref-width>16</pref-width>
@ -318,6 +312,12 @@
<group> <group>
<layout>hbox</layout> <layout>hbox</layout>
<!-- gap to left border -->
<text>
<halign>right</halign>
<label> </label>
</text>
<text> <text>
<halign>right</halign> <halign>right</halign>
<label>Checklist:</label> <label>Checklist:</label>
@ -327,7 +327,7 @@
<name>checklist-combo</name> <name>checklist-combo</name>
<property>/sim/gui/dialogs/checklist/selected-checklist</property> <property>/sim/gui/dialogs/checklist/selected-checklist</property>
<editable>false</editable> <editable>false</editable>
<pref-width>200</pref-width> <pref-width>230</pref-width>
<halign>fill</halign> <halign>fill</halign>
<binding> <binding>
<command>dialog-apply</command> <command>dialog-apply</command>
@ -350,9 +350,14 @@
<empty><stretch>true</stretch></empty> <empty><stretch>true</stretch></empty>
<!-- gap to next element -->
<text>
<halign>right</halign>
<label> </label>
</text>
<checkbox> <checkbox>
<label>Transparent</label> <label> Transparent</label>
<pref-width>100</pref-width>
<property>/sim/gui/dialogs/checklist/transparent</property> <property>/sim/gui/dialogs/checklist/transparent</property>
<live>true</live> <live>true</live>
<halign>right</halign> <halign>right</halign>
@ -366,6 +371,7 @@
<command>nasal</command> <command>nasal</command>
<script>setTransparency(1);</script> <script>setTransparency(1);</script>
</binding> </binding>
<halign>right</halign>
</checkbox> </checkbox>
</group> </group>
@ -379,7 +385,7 @@
</group> </group>
<group> <group>
<default-padding>4</default-padding> <default-padding>5</default-padding>
<halign>fill</halign> <halign>fill</halign>
<layout>hbox</layout> <layout>hbox</layout>

View file

@ -7,55 +7,75 @@
<group> <group>
<layout>hbox</layout> <layout>hbox</layout>
<empty><stretch>1</stretch></empty> <empty><stretch>1</stretch></empty>
<text> <text>
<label>Cockpit View Options</label> <label>Cockpit View Options</label>
</text> </text>
<empty><stretch>1</stretch></empty> <empty><stretch>1</stretch></empty>
<button> <button>
<pref-width>16</pref-width> <pref-width>16</pref-width>
<pref-height>16</pref-height> <pref-height>16</pref-height>
<legend></legend> <legend></legend>
<keynum>27</keynum> <keynum>27</keynum>
<border>2</border> <border>2</border>
<binding> <binding>
<command>dialog-close</command> <command>dialog-close</command>
</binding> </binding>
</button> </button>
</group> </group>
<hrule/> <hrule/>
<checkbox> <group>
<halign>left</halign> <layout>hbox</layout>
<label>Enable dynamic cockpit view</label>
<property>/sim/current-view/dynamic-view</property>
<binding>
<command>dialog-apply</command>
</binding>
</checkbox>
<checkbox> <!-- only for a gap -->
<halign>left</halign> <group>
<label>Enable view movement due to G-force</label> <layout>vbox</layout>
<property>/sim/rendering/headshake/enabled</property> <default-padding>1</default-padding>
<binding> <text>
<command>dialog-apply</command> <label> </label>
</binding> </text>
</checkbox> </group>
<checkbox> <group>
<halign>left</halign> <layout>vbox</layout>
<label>Enable Blackout and Redout due to G-force</label> <checkbox>
<property>/sim/rendering/redout/enabled</property> <halign>left</halign>
<binding> <label>Enable dynamic Cockpit View</label>
<command>dialog-apply</command> <property>/sim/current-view/dynamic-view</property>
</binding> <live>true</live>
</checkbox> <binding>
<command>dialog-apply</command>
</binding>
</checkbox>
<checkbox>
<halign>left</halign>
<label>Enable View Movement due to G-Force</label>
<property>/sim/rendering/headshake/enabled</property>
<live>true</live>
<binding>
<command>dialog-apply</command>
</binding>
</checkbox>
<checkbox>
<halign>left</halign>
<label>Enable Blackout and Redout due to G-Force</label>
<property>/sim/rendering/redout/enabled</property>
<live>true</live>
<binding>
<command>dialog-apply</command>
</binding>
</checkbox>
</group>
</group>
<hrule/> <hrule/>