Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Exopandora opened this issue May 26, 2021 · 1 comment
Open

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

Exopandora opened this issue May 26, 2021 · 1 comment

Comments

@Exopandora
Copy link
Contributor

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:

progressbar.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
Copy link
Contributor Author

Same applies for JMetro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant