diff --git a/CHANGELOG.md b/CHANGELOG.md index be389cfec4d..9924f0ca9b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -145,6 +145,8 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We fixed an issue where hierarchical keywords would only show the parent keyword in the entry editor. [#11390](https://github.com/JabRef/jabref/issues/11390) - We fixed an issue where some file choosers regarding LaTeX-aux files did not open in the directory of the last selected file. [#13861](https://github.com/JabRef/jabref/pull/13861) - We fixed an issue where the LaTeX file directory was not stored correctly in combination with the usage of groups from aux files. [#8344](https://github.com/JabRef/jabref/issues/8344) +- We prevented a brief flash of the default JavaFX (Modena) theme on startup. [#13877](https://github.com/JabRef/jabref/pull/13877) +- We fixed an issue where button-bar buttons truncated long text with ellipsis. [#13877](https://github.com/JabRef/jabref/pull/13877) - We fixed an issue where ignoring of subdirectories via `.gitingore` patterns did not work in the "Find unlinked files dialog". [forum#5425](https://discourse.jabref.org/t/set-list-of-ignored-folders-paths/5425/6) ### Removed diff --git a/jabgui/src/main/java/org/jabref/gui/JabRefGUI.java b/jabgui/src/main/java/org/jabref/gui/JabRefGUI.java index dd5f3f4be1b..b96f08b6f30 100644 --- a/jabgui/src/main/java/org/jabref/gui/JabRefGUI.java +++ b/jabgui/src/main/java/org/jabref/gui/JabRefGUI.java @@ -292,7 +292,7 @@ private void openWindow() { Scene scene = new Scene(JabRefGUI.mainFrame); LOGGER.debug("installing CSS"); - themeManager.installCss(scene); + themeManager.installCssImmediately(scene); LOGGER.debug("Handle TextEditor key bindings"); scene.addEventFilter(KeyEvent.KEY_PRESSED, event -> { diff --git a/jabgui/src/main/java/org/jabref/gui/theme/ThemeManager.java b/jabgui/src/main/java/org/jabref/gui/theme/ThemeManager.java index 37c14da1b13..cd8cde0aefb 100644 --- a/jabgui/src/main/java/org/jabref/gui/theme/ThemeManager.java +++ b/jabgui/src/main/java/org/jabref/gui/theme/ThemeManager.java @@ -105,19 +105,29 @@ public ThemeManager(@NonNull WorkspacePreferences workspacePreferences, } } - /// Installs the base and additional css files as stylesheets in the given scene. + /// Installs the base and additional CSS files as stylesheets in the given scene. + /// + /// This method is primarily intended to be called by `JabRefGUI` during startup. + /// Using `installCss` directly would cause a delay in theme application, resulting + /// in a brief flash of the default JavaFX theme (Modena CSS) before the intended theme appears. + public void installCssImmediately(Scene scene) { + List stylesheets = scene.getStylesheets(); + scene.getStylesheets().clear(); + List baseOrThemeStylesheet = Stream + .of(baseStyleSheet.getSceneStylesheet(), + theme.getAdditionalStylesheet().map(StyleSheet::getSceneStylesheet).orElse(null) + ).filter(Objects::nonNull) + .map(URL::toExternalForm) + .toList(); + + stylesheets.addAll(baseOrThemeStylesheet); + } + + /// Registers a runnable on JavaFX thread to install the base and additional css files as stylesheets in the given scene. public void installCss(@NonNull Scene scene) { // Because of race condition in JavaFX, IndexOutOfBounds will be thrown, despite // all the invocation to this method come directly from the UI thread - UiTaskExecutor.runInJavaFXThread(() -> { - List stylesheets = Stream - .of(baseStyleSheet.getSceneStylesheet(), - theme.getAdditionalStylesheet().map(StyleSheet::getSceneStylesheet).orElse(null) - ).filter(Objects::nonNull) - .map(URL::toExternalForm) - .toList(); - scene.getStylesheets().setAll(stylesheets); - }); + UiTaskExecutor.runInJavaFXThread(() -> installCssImmediately(scene)); } /// Installs the css file as a stylesheet in the given web engine. Changes in the diff --git a/jabgui/src/main/resources/org/jabref/gui/Base.css b/jabgui/src/main/resources/org/jabref/gui/Base.css index cdb132504ad..3af664e07bc 100644 --- a/jabgui/src/main/resources/org/jabref/gui/Base.css +++ b/jabgui/src/main/resources/org/jabref/gui/Base.css @@ -414,12 +414,6 @@ TextFlow > .tooltip-text-monospaced { -fx-padding: 0.5em 1em 0.5em 1em; } -.dialog-pane .button-bar .button { - -fx-min-width: 6em; - -fx-pref-width: 6em; - -fx-max-width: 6em; -} - .menu-button > .label { -fx-padding: 0 8 0 8; }