Skip to content

Commit

Permalink
Merge pull request #489 from THgithub19/flatlafandyaru
Browse files Browse the repository at this point in the history
Add Flat Look and Feel (Light and Dark) and Yaru Icons

Former-commit-id: 9ffa55d
  • Loading branch information
RalfBarkow authored Dec 30, 2023
2 parents ec3f3b2 + 0c8eee0 commit 488cdb1
Show file tree
Hide file tree
Showing 92 changed files with 1,580 additions and 1,566 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@
<artifactId>jaxb-runtime</artifactId>
<version>3.0.0</version>
</dependency>
<!-- https://www.formdev.com/flatlaf/#download -->
<dependency>
<groupId>com.formdev</groupId>
<artifactId>flatlaf</artifactId>
<version>3.2.5</version>
</dependency>
</dependencies>
<repositories>
<repository>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -840,8 +840,6 @@ private void initComboboxLAF() {
lafselection = cnt;
}
}
jComboBoxLAF.addItem(Constants.seaGlassLookAndFeelClassName);
if (settings.isSeaGlass()) lafselection = installed_laf.length;
jComboBoxLAF.setSelectedIndex(lafselection);
}

Expand Down
3,079 changes: 1,538 additions & 1,541 deletions src/main/java/de/danielluedecke/zettelkasten/ZettelkastenView.java

Large diffs are not rendered by default.

31 changes: 19 additions & 12 deletions src/main/java/de/danielluedecke/zettelkasten/database/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@

package de.danielluedecke.zettelkasten.database;

import com.formdev.flatlaf.FlatLightLaf;
import com.formdev.flatlaf.FlatDarkLaf;

import de.danielluedecke.zettelkasten.CImportBibTex;
import de.danielluedecke.zettelkasten.CSetBibKey;
import de.danielluedecke.zettelkasten.ZettelkastenView;
Expand All @@ -49,6 +52,7 @@
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
Expand Down Expand Up @@ -579,31 +583,34 @@ public void initDefaultSettingsIfMissing() {
}

