Skip to content

Commit

Permalink
Fix black text in Dark mode inside "Citation information" (#11578)
Browse files Browse the repository at this point in the history
* fix #11512

* Fix typos and use of Logger

* Switch to id

* Works with class

* Works without class

---------

Co-authored-by: Oliver Kopp <[email protected]>
Co-authored-by: Christoph <[email protected]>
  • Loading branch information
3 people authored Aug 6, 2024
1 parent 8b153fb commit dfaa5f4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- The dialog for [adding an entry using reference text](https://docs.jabref.org/collect/newentryfromplaintext) is now filled with the clipboard contents as default. [#11565](https://github.com/JabRef/jabref/pull/11565)
- Added minimal support for [biblatex data annotation](https://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf#subsection.3.7) fields in `.layout` files. [#11505](https://github.com/JabRef/jabref/issues/11505)
- Added saving of selected options in the [Lookup -> Search for unlinked local files dialog](https://docs.jabref.org/collect/findunlinkedfiles#link-the-pdfs-to-your-bib-library). [#11439](https://github.com/JabRef/jabref/issues/11439)
- We fixed ans issue where text in Dark mode inside "Citation information" was not readable [#11512](https://github.com/JabRef/jabref/issues/11512)
- We enabled creating a new file link manually. [#11017](https://github.com/JabRef/jabref/issues/11017)
- We added a toggle button to invert the selected groups. [#9073](https://github.com/JabRef/jabref/issues/9073)
- We reintroduced the floating search in the main table. [#4237](https://github.com/JabRef/jabref/issues/4237)
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/org/jabref/gui/entryeditor/EntryEditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@
-fx-fill: #7800A9 ;
-fx-font-size: 1.2em;
-fx-font-weight: bolder;

}

#citationsPane {
-fx-padding: 0;
-fx-background-color: -fx-control-inner-background;
}

#citationsPane * {
#citationsPane *,
#scitePane Label, #scitePane Text {
-fx-fill: -fx-text-background-color;
}

Expand All @@ -155,12 +155,13 @@
.scite-error-box {
-fx-padding: 30 0 0 30;
}

.scite-message-box {
-fx-padding: 30 0 0 30;
}

.scite-error-label {
#scite-error-label {
-fx-font-size: 1.5em;
-fx-font-weight: bold;
-fx-text-fill: -fx-accent;
-fx-text-fill: -jr-error;
}
6 changes: 4 additions & 2 deletions src/main/java/org/jabref/gui/entryeditor/SciteTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
import com.tobiasdiez.easybind.EasyBind;
import org.controlsfx.control.HyperlinkLabel;

/**
* @implNote This tab is called <code>SciteTab</code>, because it uses the service <code>**scite** aI</code>.
*/
public class SciteTab extends EntryEditorTab {

public static final String NAME = "Citation information";
Expand Down Expand Up @@ -83,7 +86,7 @@ protected void bindToEntry(BibEntry entry) {

private VBox getErrorPane() {
Label titleLabel = new Label(Localization.lang("Error"));
titleLabel.getStyleClass().add("scite-error-label");
titleLabel.setId("scite-error-label");
Text errorMessageText = new Text(viewModel.searchErrorProperty().get());
VBox errorMessageBox = new VBox(30, titleLabel, errorMessageText);
errorMessageBox.getStyleClass().add("scite-error-box");
Expand All @@ -101,7 +104,6 @@ private VBox getTalliesPane(SciteTallyModel tallModel) {
tallModel.unclassified(),
tallModel.citingPublications()
));

String url = SCITE_REPORTS_URL_BASE + URLEncoder.encode(tallModel.doi(), StandardCharsets.UTF_8);
VBox messageBox = getMessageBox(url, titleLabel, message);
messageBox.getStyleClass().add("scite-message-box");
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/org/jabref/gui/entryeditor/SciteTabViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@
import org.jabref.preferences.PreferencesService;

import kong.unirest.core.json.JSONObject;
import org.tinylog.Logger;
import org.slf4j.LoggerFactory;

public class SciteTabViewModel extends AbstractViewModel {

/**
* Status enum for Scite tab
*/
private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(SciteTabViewModel.class);

public enum SciteStatus {
IN_PROGRESS,
FOUND,
Expand Down Expand Up @@ -99,21 +98,22 @@ private void cancelSearch() {
public SciteTallyModel fetchTallies(DOI doi) throws FetcherException {
try {
URL url = new URI(BASE_URL + "tallies/" + doi.getDOI()).toURL();
LOGGER.debug("Fetching tallies from {}", url);
URLDownload download = new URLDownload(url);
String response = download.asString();
Logger.debug("Response {}", response);
LOGGER.debug("Response {}", response);
JSONObject tallies = new JSONObject(response);
if (tallies.has("detail")) {
String message = tallies.getString("detail");
throw new FetcherException(message);
} else if (!tallies.has("total")) {
throw new FetcherException("Unexpected result data!");
throw new FetcherException("Unexpected result data.");
}
return SciteTallyModel.fromJSONObject(tallies);
} catch (MalformedURLException | URISyntaxException ex) {
throw new FetcherException("Malformed url for DOs", ex);
throw new FetcherException("Malformed URL for DOI", ex);
} catch (IOException ioex) {
throw new FetcherException("Failed to retrieve tallies for DOI - IO Exception", ioex);
throw new FetcherException("Failed to retrieve tallies for DOI - I/O Exception", ioex);
}
}

Expand Down

0 comments on commit dfaa5f4

Please sign in to comment.