dukke / FXSkins

Skins with new features and looks for existing JavaFX controls
https://pixelduke.com/fxskins/
46 stars 9 forks source link

Wide Intermediate Progress Bars do not "stop" in the center #2

Open Exopandora opened 3 years ago

Exopandora commented 3 years ago

Issue:
Wide Intermediate Progress Bars do not "stop" in the center of the Progress Bar. For small Progress Bars it works fine but the wider it becomes the more the center of the "stop" shifts to the right.

Video:

https://user-images.githubusercontent.com/18708736/119733868-6681c400-be7a-11eb-9c0f-ef44a08000cd.mp4

Example code: TestProgressBar.java:

import com.pixelduke.control.skin.FXSkins;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class TestProgressBar extends Application {
    @Override
    public void start(Stage stage) throws Exception {
        FXMLLoader loader = new FXMLLoader(this.getClass().getResource("TestProgressBar.fxml"));
        loader.setController(this);
        Parent root = loader.load();
        Scene scene = new Scene(root);
        scene.getStylesheets().add(FXSkins.getStylesheetURL()); 
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        Application.launch(args);
    }
}

TestProgressBar.fxml:

<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.ProgressBar?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>

<VBox xmlns="http://javafx.com/javafx/15.0.1" xmlns:fx="http://javafx.com/fxml/1">
   <children>
      <AnchorPane>
         <children>
            <StackPane style="-fx-background-color: lightgrey;" AnchorPane.leftAnchor="340.0" AnchorPane.rightAnchor="340.0">
               <children>
                  <ProgressBar maxWidth="-Infinity" minWidth="-Infinity" prefWidth="300.0">
                     <StackPane.margin>
                        <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
                     </StackPane.margin>
                  </ProgressBar>
               </children>
            </StackPane>
         </children>
      </AnchorPane>
      <StackPane style="-fx-background-color: lightgrey;">
         <children>
            <ProgressBar prefWidth="1000.0">
               <StackPane.margin>
                  <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
               </StackPane.margin>
            </ProgressBar>
         </children>
      </StackPane>
   </children>
</VBox>
Exopandora commented 3 years ago

Same applies for JMetro