Added #ids for menu items + re-set 'SubMenuStyleSheet' + improved fxml.model

This commit is contained in:
xdrm-brackets 2017-12-12 09:21:44 +01:00
parent 2e78af3d52
commit 0334cd85d5
3 changed files with 24 additions and 24 deletions

View File

@ -13,14 +13,14 @@ public class ContextBuilder{
/* (2) Base layout dimension */
Context.bind("header-height", 50);
Context.bind("menu-width", 237);
Context.bind("submenu-width", 166);
Context.bind("submenu-width", 2);
Context.bind("article-width", 800);
Context.bind("article-height", 96);
/* (3) Colors */
Context.bind("main-color", 63, 81, 181);
Context.bind("menu-bg", 255, 255, 253);
Context.bind("submenu-bg", 250, 250, 250);
Context.bind("submenu-bg", 244, 244, 244);
}

View File

@ -10,22 +10,22 @@ public class SubMenuStyleSheet{
public SubMenuStyleSheet(Node target) throws Exception{
/* (1) Set rules */
// Ruleset.load(target)
// .add("top", Context.getInt("header-height"))
// .add("left", Context.getInt("menu-width")-3)
// .add("bottom", 0)
//
// .add("min-width", Context.getInt("submenu-width"))
// .add("max-width", Context.getInt("submenu-width"))
//
// .add("min-height", Context.getInt("screen-height") - Context.getInt("header-height"))
// .add("max-height", Context.getInt("screen-height") - Context.getInt("header-height"))
//
// .add("pref-width", Context.getInt("submenu-width"))
// .add("pref-height", Context.getInt("screen-height") - Context.getInt("header-height"))
Ruleset.load(target)
.add("top", Context.getInt("header-height"))
.add("left", Context.getInt("menu-width")-3)
.add("bottom", 0)
.add("min-width", Context.getInt("submenu-width"))
.add("max-width", Context.getInt("submenu-width"))
.add("min-height", Context.getInt("screen-height") - Context.getInt("header-height"))
.add("max-height", Context.getInt("screen-height") - Context.getInt("header-height"))
// .add("background-color", Context.getString("submenu-bg"))
// .apply();
.add("pref-width", Context.getInt("submenu-width"))
.add("pref-height", Context.getInt("screen-height") - Context.getInt("header-height"))
.add("background-color", Context.getString("submenu-bg"))
.apply();
}
}

View File

@ -32,7 +32,7 @@
</children></Pane>
<VBox id="menu" fx:id="menu" layoutX="50.0" layoutY="40.0" prefHeight="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="50.0">
<children>
<FlowPane alignment="CENTER_LEFT" prefHeight="114.0" prefWidth="234.0" style="-fx-border-width: 0 0 1 0; -fx-border-color: #eeeeee;">
<FlowPane id="profile" alignment="CENTER_LEFT" prefHeight="114.0" prefWidth="234.0" style="-fx-border-width: 0 0 1 0; -fx-border-color: #eeeeee;">
<children>
<ImageView fitHeight="57.0" fitWidth="56.0" pickOnBounds="true" preserveRatio="true">
<image>
@ -57,7 +57,7 @@
</Pane>
</children>
</FlowPane>
<FlowPane alignment="CENTER" columnHalignment="CENTER" layoutX="10.0" layoutY="124.0" prefHeight="58.0" prefWidth="234.0" styleClass="menu_item">
<FlowPane id="dictionary" alignment="CENTER" columnHalignment="CENTER" layoutX="10.0" layoutY="124.0" prefHeight="58.0" prefWidth="234.0" styleClass="menu_item">
<children>
<ImageView fitHeight="20.0" fitWidth="20.0" pickOnBounds="true" preserveRatio="true">
<FlowPane.margin>
@ -70,7 +70,7 @@
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Dictionnaire" />
</children>
</FlowPane>
<FlowPane alignment="CENTER" columnHalignment="CENTER" layoutX="10.0" layoutY="182.0" prefHeight="58.0" prefWidth="234.0" styleClass="menu_item">
<FlowPane id="exercises" alignment="CENTER" columnHalignment="CENTER" layoutX="10.0" layoutY="182.0" prefHeight="58.0" prefWidth="234.0" styleClass="menu_item">
<children>
<ImageView fitHeight="20.0" fitWidth="20.0" pickOnBounds="true" preserveRatio="true">
<FlowPane.margin>
@ -83,7 +83,7 @@
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Excercices" />
</children>
</FlowPane>
<FlowPane alignment="CENTER" columnHalignment="CENTER" layoutX="10.0" layoutY="240.0" prefHeight="58.0" prefWidth="234.0" styleClass="menu_item">
<FlowPane id="translator" alignment="CENTER" columnHalignment="CENTER" layoutX="10.0" layoutY="240.0" prefHeight="58.0" prefWidth="234.0" styleClass="menu_item">
<children>
<ImageView fitHeight="20.0" fitWidth="20.0" pickOnBounds="true" preserveRatio="true">
<FlowPane.margin>
@ -96,7 +96,7 @@
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Traducteur" />
</children>
</FlowPane>
<FlowPane alignment="CENTER" columnHalignment="CENTER" layoutX="10.0" layoutY="240.0" prefHeight="58.0" prefWidth="234.0" styleClass="menu_item">
<FlowPane id="magazines" alignment="CENTER" columnHalignment="CENTER" layoutX="10.0" layoutY="240.0" prefHeight="58.0" prefWidth="234.0" styleClass="menu_item">
<children>
<ImageView fitHeight="20.0" fitWidth="20.0" pickOnBounds="true" preserveRatio="true">
<FlowPane.margin>
@ -113,7 +113,7 @@
</VBox>
</children>
</AnchorPane>
<VBox id="submenu" fx:id="submenu" layoutX="234.0" layoutY="50.0" prefHeight="650.0" prefWidth="166.0" style="-fx-background-color: white;" AnchorPane.bottomAnchor="0.0" AnchorPane.topAnchor="50.0">
<VBox id="submenu" fx:id="submenu" layoutX="234.0" layoutY="50.0" prefHeight="650.0" prefWidth="166.0" style="-fx-background-color: #F3F3F3;" AnchorPane.bottomAnchor="0.0" AnchorPane.topAnchor="50.0">
<children>
<FlowPane alignment="CENTER_RIGHT" columnHalignment="CENTER" prefHeight="35.0" prefWidth="234.0" styleClass="menu_item">
<children>
@ -308,7 +308,7 @@
</VBox.margin>
</FlowPane>
</children></VBox>
<ScrollPane hbarPolicy="NEVER" prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="400.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="50.0">
<ScrollPane hbarPolicy="NEVER" pickOnBounds="false" prefHeight="200.0" prefWidth="200.0" style="-fx-background-color: transparent;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="400.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="50.0">
<content>
<FlowPane id="container" fx:id="container" alignment="TOP_CENTER" columnHalignment="CENTER" prefHeight="650.0" prefWidth="880.0" prefWrapLength="1000.0">
<children>