Skip to content

Commit 935ba78

Browse files
committed
Update font in dialog windows and other minor changes
1 parent 7289124 commit 935ba78

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/main/java/com/github/introfog/gitwave/controller/ExploreController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private void setUpAndFillTable() {
9595

9696
anchor.widthProperty().addListener((obs, oldVal, newVal) -> {
9797
double width = (newVal.doubleValue() - removeTableColumn.getWidth() - 4) * 0.5;
98-
// TODO there is a bug that when user change column width manually, and after that resize window, it automatically reset user changes
98+
// TODO MINOR there is a bug that when user change column width manually, and after that resize window, it automatically reset user changes
9999
commandTableColumn.setPrefWidth(width);
100100
descriptionTableColumn.setPrefWidth(width);
101101
});

src/main/java/com/github/introfog/gitwave/model/DialogFactory.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ private DialogFactory() {
2828
}
2929

3030
public static void createErrorAlert(String header, String msg) {
31-
// TODO don't forget to update design also for dialog windows
3231
Alert alert = new Alert(AlertType.ERROR);
3332
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
3433
stage.getIcons().add(new Image(StageFactory.class.getResourceAsStream(AppConstants.PATH_TO_LOGO)));
3534
alert.setTitle("GitWave error");
3635
alert.setHeaderText(header);
3736
alert.setContentText(msg);
37+
alert.getDialogPane().setStyle("-fx-font-family: verdana; -fx-font-size: 12");
3838
alert.showAndWait();
3939
}
4040

@@ -46,6 +46,7 @@ public static void createCloseConfirmationAlert(Stage primaryStage) {
4646
confirmationDialog.setHeaderText("Do you really want to close the application?");
4747
confirmationDialog.getButtonTypes().setAll(ButtonType.OK, ButtonType.CANCEL);
4848

49+
confirmationDialog.getDialogPane().setStyle("-fx-font-family: verdana; -fx-font-size: 12");
4950
confirmationDialog.showAndWait().ifPresent(response -> {
5051
if (response == ButtonType.OK) {
5152
primaryStage.close();
@@ -61,6 +62,7 @@ public static ButtonType createSaveOrUpdateAlert() {
6162
confirmationDialog.setHeaderText("Do you want to save command as a new instance?\nSelect 'No' if update existed.");
6263
confirmationDialog.getButtonTypes().setAll(ButtonType.YES, ButtonType.NO, ButtonType.CANCEL);
6364

65+
confirmationDialog.getDialogPane().setStyle("-fx-font-family: verdana; -fx-font-size: 12");
6466
ButtonType[] pressedButton = {null};
6567
confirmationDialog.showAndWait().ifPresent(response -> pressedButton[0] = response);
6668
return pressedButton[0];

src/main/java/com/github/introfog/gitwave/model/StageFactory.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,13 @@ public static FxmlStageHolder createModalExploreWindow() {
3939
FxmlStageHolder holder = StageFactory.createModalStage("view/explorer.fxml", "Command explorer");
4040
holder.getStage().setMinWidth(400);
4141
holder.getStage().setMinHeight(200);
42-
holder.getStage().setResizable(true);
4342
return holder;
4443
}
4544

4645
public static FxmlStageHolder createModalSettingsWindow() {
4746
FxmlStageHolder holder = StageFactory.createModalStage("view/settings.fxml", "Settings");
4847
holder.getStage().setMinWidth(500);
4948
holder.getStage().setMinHeight(240);
50-
holder.getStage().setResizable(true);
5149
return holder;
5250
}
5351

@@ -57,20 +55,19 @@ public static FxmlStageHolder createModalAboutWindow() {
5755
return holder;
5856
}
5957

60-
public static FxmlStageHolder createModalStage(String fxmlPath, String title) {
61-
Stage modalStage = new Stage();
62-
modalStage.initModality(Modality.APPLICATION_MODAL);
63-
return creteStage(fxmlPath, title, modalStage);
64-
}
65-
6658
public static FxmlStageHolder createPrimaryExecuteWindow(Stage stage) {
6759
final FxmlStageHolder holder = creteStage("view/executor.fxml", "GitWave", stage);
6860
holder.getStage().setMinWidth(400);
6961
holder.getStage().setMinHeight(340);
70-
holder.getStage().setResizable(true);
7162
return holder;
7263
}
7364

65+
private static FxmlStageHolder createModalStage(String fxmlPath, String title) {
66+
Stage modalStage = new Stage();
67+
modalStage.initModality(Modality.APPLICATION_MODAL);
68+
return creteStage(fxmlPath, title, modalStage);
69+
}
70+
7471
private static FxmlStageHolder creteStage(String fxmlPath, String title, Stage stage) {
7572
FXMLLoader fxmlLoader = new FXMLLoader(GitWaveLauncher.class.getResource(fxmlPath));
7673
Scene scene;
@@ -84,8 +81,7 @@ private static FxmlStageHolder creteStage(String fxmlPath, String title, Stage s
8481

8582
stage.setTitle(title);
8683
stage.setScene(scene);
87-
// TODO make design flexible and allow resizing
88-
stage.setResizable(false);
84+
stage.setResizable(true);
8985
stage.getIcons().add(new Image(StageFactory.class.getResourceAsStream(AppConstants.PATH_TO_LOGO)));
9086
BaseController controller = fxmlLoader.getController();
9187
final FxmlStageHolder fxmlStageHolder = new FxmlStageHolder(stage, fxmlLoader, scene);

src/main/resources/com/github/introfog/gitwave/view/executor.fxml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<?import javafx.scene.control.Menu?>
77
<?import javafx.scene.control.MenuBar?>
88
<?import javafx.scene.control.MenuItem?>
9+
<?import javafx.scene.control.Separator?>
910
<?import javafx.scene.control.SeparatorMenuItem?>
1011
<?import javafx.scene.control.Tab?>
1112
<?import javafx.scene.control.TabPane?>
@@ -38,7 +39,7 @@
3839
</Menu>
3940
</menus>
4041
</MenuBar>
41-
<TabPane prefHeight="204.0" prefWidth="450.0" style="-fx-border-color: black; -fx-border-style: solid none; -fx-border-width: 2;" tabClosingPolicy="UNAVAILABLE" tabMinWidth="100.0" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS">
42+
<TabPane prefHeight="204.0" prefWidth="450.0" tabClosingPolicy="UNAVAILABLE" tabMinWidth="100.0" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1" GridPane.vgrow="ALWAYS">
4243
<tabs>
4344
<Tab text="1. Directory">
4445
<content>
@@ -113,6 +114,7 @@
113114
<font>
114115
<Font name="Verdana" size="12.0" />
115116
</font></Hyperlink>
117+
<Separator layoutY="17.0" prefWidth="200.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
116118
</children>
117119
</AnchorPane>
118120
</children>

0 commit comments

Comments
 (0)