Skip to content

Commit

Permalink
Update BusyIndicator style selector and focus handling
Browse files Browse the repository at this point in the history
Changed the CSS style class of BusyIndicator from "busy-indicator" to "dialog-pane-busy-indicator" to better reflect its context. A condition has been added in focusListener to confirm if the oldOwner is inside DialogPane before requesting focus, preventing potential focus issues.
  • Loading branch information
dlemmermann committed Feb 12, 2024
1 parent c7172e3 commit 8c6ab5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gemsfx/src/main/java/com/dlsc/gemsfx/DialogPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ private class ContentPane extends StackPane {

private final ChangeListener<Node> focusListener = (o, oldOwner, newOwner) -> {
if (newOwner != null && !isInsideDialogPane(newOwner.getParent()) && getScene() != null) {
if (oldOwner != null) {
if (oldOwner != null && isInsideDialogPane(oldOwner.getParent())) {
oldOwner.requestFocus();
} else {
requestFocus();
Expand Down Expand Up @@ -1057,7 +1057,7 @@ protected Button createButton(ButtonType buttonType) {
private class BusyIndicator extends CircularProgressIndicator {

public BusyIndicator() {
getStyleClass().add("busy-indicator");
getStyleClass().add("dialog-pane-busy-indicator");
}

public void stop() {
Expand Down
2 changes: 1 addition & 1 deletion gemsfx/src/main/resources/com/dlsc/gemsfx/dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
* BusyIndicator
*/

.dialog-pane .busy-indicator {
.dialog-pane > * > * > * > .dialog-pane-busy-indicator {
-size: 100px;
-fx-pref-width: -size;
-fx-pref-height: -size;
Expand Down

0 comments on commit 8c6ab5c

Please sign in to comment.