Fix resizing behaviour broken by b4d166 (bug #1750)
This commit is contained in:
parent
707d2101eb
commit
f5a3913a31
3 changed files with 46 additions and 69 deletions
|
@ -4,7 +4,6 @@
|
|||
<name>map-canvas</name>
|
||||
<layout>vbox</layout>
|
||||
<resizable>true</resizable>
|
||||
<!-- mhab -->
|
||||
<default-padding>3</default-padding>
|
||||
|
||||
<color>
|
||||
|
@ -65,12 +64,11 @@
|
|||
<group>
|
||||
<layout>hbox</layout>
|
||||
<stretch>true</stretch>
|
||||
<halign>left</halign>
|
||||
<halign>fill</halign>
|
||||
|
||||
<!-- sidebar -->
|
||||
<group>
|
||||
<layout>vbox</layout>
|
||||
<stretch>true</stretch>
|
||||
<halign>left</halign>
|
||||
|
||||
<text>
|
||||
|
@ -181,7 +179,7 @@
|
|||
<command>property-toggle</command>
|
||||
</binding>
|
||||
</checkbox>
|
||||
|
||||
|
||||
<checkbox>
|
||||
<label>Flight History</label>
|
||||
<halign>left</halign>
|
||||
|
@ -194,7 +192,7 @@
|
|||
<command>property-toggle</command>
|
||||
</binding>
|
||||
</checkbox>
|
||||
|
||||
|
||||
<checkbox>
|
||||
<label>Weather</label>
|
||||
<halign>left</halign>
|
||||
|
@ -214,7 +212,7 @@
|
|||
<command>property-toggle</command>
|
||||
</binding>
|
||||
</checkbox>
|
||||
|
||||
|
||||
<!-- layer only supported if tutorial system is active and targets specified-->
|
||||
<!--
|
||||
<checkbox>
|
||||
|
@ -236,7 +234,7 @@
|
|||
</binding>
|
||||
</checkbox>
|
||||
-->
|
||||
|
||||
|
||||
<empty><stretch>true</stretch></empty>
|
||||
|
||||
<checkbox>
|
||||
|
@ -362,7 +360,7 @@
|
|||
);
|
||||
|
||||
##
|
||||
# Styling: This is a bit crude at the moment, i.e. no dedicated APIs yet - but it's
|
||||
# Styling: This is a bit crude at the moment, i.e. no dedicated APIs yet - but it's
|
||||
# just there to prototype things for now
|
||||
var Styles = {};
|
||||
Styles.get = func(type) return Styles[type];
|
||||
|
@ -375,13 +373,13 @@
|
|||
Styles.DME.animation_test = 0; # for prototyping animated symbols
|
||||
|
||||
Styles.DME.scale_factor = 0.4; # 40% (applied to whole group)
|
||||
Styles.DME.line_width = 3.0;
|
||||
Styles.DME.line_width = 3.0;
|
||||
Styles.DME.color_tuned = [0,1,0]; #rgb
|
||||
Styles.DME.color_default = [1,1,0]; #rgb
|
||||
|
||||
Styles.APT = {};
|
||||
Styles.APT.scale_factor = 0.4; # 40% (applied to whole group)
|
||||
Styles.APT.line_width = 3.0;
|
||||
Styles.APT.line_width = 3.0;
|
||||
Styles.APT.color_default = [0,0.6,0.85]; #rgb
|
||||
Styles.APT.label_font_color = Styles.APT.color_default;
|
||||
Styles.APT.label_font_size=28;
|
||||
|
@ -450,12 +448,16 @@
|
|||
]]></load></nasal>
|
||||
</canvas>
|
||||
<layout>hbox</layout>
|
||||
<stretch>true</stretch>
|
||||
<halign>fill</halign>
|
||||
<valign>fill</valign>
|
||||
</group>
|
||||
|
||||
<hrule/>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
|
||||
|
||||
<button>
|
||||
<name>zoomout</name>
|
||||
<legend>out</legend>
|
||||
|
@ -471,7 +473,7 @@
|
|||
</script>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
|
||||
<text>
|
||||
<name>zoomdisplay</name>
|
||||
<label>MMM</label>
|
||||
|
@ -479,7 +481,7 @@
|
|||
<property>/gui/radar-mapstructure/zoom</property>
|
||||
<live>true</live>
|
||||
</text>
|
||||
|
||||
|
||||
<button>
|
||||
<name>zoomin</name>
|
||||
<legend>in</legend>
|
||||
|
|
|
@ -15,15 +15,9 @@ command interface /autopilot/route-manager/input:
|
|||
<name>map</name>
|
||||
<layout>vbox</layout>
|
||||
<resizable>true</resizable>
|
||||
<!-- mhab -->
|
||||
<default-padding>3</default-padding>
|
||||
|
||||
<color>
|
||||
<!-- mhab commented out
|
||||
<red type="float">0.41</red>
|
||||
<green type="float">0.4</green>
|
||||
<blue type="float">0.42</blue>
|
||||
-->
|
||||
<alpha type="float">1.0</alpha>
|
||||
</color>
|
||||
|
||||
|
@ -81,7 +75,7 @@ command interface /autopilot/route-manager/input:
|
|||
<group>
|
||||
<layout>hbox</layout>
|
||||
<stretch>true</stretch>
|
||||
<halign>left</halign>
|
||||
<halign>fill</halign>
|
||||
|
||||
<!-- sidebar -->
|
||||
<group>
|
||||
|
@ -93,9 +87,6 @@ command interface /autopilot/route-manager/input:
|
|||
<checkbox>
|
||||
<label>Fixes</label>
|
||||
<halign>left</halign>
|
||||
<!--
|
||||
<pref-width>100</pref-width>
|
||||
-->
|
||||
<property>/gui/map/draw-fixes</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
|
@ -109,9 +100,6 @@ command interface /autopilot/route-manager/input:
|
|||
<checkbox>
|
||||
<label>Navaids</label>
|
||||
<halign>left</halign>
|
||||
<!--
|
||||
<pref-width>100</pref-width>
|
||||
-->
|
||||
<property>/gui/map/draw-navaids</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
|
@ -131,9 +119,6 @@ command interface /autopilot/route-manager/input:
|
|||
<checkbox>
|
||||
<label>Traffic</label>
|
||||
<halign>left</halign>
|
||||
<!--
|
||||
<pref-width>100</pref-width>
|
||||
-->
|
||||
<property>/gui/map/draw-traffic</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
|
@ -154,9 +139,6 @@ command interface /autopilot/route-manager/input:
|
|||
<checkbox>
|
||||
<label>Data</label>
|
||||
<halign>left</halign>
|
||||
<!--
|
||||
<pref-width>100</pref-width>
|
||||
-->
|
||||
<property>/gui/map/draw-data</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
|
@ -170,9 +152,6 @@ command interface /autopilot/route-manager/input:
|
|||
<checkbox>
|
||||
<label>Flight History</label>
|
||||
<halign>left</halign>
|
||||
<!--
|
||||
<pref-width>100</pref-width>
|
||||
-->
|
||||
<property>/gui/map/draw-flight-history</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
|
@ -204,9 +183,6 @@ command interface /autopilot/route-manager/input:
|
|||
<checkbox>
|
||||
<label>Center on Acft</label>
|
||||
<halign>left</halign>
|
||||
<!--
|
||||
<pref-width>100</pref-width>
|
||||
-->
|
||||
<property>/gui/map/centre-on-aircraft</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
|
@ -220,9 +196,6 @@ command interface /autopilot/route-manager/input:
|
|||
<checkbox>
|
||||
<label>Aircraft Hdg Up</label>
|
||||
<halign>left</halign>
|
||||
<!--
|
||||
<pref-width>100</pref-width>
|
||||
-->
|
||||
<property>/gui/map/aircraft-heading-up</property>
|
||||
<live>true</live>
|
||||
<binding>
|
||||
|
@ -274,9 +247,8 @@ command interface /autopilot/route-manager/input:
|
|||
<stretch>true</stretch>
|
||||
|
||||
<map>
|
||||
<!-- <halign>fill</halign> -->
|
||||
<valign>fill</valign>
|
||||
<halign>fill</halign>
|
||||
<valign>fill</valign>
|
||||
<stretch>true</stretch>
|
||||
<pref-height>400</pref-height>
|
||||
<pref-width>600</pref-width>
|
||||
|
|
|
@ -37,7 +37,7 @@ command interface /autopilot/route-manager/input:
|
|||
return int(selection.getValue());
|
||||
}
|
||||
|
||||
var clear = func {
|
||||
var clear = func {
|
||||
flightplan().cleanPlan();
|
||||
selection.setIntValue(-1);
|
||||
}
|
||||
|
@ -62,16 +62,16 @@ command interface /autopilot/route-manager/input:
|
|||
flightplan().deleteWP(sel_index());
|
||||
}
|
||||
|
||||
var route = func {
|
||||
var route = func {
|
||||
var fp = flightplan();
|
||||
var from = fp.getWP(sel_index() - 1);
|
||||
var to = fp.getWP(sel_index());
|
||||
|
||||
|
||||
if ((from == nil ) or (to == nil)) {
|
||||
printlog('info', 'unable to route, invalid start ad end points');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var route = airwaysRoute(from, to);
|
||||
fp.insertWaypoints(route, sel_index());
|
||||
}
|
||||
|
@ -104,11 +104,11 @@ command interface /autopilot/route-manager/input:
|
|||
var sids = dlg.getNode("sids", 1);
|
||||
var stars = dlg.getNode("stars", 1);
|
||||
var approaches = dlg.getNode("approaches", 1);
|
||||
|
||||
|
||||
var updateRunways = func {
|
||||
departureRunways.removeChildren("value");
|
||||
destRunways.removeChildren("value");
|
||||
|
||||
|
||||
var apt = flightplan().departure;
|
||||
if (apt != nil) {
|
||||
var i=0;
|
||||
|
@ -132,13 +132,13 @@ command interface /autopilot/route-manager/input:
|
|||
|
||||
var updateSIDs = func {
|
||||
sids.removeChildren("value");
|
||||
|
||||
|
||||
var apt = flightplan().departure;
|
||||
var rwy = flightplan().departure_runway;
|
||||
if (apt == nil) {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (size(apt.sids(rwy)) == 0) {
|
||||
sids.getNode("value[0]", 1).setValue("DEFAULT");
|
||||
sids.getNode("value[1]", 1).setValue("(none)");
|
||||
|
@ -151,7 +151,7 @@ command interface /autopilot/route-manager/input:
|
|||
foreach (var s; apt.sids(rwy)) {
|
||||
var sid = apt.getSid(s);
|
||||
var transVec = sid.transitions;
|
||||
|
||||
|
||||
if (size(transVec) > 0) {
|
||||
# list each transition of the SID
|
||||
foreach (var trans; transVec) {
|
||||
|
@ -175,13 +175,13 @@ command interface /autopilot/route-manager/input:
|
|||
if (apt == nil or apt.stars(rwy) == nil) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var i=1;
|
||||
stars.getNode("value[0]", 1).setValue("(none)");
|
||||
foreach (var s; apt.stars(rwy)) {
|
||||
var star = apt.getStar(s);
|
||||
var transVec = star.transitions;
|
||||
|
||||
|
||||
if (size(transVec) > 0) {
|
||||
# list each transition of the STAR
|
||||
foreach (var trans; transVec) {
|
||||
|
@ -197,23 +197,23 @@ command interface /autopilot/route-manager/input:
|
|||
|
||||
gui.dialog_update("route-manager", "star");
|
||||
}
|
||||
|
||||
|
||||
var updateApproaches = func {
|
||||
approaches.removeChildren("value");
|
||||
var apt = flightplan().destination;
|
||||
var rwy = flightplan().destination_runway;
|
||||
|
||||
|
||||
if (apt == nil) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (size(apt.getApproachList(rwy)) == 0) {
|
||||
approaches.getNode("value[0]", 1).setValue("DEFAULT");
|
||||
approaches.getNode("value[1]", 1).setValue("(none)");
|
||||
gui.dialog_update("route-manager", "approach");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var i=1;
|
||||
approaches.getNode("value[0]", 1).setValue("(none)");
|
||||
foreach (var s; apt.getApproachList(rwy)) {
|
||||
|
@ -223,37 +223,37 @@ command interface /autopilot/route-manager/input:
|
|||
|
||||
gui.dialog_update("route-manager", "approach");
|
||||
}
|
||||
|
||||
|
||||
var initPosition = func {
|
||||
var routeActive = routem.getNode("active").getValue();
|
||||
if (routeActive) return;
|
||||
|
||||
|
||||
# FIXME have user waypoints check
|
||||
var fp = flightplan();
|
||||
|
||||
|
||||
var airborne = getprop('/gear/gear[0]/wow') == 0;
|
||||
if (airborne) {
|
||||
printlog('info', 'route-manager dialog, init in-air, clearing departure settings');
|
||||
fp.departure = nil;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# we're on the ground, find the nearest airport to start from
|
||||
if (fp.departure == nil) {
|
||||
var apts = findAirportsWithinRange(25.0);
|
||||
if (size(apts) == 0) return; # no airports nearby
|
||||
fp.departure = apts[0]; # use the closest one
|
||||
}
|
||||
|
||||
|
||||
if (fp.departure_runway == nil) {
|
||||
printlog('info', 'selecting departure runway');
|
||||
var rwy = fp.departure.findBestRunwayForPos( geo.aircraft_position() );
|
||||
fp.departure_runway = rwy;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# initialise departure values based on current position
|
||||
initPosition();
|
||||
|
||||
|
@ -462,8 +462,8 @@ command interface /autopilot/route-manager/input:
|
|||
<object-name>approach</object-name>
|
||||
</binding>
|
||||
</combo>
|
||||
|
||||
|
||||
|
||||
|
||||
<text>
|
||||
<row>1</row>
|
||||
<col>7</col>
|
||||
|
@ -570,6 +570,9 @@ command interface /autopilot/route-manager/input:
|
|||
<group>
|
||||
<layout>hbox</layout>
|
||||
<default-padding>2</default-padding>
|
||||
<stretch>true</stretch>
|
||||
<halign>fill</halign>
|
||||
<valign>fill</valign>
|
||||
|
||||
<!-- gap -->
|
||||
<text>
|
||||
|
|
Loading…
Add table
Reference in a new issue