Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Conflicts:
	pom.xml
	src/main/resources/floatyfield/floaty-field.fxml
  • Loading branch information
Andy Till committed Dec 23, 2014
2 parents c213877 + c52f62b commit 0048c66
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
File renamed without changes.
27 changes: 27 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,31 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<name>floaty-field</name>
<url>https://github.com/andytill/floaty-field</url>
<description>Super nice, labelled text field for your forms.</description>
<developers>
<developer>
<id>andytill</id>
<name>Andy Till</name>
<email>[email protected]</email>
<url>http://andrewtill.blogspot.co.uk/</url>
</developer>
</developers>
<licenses>
<license>
<name>The MIT License</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<issueManagement>
<url>https://github.com/andytill/floaty-field/issues</url>
<system>github</system>
</issueManagement>
<scm>
<developerConnection>andytill</developerConnection>
<connection>https://github.com/andytill/floaty-field</connection>
<url>https://github.com/andytill/floaty-field.git</url>
</scm>
</project>
4 changes: 4 additions & 0 deletions src/main/java/floatyfield/FloatyFieldView.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public void initialize(URL url, ResourceBundle r) {
label.setVisible(false);
label.visibleProperty().bind(labelActive);
label.textProperty().bind(field.promptTextProperty());
label.setLabelFor(field);

// make sure that any click within this control will give focus to the input field
field.getParent().setOnMouseClicked((e) -> { field.requestFocus(); });
}

public final StringProperty promptTextProperty() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/floatyfield/floaty-field.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

<VBox prefHeight="-1.0" prefWidth="-1.0" xmlns:fx="http://javafx.com/fxml" fx:controller="floatyfield.FloatyFieldView">
<children>
<Label fx:id="label" styleClass="floaty-field-inactive" text="Label">
<Label fx:id="label" maxWidth="1.7976931348623157E308" styleClass="floaty-field-inactive" text="Label">
<font>
<Font name="System Bold" size="10.0" />
</font>
<VBox.margin>
<Insets />
</VBox.margin>
</Label>
<TextField fx:id="field" alignment="TOP_LEFT" maxHeight="-1.0" prefWidth="-1.0" promptText="JHKJKHKJHJK" style="-fx-padding:0px;" styleClass="floaty-field, no-border" text="">
<TextField fx:id="field" alignment="TOP_LEFT" maxHeight="-1.0" maxWidth="1.7976931348623157E308" prefWidth="-1.0" promptText="Field" style="-fx-padding:0px;" styleClass="floaty-field, no-border" text="">
</TextField>
</children>
</VBox>

0 comments on commit 0048c66

Please sign in to comment.