mirror of https://github.com/zlatinb/muwire
Add a set of aliases for the system LnF for the major platforms
parent
5100a4ad44
commit
8392f1af5b
|
@ -1,3 +1,4 @@
|
||||||
|
import com.muwire.gui.LNFs
|
||||||
import griffon.core.GriffonApplication
|
import griffon.core.GriffonApplication
|
||||||
import groovy.swing.SwingBuilder
|
import groovy.swing.SwingBuilder
|
||||||
import groovy.util.logging.Log
|
import groovy.util.logging.Log
|
||||||
|
@ -118,6 +119,9 @@ class Initialize extends AbstractLifecycleHandler {
|
||||||
LookAndFeel chosen = lookAndFeel('system', 'gtk', 'metal')
|
LookAndFeel chosen = lookAndFeel('system', 'gtk', 'metal')
|
||||||
uiSettings.lnf = chosen.getID()
|
uiSettings.lnf = chosen.getID()
|
||||||
log.info("ended up applying $chosen.name")
|
log.info("ended up applying $chosen.name")
|
||||||
|
if (LNFs.SYSTEM_ALIASES.contains(uiSettings.lnf))
|
||||||
|
uiSettings.lnf = "system"
|
||||||
|
|
||||||
|
|
||||||
FontUIResource defaultFont = chosen.getDefaults().getFont("Label.font")
|
FontUIResource defaultFont = chosen.getDefaults().getFont("Label.font")
|
||||||
uiSettings.font = defaultFont.getName()
|
uiSettings.font = defaultFont.getName()
|
||||||
|
|
|
@ -6,6 +6,7 @@ package com.muwire.gui
|
||||||
class LNFs {
|
class LNFs {
|
||||||
static final Map<String, String> nameToClass = new HashMap<>()
|
static final Map<String, String> nameToClass = new HashMap<>()
|
||||||
static final Map<String, String> classToName = new HashMap<>()
|
static final Map<String, String> classToName = new HashMap<>()
|
||||||
|
static final Set<String> SYSTEM_ALIASES = new HashSet<>()
|
||||||
|
|
||||||
static final String[] availableLNFs
|
static final String[] availableLNFs
|
||||||
|
|
||||||
|
@ -24,6 +25,10 @@ class LNFs {
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
SYSTEM_ALIASES.add("GTK") // Linux
|
||||||
|
SYSTEM_ALIASES.add("Aqua") // Mac
|
||||||
|
SYSTEM_ALIASES.add("Windows") // Windows
|
||||||
|
|
||||||
register("System", "system")
|
register("System", "system")
|
||||||
register("Metal","metal")
|
register("Metal","metal")
|
||||||
register("Darcula","com.bulenkov.darcula.DarculaLaf")
|
register("Darcula","com.bulenkov.darcula.DarculaLaf")
|
||||||
|
|
Loading…
Reference in New Issue