1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 11:12:22 -05:00

Try to set Nimbus Look And Feel on Linux with Gtk

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@611 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-07-06 13:33:59 +00:00
parent 647eac6705
commit 60fdd74d6e

View File

@ -126,7 +126,16 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
String lafClassName = UIManager.getSystemLookAndFeelClassName();
// workaround for bug when SWT and AWT both try to access Gtk
if (lafClassName.indexOf("gtk") > 0) {
lafClassName = UIManager.getCrossPlatformLookAndFeelClassName();
// try to set Nimbus LAF
for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(laf.getName())) {
lafClassName = laf.getClassName();
}
}
// failover to default
if (lafClassName == null) {
lafClassName = UIManager.getCrossPlatformLookAndFeelClassName();
}
}
UIManager.setLookAndFeel(lafClassName);
} catch (Exception e) {