Skip to content

Commit

Permalink
[FEATURE] [FIX] Rebinding elements to anchor panels
Browse files Browse the repository at this point in the history
  • Loading branch information
microwin7 committed Aug 25, 2024
1 parent ce9393d commit e848283
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 31 deletions.
35 changes: 22 additions & 13 deletions runtime/components/panels/leftpanel.fxml
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.FlowPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>

<AnchorPane id="leftpanel" prefWidth="300.0" stylesheets="@leftpanel.css" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1">
<children>
<fx:include source="../buttons/back.fxml" AnchorPane.leftAnchor="28.0" AnchorPane.topAnchor="34.0" />
<Pane id="userBlock" AnchorPane.leftAnchor="74.0" AnchorPane.topAnchor="34.0">
<children>
<fx:include source="../userBlock.fxml" AnchorPane.leftAnchor="28.0" AnchorPane.topAnchor="34.0" />
</children>
</Pane>
<HBox alignment="CENTER" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="130.0">
<children>
<!-- Блок сервера -->
<Pane id="serverButton" />
</children>
</HBox>
<AnchorPane maxHeight="-Infinity" prefHeight="80.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<fx:include source="../buttons/back.fxml" AnchorPane.leftAnchor="28.0" AnchorPane.topAnchor="34.0" />
<Pane id="userBlock" AnchorPane.leftAnchor="74.0" AnchorPane.topAnchor="34.0">
<children>
<fx:include source="../userBlock.fxml" AnchorPane.leftAnchor="28.0" AnchorPane.topAnchor="34.0" />
</children>
</Pane>
</children>
</AnchorPane>
<FlowPane alignment="CENTER" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="80.0">
<children>
<HBox alignment="CENTER">
<children>
<!-- Блок сервера -->
<Pane id="serverButton" />
</children>
</HBox>
</children>
</FlowPane>
</children>
</AnchorPane>
</AnchorPane>
11 changes: 4 additions & 7 deletions runtime/scenes/login/login.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.ContextMenu?>
<?import javafx.scene.control.Tooltip?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
Expand All @@ -15,16 +13,15 @@
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.shape.SVGPath?>
<?import javafx.scene.text.Text?>

<AnchorPane id="layout" fx:id="loginPane" prefHeight="560.0" prefWidth="930.0" styleClass="background" stylesheets="@login.css" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1">

<!-- Вертикальная полоса -->
<AnchorPane id="loginLeftPane" prefWidth="380.0" styleClass="vline" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0">
<VBox layoutX="35.0" layoutY="366.0" spacing="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<VBox alignment="CENTER" layoutX="35.0" layoutY="366.0" spacing="20.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<FlowPane alignment="CENTER" orientation="VERTICAL">
<FlowPane alignment="CENTER" maxHeight="-Infinity" minHeight="-Infinity" orientation="VERTICAL" prefHeight="320.0">
<children>
<ImageView id="logo" pickOnBounds="true" preserveRatio="true">
<image>
Expand All @@ -33,7 +30,7 @@
</ImageView>
</children>
</FlowPane>
<VBox spacing="5.0">
<VBox spacing="10.0">
<children>
<!-- Чекбоксы -->
<CheckBox id="autoenter" prefHeight="18.0" prefWidth="276.0" text="%runtime.scenes.login.autoenter" wrapText="true">
Expand All @@ -51,7 +48,7 @@
<Insets left="20.0" />
</padding>
</VBox>
<ComboBox id="authList" maxWidth="1.7976931348623157E308" prefHeight="70.0" />
<ComboBox id="authList" maxWidth="1.7976931348623157E308" minHeight="60.0" />
</children>
</VBox>
</AnchorPane>
Expand Down
4 changes: 2 additions & 2 deletions runtime/scenes/serverinfo/serverinfo.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<AnchorPane prefHeight="560.0" prefWidth="930.0" styleClass="background" stylesheets="@serverinfo.css" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1">
<!-- Навбар -->
<AnchorPane id="header" prefHeight="80.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<AnchorPane prefHeight="80.0" prefWidth="630.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<AnchorPane prefHeight="80.0" prefWidth="630.0" AnchorPane.leftAnchor="300.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<Label id="serverName" maxWidth="400.0" prefHeight="32.0" styleClass="scene-header" text="ServerName" AnchorPane.leftAnchor="35.0" AnchorPane.topAnchor="34.0" />
<!-- Кнопки управления -->
Expand All @@ -22,7 +22,7 @@
</AnchorPane>
</AnchorPane>
<fx:include source="../../components/panels/leftpanel.fxml" />
<AnchorPane prefHeight="480.0" prefWidth="630.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="80.0">
<AnchorPane prefHeight="480.0" prefWidth="630.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="300.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="80.0">
<children>
<ScrollPane id="serverDescriptionPane" fitToWidth="true" hbarPolicy="NEVER" pannable="true" AnchorPane.bottomAnchor="20.0" AnchorPane.leftAnchor="20.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="0.0">
<content>
Expand Down
2 changes: 1 addition & 1 deletion runtime/scenes/settings/globalsettings.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<fx:include source="../../components/buttons/exit.fxml" />
</HBox>
</AnchorPane>
<AnchorPane prefHeight="480.0" prefWidth="630.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="80.0">
<AnchorPane prefHeight="480.0" prefWidth="630.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="80.0">
<children>
<ScrollPane id="settingslist" fitToWidth="true" hbarPolicy="NEVER" AnchorPane.bottomAnchor="20.0" AnchorPane.leftAnchor="20.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="0.0">
<VBox spacing="15.0">
Expand Down
5 changes: 1 addition & 4 deletions runtime/scenes/settings/settings.fxml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Hyperlink?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.Slider?>
<?import javafx.scene.control.Tooltip?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.SVGPath?>

