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 groovy.swing.SwingBuilder
|
||||
import groovy.util.logging.Log
|
||||
|
@ -118,6 +119,9 @@ class Initialize extends AbstractLifecycleHandler {
|
|||
LookAndFeel chosen = lookAndFeel('system', 'gtk', 'metal')
|
||||
uiSettings.lnf = chosen.getID()
|
||||
log.info("ended up applying $chosen.name")
|
||||
if (LNFs.SYSTEM_ALIASES.contains(uiSettings.lnf))
|
||||
uiSettings.lnf = "system"
|
||||
|
||||
|
||||
FontUIResource defaultFont = chosen.getDefaults().getFont("Label.font")
|
||||
uiSettings.font = defaultFont.getName()
|
||||
|
|
|
@ -6,6 +6,7 @@ package com.muwire.gui
|
|||
class LNFs {
|
||||
static final Map<String, String> nameToClass = new HashMap<>()
|
||||
static final Map<String, String> classToName = new HashMap<>()
|
||||
static final Set<String> SYSTEM_ALIASES = new HashSet<>()
|
||||
|
||||
static final String[] availableLNFs
|
||||
|
||||
|
@ -24,6 +25,10 @@ class LNFs {
|
|||
}
|
||||
|
||||
static {
|
||||
SYSTEM_ALIASES.add("GTK") // Linux
|
||||
SYSTEM_ALIASES.add("Aqua") // Mac
|
||||
SYSTEM_ALIASES.add("Windows") // Windows
|
||||
|
||||
register("System", "system")
|
||||
register("Metal","metal")
|
||||
register("Darcula","com.bulenkov.darcula.DarculaLaf")
|
||||
|
|
Loading…
Reference in New Issue