removed workaround for xPosHelper Bug

This commit is contained in:
Jannik 2018-02-24 17:00:43 +01:00
parent b915cf7ad9
commit 662188813b
2 changed files with 11 additions and 26 deletions

View File

@ -166,7 +166,15 @@ public class Main extends Application {
}
}
// loading settings and initialize UI, dbController.main() loads all databases
// generate window
scene = new Scene(pane); // create new scene, append pane to scene
scene.getStylesheets().add(Main.class.getResource("/css/MainWindows.css").toExternalForm());
primaryStage.setMinWidth(265.00);
primaryStage.setMinHeight(425.00);
primaryStage.setScene(scene); // append scene to stage
primaryStage.show(); // show stage
// init here as it loads the games to the mwc and the gui, therefore the window must exist
mainWindowController.init();
mainWindowController.dbController.init();
@ -176,12 +184,6 @@ public class Main extends Application {
cloudController.sync(mainWindowController.getCloudService(), mainWindowController.getCemuPath(), directory.getPath());
}
scene = new Scene(pane); // create new scene, append pane to scene
scene.getStylesheets().add(Main.class.getResource("/css/MainWindows.css").toExternalForm());
primaryStage.setMinWidth(265.00);
primaryStage.setMinHeight(425.00);
primaryStage.setScene(scene); // append scene to stage
primaryStage.show(); // show stage
} catch (IOException e) {
e.printStackTrace();
}

View File

@ -304,7 +304,7 @@ public class MainWindowController {
private DirectoryChooser directoryChooser = new DirectoryChooser();
private ObservableList<String> branches = FXCollections.observableArrayList("stable", "beta");
private ObservableList<String> languages = FXCollections.observableArrayList("English (en_US)", "Deutsch (de_DE)");
private ObservableList<String> smmIDs = FXCollections.observableArrayList("fe31b7f2", "44fc5929"); // TODO add more IDs
private ObservableList<String> smmIDs = FXCollections.observableArrayList("fe31b7f2", "44fc5929");
private ObservableList<UIROMDataType> games = FXCollections.observableArrayList();
ObservableList<SmmdbApiDataType> courses = FXCollections.observableArrayList();
ObservableList<SmmdbApiDataType> filteredCourses = FXCollections.observableArrayList();
@ -1539,18 +1539,7 @@ public class MainWindowController {
* calculates how many games can be displayed in one row
*/
private void generatePosition() {
int xPosHelperMax;
/**FIXME somehow the window width is set to 8, if we can find a way to get always the real window with
*(at the beginning we have to use prefWidth after resizing Width) we can remove this
*This is caused by the time the game objects are generates,
*it's before the window is opened so it's size is > 10
*/
if (mainAnchorPane.getWidth() < 10) {
xPosHelperMax = (int) Math.floor((mainAnchorPane.getPrefWidth() - 36) / 217);
} else {
xPosHelperMax = (int) Math.floor((mainAnchorPane.getWidth() - 36) / 217);
}
int xPosHelperMax = (int) Math.floor((mainAnchorPane.getWidth() - 36) / 217);
if(xPosHelper == xPosHelperMax){
oldXPosHelper = xPosHelper;
@ -1561,12 +1550,6 @@ public class MainWindowController {
xPos = xPos + 217;
xPosHelper++;
}
// System.out.println("Breit: " + main.pane.getWidth());
// System.out.println("Breit2: " + mainAnchorPane.getWidth());
// System.out.println("xPosHelper: " + xPosHelper);
// System.out.println("yPos: " + yPos);
// System.out.println("xPos: " + xPos);
}
// change the color of all needed GUI elements