<AnchorPane fx:id="layout" prefHeight="560.0" prefWidth="930.0" styleClass="background" stylesheets="@settings.css" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1">
<AnchorPane id="header" prefHeight="80.0" AnchorPane.leftAnchor="300.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
Expand All @@ -23,7 +20,7 @@
</HBox>
</AnchorPane>
<fx:include source="../../components/panels/leftpanel.fxml" />
<AnchorPane prefHeight="480.0" prefWidth="630.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="80.0">
<AnchorPane prefHeight="480.0" prefWidth="630.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="300.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="80.0">
<children>
<ScrollPane id="settingslist" fitToWidth="true" hbarPolicy="NEVER" AnchorPane.bottomAnchor="20.0" AnchorPane.leftAnchor="20.0" AnchorPane.rightAnchor="20.0" AnchorPane.topAnchor="0.0">
<VBox spacing="15.0">
Expand Down
8 changes: 4 additions & 4 deletions runtime/scenes/update/update.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@
<TextArea id="outputUpdate" editable="false" wrapText="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
</children>
</AnchorPane>

<!-- Прогрессбар-->
<ProgressBar id="progress" prefHeight="50.0" progress="0.3" AnchorPane.bottomAnchor="40.0" AnchorPane.leftAnchor="130.0" AnchorPane.rightAnchor="0.0" />
<StackPane id="update-detail" prefHeight="130.0" prefWidth="130.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0">
<children>

<!-- Информация-->
<VBox id="speedOn" alignment="CENTER">
<Label id="speed" alignment="CENTER" maxWidth="1.7976931348623157E308" text="214" textAlignment="CENTER">
Expand All @@ -45,9 +48,6 @@
<Label id="speedErr" alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" styleClass="speedError" text="ERR" visible="false" />
</children>
</StackPane>

<!-- Прогрессбар-->
<ProgressBar id="progress" prefHeight="50.0" progress="0.31" AnchorPane.bottomAnchor="40.0" AnchorPane.leftAnchor="130.0" AnchorPane.rightAnchor="0.0" />
</children>
</AnchorPane>
</AnchorPane>
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ private void getAvailabilityAuth() {
(auth) -> contextHelper.runInFxThread(() -> {
this.auth = auth.list;
authList.setVisible(auth.list.size() != 1);
authList.setManaged(auth.list.size() != 1);
for (GetAvailabilityAuthRequestEvent.AuthAvailability authAvailability : auth.list) {
if (!authAvailability.visible) {
continue;
Expand Down

0 comments on commit e848283

Please sign in to comment.