{
// Retrieve all installed Look and Feels.
// Install FlatLafs Light and Dark with Ubuntu accent colour (Todo: make colors / themeing flexible, not hardcoded)
UIManager.installLookAndFeel("FlatLightLaf", "com.formdev.flatlaf.FlatLightLaf");
FlatLightLaf.setGlobalExtraDefaults(Collections.singletonMap("@accentColor", "#ea5420"));
UIManager.installLookAndFeel("FlatDarkLaf", "com.formdev.flatlaf.FlatDarkLaf");
FlatDarkLaf.setGlobalExtraDefaults(Collections.singletonMap("@accentColor", "#ea5420"));
// Retrieve all installed LookAndFeels
UIManager.LookAndFeelInfo[] installed_laf = UIManager.getInstalledLookAndFeels();
boolean lafAquaFound = false;
boolean lafNimbusFound = false;
String aquaclassname = "";
String nimbusclassname = "";
String flatlightlafclassname = "";

// Give Aqua and FlatLightLaf proper classnames
for (UIManager.LookAndFeelInfo laf : installed_laf) {
// In case we find "nimbus" LAF, set this as default on non-mac-os
// because it looks better.
if (laf.getName().equalsIgnoreCase("mac os x") || laf.getClassName().contains("Aqua")) {
lafAquaFound = true;
aquaclassname = laf.getClassName();
}
if (laf.getName().equalsIgnoreCase("nimbus") || laf.getClassName().contains("Nimbus")) {
lafNimbusFound = true;
nimbusclassname = laf.getClassName();
if (laf.getName().equalsIgnoreCase("FlatLightLaf") || laf.getClassName().contains("com.formdev.flatlaf.FlatLightLaf")) {
flatlightlafclassname = laf.getClassName();
}
}
// Check which laf was found and set appropriate default value.
// Set Aqua as default on MacOS, FlatLightLaf on Linux and System Laf on Windows
if (lafAquaFound) {
genericElementInitIfMissing(SETTING_LAF, aquaclassname);
} else if (lafNimbusFound) {
genericElementInitIfMissing(SETTING_LAF, nimbusclassname);
} else {
} else if (PlatformUtil.isLinux()) {
genericElementInitIfMissing(SETTING_LAF, flatlightlafclassname);
}
else {
genericElementInitIfMissing(SETTING_LAF, UIManager.getSystemLookAndFeelClassName());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1129,11 +1129,11 @@ private static int getBibtexDescriptionIndex(String desc) {
/**
*
*/
public static final String[] iconThemes = { "", "crystal/", "tango/", "osx/", "crystal/small/", "tango/small/" };
public static final String[] iconThemes = { "", "yaru/", "crystal/", "tango/", "osx/", "crystal/small/", "tango/small/" };
/**
*
*/
public static final String[] iconThemesNames = { "Standard", "Crystal", "Tango", "Standard (small)",
public static final String[] iconThemesNames = { "Standard", "Yaru", "Crystal", "Tango", "Standard (small)", "Yaru (small)",
"Crystal (small)", "Tango (small)" };

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ <h3>Programmsymbole</h3>

<ul>
<li><a href="http://sebastian-ploenges.com">Sebastian Pl&ouml;nges</a>, (Creatice Commons Attribution-NonCommercial-ShareAlike <a href="http://creativecommons.org/licenses/by-nc-sa/2.0/de/">Lizenz</a>)</li>
<li><a href="http://tango.freedesktop.org/">Tango</a> Icons (Creatice Commons Attribution-Share-Alike <a href="http://creativecommons.org/licenses/by-sa/3.0/deed.de">Lizenz</a>)</li>
<li><a href="https://github.com/ubuntu/yaru">Yaru</a> Icons (Creative Commons Attribution-Share-Alike 4.0 <a href="https://creativecommons.org/licenses/by-sa/4.0/">Lizenz</a>)</li>
<li><a href="http://tango.freedesktop.org/">Tango</a> Icons (Creatice Commons Attribution-Share-Alike <a href="http://creativecommons.org/licenses/by-sa/3.0/deed.de">Lizenz</a>)</li>
<li><a href="http://www.everaldo.com/crystal">Crystal</a> Icons (GNU GPL <a href="http://www.everaldo.com/crystal/?action=license">Lizenz</a>)</li>
<!--
<li><a href="http://www.famfamfam.com/lab/icons/silk/">FamFamFam</a> Silk-Icons (Creative Commons Attribution 2.5 <a href="http://creativecommons.org/licenses/by/2.5/">Lizenz</a>)</li>
Expand All @@ -100,13 +101,15 @@ <h3>Programmbibliotheken</h3>
<ul>
<li><a href="http://www.jdom.org/">JDom</a>, Java-XML-Parser (Apache-style Open Source <a href="http://www.jdom.org/docs/faq.html#a0030">Lizenz</a>)</li>
<li><a href="https://commons.apache.org/proper/commons-lang/">Apache Commons Lang</a> (<a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache Lizenz</a>)</li>
<li><a href="http://opencsv.sourceforge.net/">Open CSV</a>, Java-CSV-Parser (Apache V2 <a href="http://www.apache.org/licenses/LICENSE-2.0">Lizenz</a>)</li>
<li><a href="http://opencsv.sourceforge.net/">Open CSV</a>, Java-CSV-Parser (Apache V2 <a href="http://www.apache.org/licenses/LICENSE-2.0.html">Lizenz</a>)</li>
<li><a href="http://code.google.com/p/javabib/">JavaBib</a>, BibTex-Parser von <a href="http://www.jhenkel.de/">Johannes Henkel</a> (GPL <a href="http://de.wikipedia.org/wiki/GNU_General_Public_License">Lizenz</a>)</li>
<li><a href="http://sourceforge.net/projects/java-registry">Java Win-Registry</a>, Java Registry Wrapper, (GPL <a href="http://de.wikipedia.org/wiki/GNU_General_Public_License">Lizenz</a> und LGPL <a href="http://de.wikipedia.org/wiki/GNU_Lesser_General_Public_License">Lizenz</a>)</li>
<li><a href="http://seaglasslookandfeel.com/">Sea Glass Look and Feel</a> (Apache <a href="http://de.wikipedia.org/wiki/GNU_General_Public_License">Lizenz 2.0</a>)</li>
<li><a href="https://github.com/khuxtable/seaglass/wiki">Sea Glass Look and Feel</a> (Apache <a href="https://www.apache.org/licenses/LICENSE-2.0.html">Lizenz 2.0</a>)</li>
<li><a href="https://www.formdev.com/flatlaf/">FlatLaf - Flat Look and Feel</a> (Apache V2 <a href="https://www.apache.org/licenses/LICENSE-2.0.html">Lizenz 2.0</a>)</li>

</ul>

<p><a name="licence_en"><em>English version</em></a></p>
<p><a id="licence_en"><em>English version</em></a></p>

<h1>Zettelkasten - Licence and terms of use</h1>

Expand Down Expand Up @@ -158,7 +161,8 @@ <h3>Icon Set</h3>

<ul>
<li><a href="http://sebastian-ploenges.com">Sebastian Pl&ouml;nges</a>, (Creatice Commons Attribution-NonCommercial-ShareAlike <a href="http://creativecommons.org/licenses/by-nc-sa/2.0/">licence</a>)</li>
<li><a href="http://tango.freedesktop.org/">Tango</a> Icons (Creatice Commons Attribution-Share-Alike <a href="http://creativecommons.org/licenses/by-sa/3.0/deed.de">licence</a>)</li>
<li><a href="https://github.com/ubuntu/yaru">Yaru</a> Icons (Creative Commons Attribution-Share-Alike 4.0 <a href="https://creativecommons.org/licenses/by-sa/4.0/">Lizenz</a>)</li>
<li><a href="http://tango.freedesktop.org/">Tango</a> Icons (Creatice Commons Attribution-Share-Alike <a href="http://creativecommons.org/licenses/by-sa/3.0/deed.de">licence</a>)</li>
<li><a href="http://www.everaldo.com/crystal">Crystal</a> Icons (GNU GPL <a href="http://www.everaldo.com/crystal/?action=license">licence</a>)</li>
<!--
<li><a href="http://www.famfamfam.com/lab/icons/silk/">FamFamFam</a> Silk-Icons (Creative Commons Attribution 2.5 <a href="http://creativecommons.org/licenses/by/2.5/">licence</a>)</li>
Expand All @@ -171,12 +175,14 @@ <h3>Program libraries</h3>

<ul>
<li><a href="http://www.jdom.org/">JDom</a>, Java-XML-Parser (Apache-style Open Source <a href="http://www.jdom.org/docs/faq.html#a0030">licence</a>)</li>
<li><a href="https://commons.apache.org/proper/commons-lang/">Apache Commons Lang</a> (<a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache licence</a>)</li>
<li><a href="https://commons.apache.org/proper/commons-lang/">Apache Commons Lang</a> (<a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache licence</a>)</li>
<li><a href="http://opencsv.sourceforge.net/">Open CSV</a>, Java-CSV-Parser (Apache V2 <a href="http://www.apache.org/licenses/LICENSE-2.0">licence</a>)</li>
<li><a href="http://code.google.com/p/javabib/">JavaBib</a>, BibTex-Parser von <a href="http://www.jhenkel.de/">Johannes Henkel</a> (GPL <a href="http://de.wikipedia.org/wiki/GNU_General_Public_License">licence</a>)</li>
<li><a href="http://sourceforge.net/projects/java-registry">Java Win-Registry</a>, Java Registry Wrapper, (GPL <a href="http://de.wikipedia.org/wiki/GNU_General_Public_License">licence</a> and LGPL <a href="http://de.wikipedia.org/wiki/GNU_Lesser_General_Public_License">licence</a>)</li>
<li><a href="http://seaglasslookandfeel.com/">Sea Glass Look and Feel</a> (Apache <a href="http://de.wikipedia.org/wiki/GNU_General_Public_License">licence 2.0</a>)</li>
</ul>
<li><a href="http://sourceforge.net/projects/java-registry">Java Win-Registry</a>, Java Registry Wrapper, (GPL <a href="http://de.wikipedia.org/wiki/GNU_General_Public_License">licence</a> and LGPL <a href="http://de.wikipedia.org/wiki/GNU_Lesser_General_Public_License">licence</a>)</li>
<li><a href="https://github.com/khuxtable/seaglass/wiki">Sea Glass Look and Feel</a> (Apache <a href="https://www.apache.org/licenses/LICENSE-2.0.html">licence 2.0</a>)</li>
<li><a href="https://www.formdev.com/flatlaf/">FlatLaf - Flat Look and Feel</a> (Apache V2 <a href="https://www.apache.org/licenses/LICENSE-2.0.html">Lizenz 2.0</a>)</li>

</ul>

</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 488cdb1

Please sign in to comment.