From 2823a7e10819c36f7dee5bb3424e65fec55be40a Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Thu, 27 Sep 2012 17:51:46 +0200 Subject: [PATCH] Platform: themes order fixed in settings --- .../intellij/ide/ui/laf/LafManagerImpl.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java b/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java index 5b62f13df107..5537dc73de20 100644 --- a/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/ide/ui/laf/LafManagerImpl.java @@ -122,10 +122,6 @@ public final class LafManagerImpl extends LafManager implements ApplicationCompo List lafList = ContainerUtil.newArrayList(); - if (Registry.is("dark.laf.available")) { - lafList.add(new DarculaLookAndFeelInfo()); - } - if (SystemInfo.isMac) { lafList.add(new UIManager.LookAndFeelInfo("Default", UIManager.getSystemLookAndFeelClassName())); } @@ -139,14 +135,24 @@ public final class LafManagerImpl extends LafManager implements ApplicationCompo } } + if (Registry.is("dark.laf.available")) { + lafList.add(new DarculaLookAndFeelInfo()); + } + myLaFs = lafList.toArray(new UIManager.LookAndFeelInfo[lafList.size()]); - Arrays.sort(myLaFs, new Comparator() { - public int compare(UIManager.LookAndFeelInfo obj1, UIManager.LookAndFeelInfo obj2) { - String name1 = obj1.getName(); - String name2 = obj2.getName(); - return name1.compareToIgnoreCase(name2); - } - }); + + if (!SystemInfo.isMac) { + // do not sort LaFs on mac - the order is determined as Default, Darcula. + // when we leave only system LaFs on other OSes, the order also should be determined as Default, Darcula + + Arrays.sort(myLaFs, new Comparator() { + public int compare(UIManager.LookAndFeelInfo obj1, UIManager.LookAndFeelInfo obj2) { + String name1 = obj1.getName(); + String name2 = obj2.getName(); + return name1.compareToIgnoreCase(name2); + } + }); + } myCurrentLaf = getDefaultLaf(); }