Skip to content
Permalink
Browse files

Generalize main root from AnchorPane to Pane

  • Loading branch information
iAmGio committed Oct 7, 2019
1 parent dc4f944 commit fb0faa7277e90242c9f16ba7174baf18bed24e6f
@@ -7,7 +7,6 @@
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
import javafx.scene.text.Font;
import javafx.stage.Stage;
@@ -63,7 +62,7 @@

private static Chorus instance;

public AnchorPane root;
public Pane root;

@Override
public void start() {
@@ -136,7 +135,7 @@ private void initApp() throws Exception {

resourceBundle = ResourceBundle.getBundle("assets/lang/lang",
Locale.forLanguageTag(Lang.fromCommonName(config.get("1.Appearance.4.Language")).getTag()));
root = (AnchorPane) loadRoot("/assets/views/Editor.fxml", resourceBundle);
root = loadRoot("/assets/views/Editor.fxml", resourceBundle);
boolean inherit = config.getBoolean("1.Appearance.3.Inherit_window_size");
Scene scene = new Scene(root, inherit ? config.getInt("_win.width") : 950, inherit ? config.getInt("_win.height") : 600);
Theme theme = Themes.byConfig();
@@ -1,7 +1,7 @@
package org.chorusmc.chorus.menus.drop;

import javafx.geometry.Pos;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
import org.chorusmc.chorus.Chorus;
import org.chorusmc.chorus.addon.Addons;
import org.chorusmc.chorus.menus.BrowsableVBox;
@@ -79,7 +79,7 @@ public void show() {
MenuPlacer placer = new MenuPlacer(this);
setLayoutX(placer.getX());
setLayoutY(placer.getY());
AnchorPane root = Chorus.getInstance().root;
Pane root = Chorus.getInstance().root;
if(!root.getChildren().contains(this)) {
root.getChildren().add(this);
}
@@ -7,7 +7,7 @@
import javafx.scene.image.Image;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import org.chorusmc.chorus.Chorus;
import org.chorusmc.chorus.menus.BrowsableVBox;
@@ -105,7 +105,7 @@ public void show() {
setLayoutX(placer.getX());
setLayoutY(placer.getY());
Utils.hideMenuOnInteract(this, InteractFilter.values(), target);
AnchorPane root = Chorus.getInstance().root;
Pane root = Chorus.getInstance().root;
if(!root.getChildren().contains(this)) {
root.getChildren().add(this);
}

0 comments on commit fb0faa7

Please sign in to comment.
You can’t perform that action at this time.