-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4130 provide dark theme #4372
Merged
Merged
4130 provide dark theme #4372
Changes from 4 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
8e88303
provide theme changing
265cfa2
add commit to changelog.md
bfc6323
fix key name
61a0106
add default value
a1d856d
get css file via nio
1b1291b
add preference via parameter
8c18526
refactor add whitespace
c2f055b
get css file via Paths
5e22bf2
fix ChangeLog.md
d029556
save user style into a new var
3c25004
remove setting default value for style
4108273
refactor code
1dba889
delete unused import
ce4269f
refactor code. delete not necessary var
ae18693
fix checkstyle
024ccca
fix incorrect named var
0af7908
refactor code
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package org.jabref.gui.util; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.net.URISyntaxException; | ||
import java.net.URL; | ||
|
@@ -37,12 +38,19 @@ | |
public class ThemeLoader { | ||
|
||
private static final String DEFAULT_PATH_MAIN_CSS = JabRefFrame.class.getResource("Base.css").toExternalForm(); | ||
private static final String CSS_SYSTEM_PROPERTY = System.getProperty("jabref.theme.css"); | ||
private static final Logger LOGGER = LoggerFactory.getLogger(ThemeLoader.class); | ||
private final String CSS_SYSTEM_PROPERTY; | ||
private final FileUpdateMonitor fileUpdateMonitor; | ||
|
||
public ThemeLoader(FileUpdateMonitor fileUpdateMonitor) { | ||
this.fileUpdateMonitor = Objects.requireNonNull(fileUpdateMonitor); | ||
Siedlerchr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
String cssFileName = JabRefPreferences.getInstance().get(JabRefPreferences.FX_THEME); | ||
if (cssFileName != null) { | ||
String themeName = JabRefFrame.class.getResource(cssFileName).getPath(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the nio methods for accessing the resource. Have a look at the exporter tests to see how |
||
CSS_SYSTEM_PROPERTY = new File(themeName).getAbsolutePath(); | ||
} else | ||
CSS_SYSTEM_PROPERTY = null; | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please formulate the changelog as the above ones and link the issue