Skip to content

Commit

Permalink
Explicitly pass CSS stylesheets to dialogs
Browse files Browse the repository at this point in the history
This ensures that dialog panes are correctly styled in accordance
with whatever stylesheet the chooser is using.

Fix: #4
  • Loading branch information
io7m committed Mar 28, 2020
1 parent 9e694ab commit 25741c6
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion com.io7m.jwheatsheaf.api/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.jwheatsheaf</artifactId>
<groupId>com.io7m.jwheatsheaf</groupId>
<version>1.0.1</version>
<version>1.0.2-SNAPSHOT</version>
</parent>

<artifactId>com.io7m.jwheatsheaf.api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jwheatsheaf.documentation/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.jwheatsheaf</artifactId>
<groupId>com.io7m.jwheatsheaf</groupId>
<version>1.0.1</version>
<version>1.0.2-SNAPSHOT</version>
</parent>

<artifactId>com.io7m.jwheatsheaf.documentation</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jwheatsheaf.examples/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.jwheatsheaf</artifactId>
<groupId>com.io7m.jwheatsheaf</groupId>
<version>1.0.1</version>
<version>1.0.2-SNAPSHOT</version>
</parent>

<artifactId>com.io7m.jwheatsheaf.examples</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jwheatsheaf.oxygen/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.jwheatsheaf</artifactId>
<groupId>com.io7m.jwheatsheaf</groupId>
<version>1.0.1</version>
<version>1.0.2-SNAPSHOT</version>
</parent>

<artifactId>com.io7m.jwheatsheaf.oxygen</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jwheatsheaf.tests/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.jwheatsheaf</artifactId>
<groupId>com.io7m.jwheatsheaf</groupId>
<version>1.0.1</version>
<version>1.0.2-SNAPSHOT</version>
</parent>

<artifactId>com.io7m.jwheatsheaf.tests</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.jwheatsheaf.ui/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.jwheatsheaf</artifactId>
<groupId>com.io7m.jwheatsheaf</groupId>
<version>1.0.1</version>
<version>1.0.2-SNAPSHOT</version>
</parent>

<artifactId>com.io7m.jwheatsheaf.ui</artifactId>
Expand Down
Expand Up @@ -449,6 +449,13 @@ private void onSelectDirectButton()
dialog.setTitle(this.choosers.strings().enterPathTitle());
dialog.setHeaderText(null);
dialog.setContentText(this.choosers.strings().enterPath());

this.configuration.cssStylesheet().ifPresent(css -> {
dialog.getDialogPane()
.getStylesheets()
.add(css.toExternalForm());
});

final var nameOpt = dialog.showAndWait();
if (nameOpt.isPresent()) {
final var name = nameOpt.get();
Expand Down Expand Up @@ -477,6 +484,13 @@ private void onCreateDirectoryButton()
dialog.setTitle(this.choosers.strings().createDirectoryTitle());
dialog.setHeaderText(null);
dialog.setContentText(this.choosers.strings().enterDirectoryName());

this.configuration.cssStylesheet().ifPresent(css -> {
dialog.getDialogPane()
.getStylesheets()
.add(css.toExternalForm());
});

final var nameOpt = dialog.showAndWait();
if (nameOpt.isPresent()) {
final var name = nameOpt.get();
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -15,7 +15,7 @@

<groupId>com.io7m.jwheatsheaf</groupId>
<artifactId>com.io7m.jwheatsheaf</artifactId>
<version>1.0.1</version>
<version>1.0.2-SNAPSHOT</version>
<packaging>pom</packaging>

<name>com.io7m.jwheatsheaf</name>
Expand Down

0 comments on commit 25741c6

Please sign in to comment.