FXSkins icon indicating copy to clipboard operation
FXSkins copied to clipboard

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

Open Exopandora opened this issue 4 years ago • 1 comments

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 avatar May 26 '21 21:05 Exopandora

Same applies for JMetro

Exopandora avatar May 26 '21 21:05 Exopandora