Skip to content

Commit

Permalink
Fix stylesheet resource path for the SimplePopup
Browse files Browse the repository at this point in the history
  • Loading branch information
besidev committed Jul 3, 2024
1 parent 6617aef commit c17902c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public class SimplePopup extends StackPane {
* @param closable a boolean indicating if the popup can be closed by the user
*/
public SimplePopup(String title, Node content, List<Button> buttons, boolean closable) {
getStylesheets().add(getCSSFile());
getStylesheets().add(getClass()
.getResource("/one/jpro/platform/routing/popup/simplepopup/simplepopup.css").toExternalForm());
getStyleClass().add("simple-popup-background");
VBox popupBox = new VBox();
getChildren().add(popupBox);
Expand All @@ -44,10 +45,6 @@ public SimplePopup(String title, Node content, List<Button> buttons, boolean clo
popupBox.getChildren().add(buttonArea);
}

public String getCSSFile() {
return "/one/jpro/routing/popup/simplepopup/simplepopup.css";
}

/**
* Creates the top area of the popup, including the title and optional close button.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
* {
-color-shadow-default: #88888880;
SHADOW_COLOR_DEFAULT: #88888880;
}


.simple-popup-background {
-fx-background-color: #0000001c;
-fx-background-color: #0000001c;
}

.simple-popup-content {
-fx-background-color:white;
-fx-background-radius: 16;
-fx-effect: dropshadow(three-pass-box, -color-shadow-default, 16px, 0.5, 0, 2);
-fx-padding: 24;
-fx-spacing: 32;
-fx-min-width: 400;
-fx-min-height: 400;
-fx-background-color: white;
-fx-background-radius: 16;
-fx-effect: dropshadow(three-pass-box, SHADOW_COLOR_DEFAULT, 16px, 0.5, 0, 2);
-fx-padding: 24;
-fx-spacing: 32;
-fx-min-width: 400;
-fx-min-height: 400;
}

.simple-popup-title {
-fx-font-size: 24;
-fx-font-weight: bold;
-fx-font-size: 24;
-fx-font-weight: bold;
}

.simple-popup-top-area {
-fx-padding: -12 -12 0 -12;
-fx-padding: -12 -12 0 -12;
}

.simple-popup-close-button {
-fx-background-color: #00000000;
-fx-background-radius: 16;
-fx-padding: 4;
-fx-background-color: #00000000;
-fx-background-radius: 16;
-fx-padding: 4;
}

.simple-popup-close-button .ikonli-font-icon {
-fx-icon-size: 28;
-fx-icon-size: 28;
}

.simple-popup-close-button:hover {
-fx-background-color: #00000022;
-fx-background-color: #00000022;
}

.simple-popup-button-area {
Expand All @@ -43,5 +45,5 @@
}

.simple-popup-text {
-fx-font-size: 16;
-fx-font-size: 16;
}

0 comments on commit c17902c

Please sign in to comment.