Skip to content

Commit

Permalink
Dark mode fixes
Browse files Browse the repository at this point in the history
Edited dark theme scrollbar fix to dark.css to overwrite color -jr-scrollbar-thumb and -jr-scrollbar-track in dark.css. Switched base theme background for group selection number highlight back to green. Added dark theme to OO/Libreoffice style selection pane.

fixes #5646
  • Loading branch information
ageofadz committed Nov 21, 2019
1 parent 5376dcf commit b812b62
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an exception which occurred when an invalid jstyle was loaded. [#5452](https://github.com/JabRef/jabref/issues/5452)
- We fixed an error where the preview theme did not adapt to the "Dark" mode [#5463](https://github.com/JabRef/jabref/issues/5463)
- We fixed an issue where the merge dialog showed the wrong text colour in "Dark" mode [#5516](https://github.com/JabRef/jabref/issues/5516)
- We fixed visibility issues with the scrollbar and group selection highlight in "Dark" mode, and enabled "Dark" mode for the OpenOffice preview in the style selection window. [#5522] (https://github.com/JabRef/jabref/issues/5522)
- We fixed an issue where the author field was not correctly parsed during bibtex key-generation. [#5551](https://github.com/JabRef/jabref/issues/5551)
- We fixed an issue where notifications where shown during autosave. [#5555](https://github.com/JabRef/jabref/issues/5555)
- We fixed an issue where the side pane was not remembering its position. [#5615](https://github.com/JabRef/jabref/issues/5615)
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/org/jabref/gui/Base.css
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,14 @@
-fx-padding: 0 0 0 0;
}

.numberColumn > .hits:any-selected {
-fx-background-color: derive(-jr-green, 70%);
}

.numberColumn > .hits:all-selected {
-fx-background-color: -jr-green;
}

.table-view {
-fx-background-insets: 0;
-fx-padding: 0;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/jabref/gui/Dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
-jr-menu-item-foreground: -fx-light-text-color;
-jr-menu-forground-active: derive(-fx-light-text-color, 50%);

-jr-scrollbar-thumb: derive(-fx-outer-border, -30%);
-jr-scrollbar-track: derive(-fx-control-inner-background, -90%);

-fx-focused-text-base-color: -fx-dark-text-color;

-jr-tooltip-fg: derive(-fx-light-text-color, 50%);
Expand All @@ -64,3 +67,10 @@
-fx-background-color: -fx-light-text-color, -fx-control-inner-background;
}

.numberColumn > .hits:any-selected {
-fx-background-color: derive(-jr-gray-3, 70%);
}

.numberColumn > .hits:all-selected {
-fx-background-color: -jr-gray-3;
}
8 changes: 0 additions & 8 deletions src/main/java/org/jabref/gui/groups/GroupTree.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@
-fx-fill: -jr-group-hits-fg;
}

.numberColumn > .hits:any-selected {
-fx-background-color: derive(-jr-green, 70%);
}

.numberColumn > .hits:all-selected {
-fx-background-color: -jr-green;
}

.disclosureNodeColumn {
-fx-alignment: top-right;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.types.StandardEntryType;
import org.jabref.preferences.PreferencesService;
import org.jabref.preferences.JabRefPreferences;

import com.airhacks.afterburner.views.ViewLoader;
import org.fxmisc.easybind.EasyBind;
Expand All @@ -47,6 +48,7 @@ public class StyleSelectDialogView extends BaseDialog<OOBibStyle> {
private StyleSelectDialogViewModel viewModel;
private PreviewViewer previewArticle;
private PreviewViewer previewBook;
JabRefPreferences prefs = JabRefPreferences.getInstance();

public StyleSelectDialogView(StyleLoader loader) {

Expand Down Expand Up @@ -78,6 +80,9 @@ private void initialize() {
previewBook.setEntry(TestEntry.getTestEntryBook());
vbox.getChildren().add(previewBook);

previewArticle.setTheme(prefs.get(JabRefPreferences.FX_THEME));
previewBook.setTheme(prefs.get(JabRefPreferences.FX_THEME));

colName.setCellValueFactory(cellData -> cellData.getValue().nameProperty());
colJournals.setCellValueFactory(cellData -> cellData.getValue().journalsProperty());
colFile.setCellValueFactory(cellData -> cellData.getValue().fileProperty());
Expand Down

0 comments on commit b812b62

Please sign in to comment.