diff --git a/src/org/jetuml/JetUML.css b/src/org/jetuml/JetUML.css index 30faa13e..8c407a6d 100644 --- a/src/org/jetuml/JetUML.css +++ b/src/org/jetuml/JetUML.css @@ -31,3 +31,10 @@ -fx-alignment: center; -fx-padding: 0 0 10px 0; } + +.tip-menu +{ + -fx-background-color: gainsboro; + -fx-border-color: darkgrey; + -fx-border-style: solid; +} \ No newline at end of file diff --git a/src/org/jetuml/JetUML.java b/src/org/jetuml/JetUML.java index 0bae4fe0..af8e1ae8 100644 --- a/src/org/jetuml/JetUML.java +++ b/src/org/jetuml/JetUML.java @@ -102,6 +102,7 @@ public void start(Stage pStage) throws Exception } DialogStage dialogStage = new DialogStage(pStage); + dialogStage.getScene().getStylesheets().add(getClass().getResource("JetUML.css").toExternalForm()); EditorFrame editor = new EditorFrame(pStage, dialogStage); diagramToOpen.ifPresent(diagram -> editor.setOpenFileAsDiagram(fileToOpen.get(), diagram)); pStage.setScene(new Scene(editor)); @@ -109,7 +110,6 @@ public void start(Stage pStage) throws Exception NotificationService.instance().setMainStage(pStage); pStage.getScene().getStylesheets().add(getClass().getResource("JetUML.css").toExternalForm()); - pStage.setOnCloseRequest(pWindowEvent -> { pWindowEvent.consume(); diff --git a/src/org/jetuml/gui/DarkMode.css b/src/org/jetuml/gui/DarkMode.css index faed8cc2..4e16d6fd 100644 --- a/src/org/jetuml/gui/DarkMode.css +++ b/src/org/jetuml/gui/DarkMode.css @@ -1,4 +1,5 @@ -.root { +.root +{ -fx-accent: #1e74c6; -fx-focus-color: -fx-accent; -fx-base: #1b1f21; @@ -6,70 +7,29 @@ -fx-control-inner-background-alt: -fx-control-inner-background ; } -.label{ +.label +{ -fx-text-fill: lightgray; } -.text-field { - -fx-prompt-text-fill: gray; -} - -.titulo{ - -fx-font-weight: bold; - -fx-font-size: 18px; -} - -.button{ - -fx-focus-traversable: false; -} - -.button:hover{ - -fx-text-fill: white; -} - -.separator *.line { +.separator .line +{ -fx-background-color: #3C3C3C; -fx-border-style: solid; -fx-border-width: 1px; } -.scroll-bar{ - -fx-background-color: derive(-fx-base,45%) -} - -.button:default { - -fx-base: -fx-accent ; -} - -.table-view{ - /*-fx-background-color: derive(-fx-base, 10%);*/ - -fx-selection-bar-non-focused: derive(-fx-base, 50%); -} - -.table-view .column-header .label{ - -fx-alignment: CENTER_LEFT; - -fx-font-weight: none; -} - -.list-cell:even, -.list-cell:odd, -.table-row-cell:even, -.table-row-cell:odd{ - -fx-control-inner-background: derive(-fx-base, 15%); -} - -.list-cell:empty, -.table-row-cell:empty { - -fx-background-color: transparent; +.scroll-bar +{ + -fx-background-color: derive(-fx-base, 45%) } -.list-cell, -.table-row-cell{ - -fx-border-color: transparent; - -fx-table-cell-border-color:transparent; +.button:default +{ + -fx-base: darkgray; + -fx-text-fill: lightgray; } - .welcome-tab-panel { -fx-padding: 20px; @@ -93,12 +53,18 @@ .welcome-tab-panel .button:hover { - -fx-text-fill: black; - -fx-font-size: 17pt; + -fx-text-fill: gray; } .welcome-tab-footer { -fx-alignment: center; -fx-padding: 0 0 10px 0; +} + +.tip-menu +{ + -fx-background-color: -fx-base; + -fx-border-color: black; + -fx-border-style: solid; } \ No newline at end of file diff --git a/src/org/jetuml/gui/tips/TipDialog.java b/src/org/jetuml/gui/tips/TipDialog.java index feb218e5..70395e26 100644 --- a/src/org/jetuml/gui/tips/TipDialog.java +++ b/src/org/jetuml/gui/tips/TipDialog.java @@ -71,9 +71,9 @@ public class TipDialog private static final double TITLE_FONT_SIZE = 23; private static final double TEXT_FONT_SIZE = 13.5; private static final double TEXT_LINE_SPACING = 2; + private static final double TEXT_WIDTH = 570; + private static final Insets IMAGE_PADDING = new Insets(25, 0, 25, 0); private static final double DEFAULT_NODE_SPACING = 10; - private static final String NEXT_TIP_BUTTON_STYLE = "next-tip-button"; - private static final String BUTTON_STYLE = "tip-menu-button"; private Stage aStage; private Tip aCurrentTip; @@ -89,13 +89,13 @@ public class TipDialog */ public TipDialog(Stage pDialogStage) { + aStage = pDialogStage; aTipDisplay = new ScrollPane(); aViewedTips = new ViewedTips(getUserPrefNextTipId()); aShowTipsOnStartupCheckBox = new CheckBox(RESOURCES.getString("dialog.tips.checkbox.text")); aShowTipsOnStartupCheckBox.setSelected(UserPreferences.instance().getBoolean(UserPreferences.BooleanPreference.showTips)); aShowTipsOnStartupCheckBox.setOnAction(e -> UserPreferences.instance().setBoolean(UserPreferences.BooleanPreference.showTips, aShowTipsOnStartupCheckBox.isSelected())); - aStage = pDialogStage; } /** @@ -110,25 +110,19 @@ public void show() private void prepareStage() { - //aStage.setResizable(true); -// aStage.setMinWidth(WINDOW_MIN_WIDTH); -// aStage.setWidth(WINDOW_PREF_WIDTH); -// aStage.setMinHeight(WINDOW_MIN_HEIGHT); -// aStage.setHeight(WINDOW_PREF_HEIGHT); aStage.setTitle(RESOURCES.getString("dialog.tips.title")); aStage.getIcons().add(new Image(RESOURCES.getString("application.icon"))); - aStage.getScene().setRoot(createScene()); - //aStage.getScene().getStylesheets().add(getClass().getResource("TipDialog.css").toExternalForm()); + aStage.getScene().setRoot(createRoot()); aTipDisplay.requestFocus(); } - private Pane createScene() + private Pane createRoot() { BorderPane layout = new BorderPane(); //Removing the focus highlight on the ScrollPane aTipDisplay.setStyle("-fx-background-color: -fx-outer-border, -fx-inner-border, -fx-body-color;" + - "-fx-background-insets: 0, 1, 2;"); + "-fx-background-insets: 0, 1;"); aTipDisplay.setFitToWidth(true); layout.setCenter(aTipDisplay); @@ -140,13 +134,10 @@ private Pane createScene() setUserPrefNextTip(aViewedTips.getNewNextTipOfTheDayId()); setupNewTip(tip); - aStage.requestFocus(); - layout.setMinWidth(WINDOW_MIN_WIDTH); - //layout.setWidth(WINDOW_PREF_WIDTH); + layout.setMaxWidth(WINDOW_PREF_WIDTH); layout.setMinHeight(WINDOW_MIN_HEIGHT); - //layout.setHeight(WINDOW_PREF_HEIGHT); - //Scene tipDialogScene = new Scene(layout, WINDOW_PREF_WIDTH, WINDOW_PREF_HEIGHT); + layout.setMaxHeight(WINDOW_PREF_HEIGHT); return layout; } @@ -167,24 +158,17 @@ private static HBox createEmptyTipMenu() { HBox tipMenu = new HBox(); tipMenu.setPadding(new Insets(PADDING)); - //tipMenu.setStyle("-fx-background-color: slategrey;"); - - BorderStroke bs = new BorderStroke(Color.DARKGRAY, BorderStrokeStyle.SOLID, - CornerRadii.EMPTY, BorderWidths.DEFAULT); - tipMenu.setBorder(new Border(bs)); + tipMenu.getStyleClass().add("tip-menu"); return tipMenu; } private HBox createTipMenuButtons() { Button nextTipButton = new Button(RESOURCES.getString("dialog.tips.button.next.text")); - nextTipButton.getStyleClass().add(NEXT_TIP_BUTTON_STYLE); - + Button previousTipButton = new Button(RESOURCES.getString("dialog.tips.button.previous.text")); - previousTipButton.getStyleClass().add(BUTTON_STYLE); Button closeButton = new Button(RESOURCES.getString("dialog.tips.button.close.text")); - closeButton.getStyleClass().add(BUTTON_STYLE); nextTipButton.setOnAction(e -> { @@ -250,8 +234,6 @@ private VBox getTipAsVBox(Tip pTip) tipVBox.getChildren().add(node); } - //tipVBox.setAlignment(Pos.CENTER); - return tipVBox; } @@ -312,14 +294,11 @@ private Label getTextTipElementAsTextNode(TipElement pTipElement) String text = pTipElement.getContent(); Label textNode = new Label(text); textNode.setWrapText(true); - textNode.setPrefWidth(570); - //textNode.wrappingWidthProperty().bind(aTipDisplay.widthProperty().subtract(2 * PADDING + 4 * DEFAULT_NODE_SPACING)); - // two times the padding because of the VBox padding, and a bit extra to make up for - // other default spacing added between nodes + textNode.setPrefWidth(TEXT_WIDTH); Font textFont = new Font(TEXT_FONT_SIZE); textNode.setFont(textFont); - //textNode.setLineSpacing(TEXT_LINE_SPACING); + textNode.setLineSpacing(TEXT_LINE_SPACING); return textNode; } @@ -349,7 +328,7 @@ private static HBox getImageTipElementAsImageView(TipElement pTipElement) } HBox imageContainer = new HBox(imageNode); imageContainer.setAlignment(Pos.CENTER); - VBox.setMargin(imageContainer, new Insets(30, 0, 0, 0)); + VBox.setMargin(imageContainer, IMAGE_PADDING); return imageContainer; //return imageNode; }