mirror of
https://github.com/moparisthebest/davmail
synced 2024-08-13 16:53:51 -04: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:
parent
647eac6705
commit
60fdd74d6e
@ -126,8 +126,17 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
|
|||||||
String lafClassName = UIManager.getSystemLookAndFeelClassName();
|
String lafClassName = UIManager.getSystemLookAndFeelClassName();
|
||||||
// workaround for bug when SWT and AWT both try to access Gtk
|
// workaround for bug when SWT and AWT both try to access Gtk
|
||||||
if (lafClassName.indexOf("gtk") > 0) {
|
if (lafClassName.indexOf("gtk") > 0) {
|
||||||
|
// 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();
|
lafClassName = UIManager.getCrossPlatformLookAndFeelClassName();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
UIManager.setLookAndFeel(lafClassName);
|
UIManager.setLookAndFeel(lafClassName);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
DavGatewayTray.warn(new BundleMessage("LOG_UNABLE_TO_SET_LOOK_AND_FEEL"));
|
DavGatewayTray.warn(new BundleMessage("LOG_UNABLE_TO_SET_LOOK_AND_FEEL"));
|
||||||
|
Loading…
Reference in New Issue
Block a user