diff --git a/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/BasePlugin.java b/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/BasePlugin.java index 1ae219408..2d67b89e5 100644 --- a/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/BasePlugin.java +++ b/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/BasePlugin.java @@ -81,7 +81,7 @@ @Description( group = "edu.wpi.first.shuffleboard", name = "Base", - version = "1.3.6", + version = "1.3.7", summary = "Defines all the WPILib data types and stock widgets" ) @SuppressWarnings("PMD.CouplingBetweenObjects") diff --git a/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/widget/NumberSliderWidget.java b/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/widget/NumberSliderWidget.java index c1476ff2c..073c1aa9d 100644 --- a/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/widget/NumberSliderWidget.java +++ b/plugins/base/src/main/java/edu/wpi/first/shuffleboard/plugin/base/widget/NumberSliderWidget.java @@ -11,13 +11,16 @@ import java.util.List; import org.fxmisc.easybind.EasyBind; +import javafx.beans.property.Property; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; +import javafx.beans.property.SimpleObjectProperty; import javafx.fxml.FXML; import javafx.scene.control.Slider; import javafx.scene.control.Label; import javafx.scene.layout.Pane; +import javafx.geometry.Orientation; @Description( name = "Number Slider", @@ -33,6 +36,8 @@ public class NumberSliderWidget extends SimpleAnnotatedWidget { private Label text; private final BooleanProperty showText = new SimpleBooleanProperty(this, "showText", true); + private final Property orientation = + new SimpleObjectProperty<>(this, "orientation", Orientation.HORIZONTAL); @FXML private void initialize() { @@ -43,6 +48,7 @@ private void initialize() { .divide(4)); slider.valueProperty().bindBidirectional(dataProperty()); text.textProperty().bind(EasyBind.map(dataOrDefault, n -> String.format("%.2f", n.doubleValue()))); + slider.orientationProperty().bind(orientation); } @Override @@ -59,7 +65,8 @@ public List getSettings() { Setting.of("Block increment", slider.blockIncrementProperty(), Double.class) ), Group.of("Visuals", - Setting.of("Display value", showText, Boolean.class) + Setting.of("Display value", showText, Boolean.class), + Setting.of("Orientation", orientation, Orientation.class) ) ); }