Skip to content

Commit 2c732fc

Browse files
ddamkeddamke
authored andcommitted
add logoicons for dialogs
1 parent f57e47a commit 2c732fc

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

src/main/java/de/doubleslash/keeptime/view/SettingsController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ private void initialize() {
158158

159159
initExportButton();
160160

161+
161162
LOG.debug("saveButton.setOnAction");
162163
saveButton.setOnAction(ae -> {
163164
LOG.info("Save clicked");

src/main/java/de/doubleslash/keeptime/view/ViewController.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ private class Delta {
157157
private ReportController reportController;
158158

159159
private Stage settingsStage;
160+
161+
private Stage confirmCloseStage;
160162
private SettingsController settingsController;
161163

162164
private ProjectsListViewController projectsListViewController;
@@ -186,6 +188,7 @@ private void initialize() {
186188
setProjectListVisible(c);
187189
});
188190

191+
189192
minimizeButton.setOnAction(ae -> mainStage.setIconified(true));
190193
minimizeButton.textFillProperty().bind(fontColorProperty);
191194
closeButton.setOnAction(ae -> openConfirmationWindow());
@@ -322,10 +325,14 @@ private void initialize() {
322325

323326
private void openConfirmationWindow() {
324327
if (model.confirmClose.get()) {
328+
325329
Alert alert = new Alert(Alert.AlertType.CONFIRMATION, "", ButtonType.YES, ButtonType.CANCEL);
326330
alert.setTitle("Confirm exit");
327331
alert.setHeaderText("Are you sure you want to close KeepTime?");
328332

333+
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
334+
stage.getIcons().add(new Image(Resources.getResource(RESOURCE.ICON_MAIN).toString()));
335+
329336
alert.initOwner(mainStage);
330337
alert.showAndWait();
331338

@@ -417,6 +424,8 @@ private void loadSubStages() {
417424
reportStage = new Stage();
418425
reportStage.initModality(Modality.APPLICATION_MODAL);
419426
reportController.setStage(reportStage);
427+
reportStage.getIcons().add(new Image(Resources.getResource(RESOURCE.ICON_MAIN).toString()));
428+
420429
final Scene reportScene = new Scene(root);
421430
reportScene.setOnKeyPressed(ke -> {
422431
if (ke.getCode() == KeyCode.ESCAPE) {
@@ -443,6 +452,7 @@ private void loadSubStages() {
443452
settingsStage.initModality(Modality.APPLICATION_MODAL);
444453
settingsStage.setTitle("Settings");
445454
settingsStage.setResizable(false);
455+
settingsStage.getIcons().add(new Image(Resources.getResource(RESOURCE.ICON_MAIN).toString()));
446456

447457
final Scene settingsScene = new Scene(settingsRoot);
448458
settingsScene.setOnKeyPressed(ke -> {

src/main/resources/layouts/about.fxml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
<?import javafx.scene.layout.HBox?>
2626
<?import javafx.scene.layout.Pane?>
2727
<?import javafx.scene.shape.Line?>
28+
<?import javafx.scene.shape.SVGPath?>
2829
<?import javafx.scene.text.Font?>
2930

30-
<?import javafx.scene.shape.SVGPath?>
31-
<Pane fx:id="mainContainer" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="507.0" prefWidth="509.0" xmlns="http://javafx.com/javafx/8.0.202-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.doubleslash.keeptime.view.AboutController">
31+
<Pane fx:id="mainContainer" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="507.0" prefWidth="509.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.doubleslash.keeptime.view.AboutController">
3232
<children>
3333
<HBox alignment="CENTER_LEFT" layoutX="150.0" layoutY="14.0" spacing="10.0">
3434
<children>
35-
<ImageView fitHeight="101.0" fitWidth="86.0" pickOnBounds="true" preserveRatio="true">
35+
<ImageView fitHeight="54.0" fitWidth="65.0" pickOnBounds="true" preserveRatio="true">
3636
<image>
3737
<Image url="@../icons/icon.png" />
3838
</image>
@@ -71,11 +71,11 @@
7171
<Font name="Open Sans Regular" size="14.0" />
7272
</font>
7373
</Label>
74-
<Button fx:id="reportBugButton" focusTraversable="false" layoutX="396.0" layoutY="237.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="80" text="report" />
74+
<Button fx:id="reportBugButton" focusTraversable="false" layoutX="396.0" layoutY="237.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="80" text="report" />
7575
<Pane layoutX="280" layoutY="227" maxHeight="50.0" maxWidth="135.0" minHeight="50.0" minWidth="50.0" prefHeight="50.0" prefWidth="135.0">
7676
<children>
7777
<Label contentDisplay="CENTER" layoutY="-5.0" maxHeight="60.0" maxWidth="1.7976931348623157E308" minHeight="50.0" minWidth="50.0" prefHeight="60.0" prefWidth="107.0" text="Found a Bug ?" />
78-
<SVGPath fx:id="bugIcon" layoutX="-160.0" layoutY="-231.0" scaleX="0.04" scaleY="0.04" />
78+
<SVGPath fx:id="bugIcon" layoutX="-160.0" layoutY="-231.0" scaleX="0.04" scaleY="0.04" />
7979
</children>
8080
</Pane>
8181
<TableView fx:id="licenseTableView" focusTraversable="false" layoutX="39.0" layoutY="302.0" prefHeight="188.0" prefWidth="437.0" />

0 commit comments

Comments
 (0)