Skip to content

Commit

Permalink
[#27] modified cursor for linkButton
Browse files Browse the repository at this point in the history
  • Loading branch information
vatbub committed Nov 6, 2016
1 parent 7b3b39a commit e90852f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
16 changes: 14 additions & 2 deletions src/main/java/view/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Cursor;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ComboBox;
import javafx.scene.control.ContentDisplay;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.Hyperlink;
import javafx.scene.control.Label;
Expand Down Expand Up @@ -638,6 +638,19 @@ void launchButtonOnDragDetected(MouseEvent event) {
@FXML
void linkButtonOnDragDetected(MouseEvent event) {
appListOnDragDetected(event);
linkButton.setCursor(Cursor.OPEN_HAND);
}

// Handler for ProgressButton[id="linkButton"] onMousePressed
@FXML
void linkButtonOnMousePressed(MouseEvent event) {
linkButton.setCursor(Cursor.CLOSED_HAND);
}

// Handler for ProgressButton[id="linkButton"] onMouseReleased
@FXML
void linkButtonOnMouseReleased(MouseEvent event) {
linkButton.setCursor(Cursor.OPEN_HAND);
}

// Handler for ListView[fx:id="appList"] onDragOver
Expand Down Expand Up @@ -940,7 +953,6 @@ void initialize() {

// add icon to linkButton
linkButton.setGraphic(linkIconView);
linkButton.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);

// Bind the disabled property of the launchButton to the linkButton
linkButton.disableProperty().bind(launchButton.disableProperty());
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
<ProgressButton fx:id="launchButton" defaultButton="true" disable="true" mnemonicParsing="false" onAction="#launchButtonOnAction" onDragDetected="#launchButtonOnDragDetected" text="%okButton.launch" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
</children>
</AnchorPane>
<Button fx:id="linkButton" mnemonicParsing="false" onAction="#linkButtonOnAction" onDragDetected="#linkButtonOnDragDetected" text="Icon" />
<Button fx:id="linkButton" contentDisplay="GRAPHIC_ONLY" mnemonicParsing="false" onAction="#linkButtonOnAction" onDragDetected="#linkButtonOnDragDetected" onMousePressed="#linkButtonOnMousePressed" onMouseReleased="#linkButtonOnMouseReleased" text="Icon">
<cursor>
<Cursor fx:constant="OPEN_HAND" />
</cursor></Button>
<Button fx:id="appInfoButton" disable="true" mnemonicParsing="false" onAction="#appInfoButtonOnAction" text="%appInfo" HBox.hgrow="ALWAYS" />
</children>
</HBox>
Expand Down

0 comments on commit e90852f

Please sign in to comment.