mirror of
https://github.com/cryptomator/cryptomator.git
synced 2024-11-23 12:09:45 +00:00
Merge pull request #2175 from cryptomator/feature/binary-stylesheets
Prefer binary stylesheets
This commit is contained in:
commit
fedb62d99a
35
pom.xml
35
pom.xml
@ -298,6 +298,41 @@
|
||||
</compilerArgs>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>compile-light-theme</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>java</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<mainClass>javafx.graphics/com.sun.javafx.css.parser.Css2Bin</mainClass>
|
||||
<arguments>
|
||||
<arg>${project.basedir}/src/main/resources/css/light_theme.css</arg>
|
||||
<arg>${project.build.outputDirectory}/css/light_theme.bss</arg>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>compile-dark-theme</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>java</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<mainClass>javafx.graphics/com.sun.javafx.css.parser.Css2Bin</mainClass>
|
||||
<arguments>
|
||||
<arg>${project.basedir}/src/main/resources/css/dark_theme.css</arg>
|
||||
<arg>${project.build.outputDirectory}/css/dark_theme.bss</arg>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
|
@ -83,12 +83,26 @@ public class FxApplicationStyle {
|
||||
}
|
||||
|
||||
private void applyLightTheme() {
|
||||
Application.setUserAgentStylesheet(getClass().getResource("/css/light_theme.css").toString());
|
||||
var stylesheet = Optional //
|
||||
.ofNullable(getClass().getResource("/css/light_theme.bss")) //
|
||||
.orElse(getClass().getResource("/css/light_theme.css"));
|
||||
if (stylesheet == null) {
|
||||
LOG.warn("Failed to load light_theme stylesheet");
|
||||
} else {
|
||||
Application.setUserAgentStylesheet(stylesheet.toString());
|
||||
appearanceProvider.ifPresent(provider -> provider.adjustToTheme(Theme.LIGHT));
|
||||
}
|
||||
}
|
||||
|
||||
private void applyDarkTheme() {
|
||||
Application.setUserAgentStylesheet(getClass().getResource("/css/dark_theme.css").toString());
|
||||
var stylesheet = Optional //
|
||||
.ofNullable(getClass().getResource("/css/dark_theme.bss")) //
|
||||
.orElse(getClass().getResource("/css/dark_theme.css"));
|
||||
if (stylesheet == null) {
|
||||
LOG.warn("Failed to load dark_theme stylesheet");
|
||||
} else {
|
||||
Application.setUserAgentStylesheet(stylesheet.toString());
|
||||
appearanceProvider.ifPresent(provider -> provider.adjustToTheme(Theme.DARK));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user