Skip to content

Commit 7b4754b

Browse files
committed
Various layout fixes
1 parent 7cd23cd commit 7b4754b

File tree

11 files changed

+48
-35
lines changed

11 files changed

+48
-35
lines changed

MAVGCL/src/com/comino/flight/ui/FlightTabs.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ public void setup(FlightControlPanel flightControl, StatusLineWidget statusline,
145145
vehiclectl.fadeProperty().bind(flightControl.getControl().getVehicleCtlVisibility());
146146
vehiclectl.setup(control);
147147

148-
experimental.fadeProperty().bind(flightControl.getControl().getExperimentalVisibility());
149-
experimental.setup(control);
148+
// experimental.fadeProperty().bind(flightControl.getControl().getExperimentalVisibility());
149+
// experimental.setup(control);
150150

151151
mavmaptab.setup(flightControl.getChartControl(),control);
152152
mavinspectortab.setup(control);

MAVGCL/src/com/comino/flight/ui/MAVGCL2.fxml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
visible="false" styleClass="widget">
5656
<HBox.margin><Insets top="3"/></HBox.margin>
5757
</TuningWidget>
58-
<VehicleCtlWidget fx:id="vehiclectl" maxWidth="185"
59-
visible="false" styleClass="widget">
58+
<VehicleCtlWidget fx:id="vehiclectl" maxWidth="195"
59+
visible="false">
6060
<HBox.margin><Insets top="3"/></HBox.margin>
6161
</VehicleCtlWidget>
6262
<DetailsWidget fx:id="details" maxWidth="195"

MAVGCL/src/com/comino/flight/ui/panel/control/FlightControlPanel.fxml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
xmlns="http://javafx.com/javafx/8.0.51" xmlns:fx="http://javafx.com/fxml/1">
88

99
<children>
10-
<VBox>
10+
<VBox fx:id="box">
1111
<padding>
1212
<Insets top="5" left="5" bottom="0" right="0" />
1313
</padding>
@@ -18,7 +18,7 @@
1818
<RecordControlWidget fx:id="recordcontrol" />
1919
<ChartControlWidget fx:id="chartcontrol" />
2020
<CommanderWidget fx:id="commander" />
21-
<InfoWidget fx:id="info" />
21+
<InfoWidget fx:id="info" VBox.vgrow="ALWAYS"/>
2222
</children>
2323
</VBox>
2424
</children>

MAVGCL/src/com/comino/flight/ui/panel/control/FlightControlPanel.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,13 @@
4646

4747
import javafx.fxml.FXML;
4848
import javafx.scene.layout.Pane;
49+
import javafx.scene.layout.VBox;
4950

5051
public class FlightControlPanel extends Pane {
5152

53+
@FXML
54+
private VBox box;
55+
5256
@FXML
5357
private ControlWidget control;
5458

@@ -94,6 +98,8 @@ public ControlWidget getControl() {
9498

9599
public void setup(IMAVController control) {
96100

101+
box.prefHeightProperty().bind(this.heightProperty().subtract(2));
102+
97103
status.setup(control);
98104
recordcontrol.setup(control, chartcontrol, info, status);
99105

MAVGCL/src/com/comino/flight/ui/sidebar/VehicleCtlWidget.fxml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,32 @@
33
<?import javafx.scene.control.*?>
44
<?import javafx.scene.layout.*?>
55
<?import com.comino.jfx.extensions.*?>
6+
<?import javafx.geometry.Insets?>
67

7-
<fx:root type="javafx.scene.layout.Pane" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1">
8-
<VBox spacing="10" layoutX="10.0" layoutY="14.0">
9-
<children>
10-
<Button fx:id="reset_odometry" prefWidth="161.0" text="Reset odometry" />
11-
<Button fx:id="reset_microslam" prefWidth="161.0" text="Reset local map (microSLAM)" />
12-
<CheckBox fx:id="enable_vision" text="Publish odometry" />
13-
<CheckBox fx:id="enable_jumpback" text="JumpBack" />
14-
<CheckBox fx:id="enable_circle" text="CircleMode" />
15-
<DashLabelLED fx:id="jumpback" prefWidth="161.0" text="JumpBack enabled" />
16-
<DashLabelLED fx:id="circlemode" prefWidth="161.0" text="Circle mode" />
17-
</children>
18-
</VBox>
8+
<fx:root type="javafx.scene.layout.Pane" xmlns="http://javafx.com/javafx/8.0.65"
9+
xmlns:fx="http://javafx.com/fxml/1">
10+
<VBox fx:id="box" prefWidth="193">
11+
<children>
12+
<VBox spacing="10" styleClass="widget" prefWidth="193">
13+
<padding><Insets top="14" left="10" bottom="14" /></padding>
14+
<children>
15+
<Button fx:id="reset_odometry" prefWidth="165.0" text="Reset odometry" />
16+
<Button fx:id="reset_microslam" prefWidth="165.0"
17+
text="Reset local map (microSLAM)" />
18+
<CheckBox fx:id="enable_vision" text="Publish odometry" />
19+
</children>
20+
</VBox>
21+
<VBox spacing="10" styleClass="widget" prefWidth="193" VBox.vgrow="ALWAYS">
22+
<padding><Insets top="14" left="10" bottom="14" /></padding>
23+
<children>
24+
<CheckBox fx:id="enable_jumpback" text="JumpBack" />
25+
<DashLabelLED fx:id="jumpback" prefWidth="165.0"
26+
text="JumpBack enabled" />
27+
<CheckBox fx:id="enable_circle" text="CircleMode" />
28+
<DashLabelLED fx:id="circlemode" prefWidth="165.0"
29+
text="Circle mode" />
30+
</children>
31+
</VBox>
32+
</children>
33+
</VBox>
1934
</fx:root>

MAVGCL/src/com/comino/flight/ui/sidebar/VehicleCtlWidget.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,15 @@
4949
import javafx.event.ActionEvent;
5050
import javafx.fxml.FXML;
5151
import javafx.fxml.FXMLLoader;
52-
import javafx.geometry.Insets;
5352
import javafx.scene.control.Button;
5453
import javafx.scene.control.CheckBox;
55-
import javafx.scene.layout.FlowPane;
54+
import javafx.scene.layout.VBox;
5655

5756
public class VehicleCtlWidget extends WidgetPane {
5857

5958

59+
@FXML
60+
private VBox box;
6061

6162
@FXML
6263
private Button reset_odometry;
@@ -99,6 +100,8 @@ public VehicleCtlWidget() {
99100
@FXML
100101
private void initialize() {
101102

103+
box.prefHeightProperty().bind(this.heightProperty());
104+
102105

103106
enable_vision.selectedProperty().addListener((v,o,n) -> {
104107
msg_msp_command msp = new msg_msp_command(255,1);

MAVGCL/src/com/comino/flight/ui/widgets/panel/ControlWidget.fxml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
<rowConstraints>
2121
<RowConstraints minHeight="20.0" />
2222
<RowConstraints minHeight="25.0" />
23-
<RowConstraints minHeight="25.0" />
2423
</rowConstraints>
2524
<children>
2625
<CheckBox fx:id="details" GridPane.rowIndex="0"
@@ -31,8 +30,6 @@
3130
GridPane.columnIndex="1" text="Video" />
3231
<CheckBox fx:id="vehiclectl" GridPane.rowIndex="0"
3332
GridPane.columnIndex="1" text="MSP Control" />
34-
<CheckBox fx:id="experimental" GridPane.rowIndex="2"
35-
GridPane.columnIndex="0" text="Experimental" />
3633
</children>
3734
</GridPane>
3835
</children>

MAVGCL/src/com/comino/flight/ui/widgets/panel/ControlWidget.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ public class ControlWidget extends WidgetPane {
5656
@FXML
5757
private CheckBox vehiclectl;
5858

59-
@FXML
60-
private CheckBox experimental;
61-
6259
private StateProperties stateProperties = StateProperties.getInstance();
6360

6461
public ControlWidget() {
@@ -79,10 +76,6 @@ public BooleanProperty getVehicleCtlVisibility() {
7976
return vehiclectl.selectedProperty();
8077
}
8178

82-
public BooleanProperty getExperimentalVisibility() {
83-
return experimental.selectedProperty();
84-
}
85-
8679
public BooleanProperty getTuningVisibility() {
8780
return tuning.selectedProperty();
8881
}
@@ -95,17 +88,13 @@ private void initialize() {
9588
if(!n.booleanValue()) {
9689
vehiclectl.setDisable(true);
9790
vehiclectl.setSelected(false);
98-
experimental.setDisable(true);
99-
experimental.setSelected(false);
10091
} else {
10192
vehiclectl.setDisable(false);
102-
experimental.setDisable(false);
10393
}
10494
});
10595

10696
stateProperties.getLogLoadedProperty().addListener((e,o,n) -> {
10797
if(n.booleanValue()) {
108-
experimental.setSelected(false);
10998
vehiclectl.setSelected(false);
11099
tuning.setSelected(false);
111100
} else {

MAVGCL/src/com/comino/flight/ui/widgets/panel/InfoWidget.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
styleClass="widget" xmlns="http://javafx.com/javafx/8.0.51" xmlns:fx="http://javafx.com/fxml/1">
99
<children>
1010
<ListView fx:id="listview" layoutX="5" layoutY="5" prefWidth="194"
11-
prefHeight="145" editable="false">
11+
editable="false">
1212
</ListView>
1313
</children>
1414
</fx:root>

MAVGCL/src/com/comino/flight/ui/widgets/panel/InfoWidget.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public InfoWidget() {
6464
@FXML
6565
private void initialize() {
6666

67+
listview.prefHeightProperty().bind(this.heightProperty().subtract(13));
68+
6769
listview.setCellFactory(list -> new ListCell<LogMessage>() {
6870

6971
@Override

0 commit comments

Comments
 (0)