I have a issue styling the thumbs of the RangeSlider - the track gets a wrong color:
Consider this example:
package org.example;
import javafx.application.Application;
import javafx.geometry.Orientation;
import javafx.scene.Scene;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import org.controlsfx.control.RangeSlider;
public class App extends Application {
@Override
public void start(Stage stage) {
RangeSlider rangeSliderTest = new RangeSlider();
rangeSliderTest.setOrientation(Orientation.VERTICAL);
HBox hBoxWithRangeSlider = new HBox();
hBoxWithRangeSlider.setId("hBoxWithRangeSlider");
hBoxWithRangeSlider.getChildren().add(rangeSliderTest);
var scene = new Scene(new StackPane(hBoxWithRangeSlider), 200, 400);
scene.getStylesheets().add("_1_styles.css");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
}
And this CSS to style it:
.root{
-fx-focus-color:#00a8ff;
}
.range-slider .low-thumb {
-fx-pref-height: 10;
-fx-pref-width: 20;
}
.range-slider .high-thumb {
-fx-pref-height: 10;
-fx-pref-width: 20;
}
#hBoxWithRangeSlider{
-fx-padding: 20 20 20 20;
-fx-alignment: center;
}
It will give this:
As you can see there is a issue with the high-thumb, the track is white, it should be blue. It is strange, because if I remove all the high-thumb styling from the .css, then the high-thumb will still be styled.
EDIT: Issue is only present when Orientation.VERTICALis used.