Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion jabgui/src/main/java/org/jabref/gui/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {
Expand Down
30 changes: 20 additions & 10 deletions jabgui/src/main/java/org/jabref/gui/theme/ThemeManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> stylesheets = scene.getStylesheets();
scene.getStylesheets().clear();
List<String> 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<String> 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
Expand Down
6 changes: 0 additions & 6 deletions jabgui/src/main/resources/org/jabref/gui/Base.css
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,6 @@ TextFlow > .tooltip-text-monospaced {
-fx-padding: 0.5em 1em 0.5em 1em;
}

.dialog-pane .button-bar .button {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for catching the merge dialog issue. I initially created this catch all for other dialogs when font size is large. For example, if we turn font size of 14 and open preferences dialog or the new entry dialog, their sizes are not properly working out anymore...

image image

Copy link
Copy Markdown
Member Author

@HoussemNasri HoussemNasri Sep 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JabRef should be able to resize buttons to show full texts when font size changes but it is more important to have it work using the default font size, we can think of a better solution for that case in parallel.

The issue doesn't happen with the merge dialog only but with any dialog that has long text (more than two words) in button bar .i.e About dialog.

-fx-min-width: 6em;
-fx-pref-width: 6em;
-fx-max-width: 6em;
}

.menu-button > .label {
-fx-padding: 0 8 0 8;
}
Expand Down
Loading