1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-25 09:18:51 -05:00

* update search-auto-completion

This commit is contained in:
Reinhard Pointner 2014-01-10 07:31:50 +00:00
parent 0da24469b7
commit 53ad37930d
4 changed files with 17 additions and 3 deletions

View File

@ -108,7 +108,11 @@ public class SelectButtonTextField<T> extends JComponent {
StringBuffer htmlText = new StringBuffer("<html><nobr>");
if (matcher.find()) {
matcher.appendReplacement(htmlText, "<span style='font-weight: bold; text-decoration: underline;'>$0</span>");
if (isSelected) {
matcher.appendReplacement(htmlText, "<span style='font-weight: bold;'>$0</span>");
} else {
matcher.appendReplacement(htmlText, "<span style='color: " + TunedUtilities.toHex(list.getSelectionBackground()) + "; font-weight: bold;'>$0</span>");
}
}
matcher.appendTail(htmlText);

View File

@ -90,7 +90,10 @@ public class EpisodeListPanel extends AbstractSearchPanel<EpisodeListProvider, E
names.add(Normalization.removeTrailingBrackets(n));
}
}
return new TreeSet<String>(names);
TreeSet<String> treeSet = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
treeSet.addAll(names);
return treeSet;
}
@Override

View File

@ -152,7 +152,10 @@ public class SubtitlePanel extends AbstractSearchPanel<SubtitleProvider, Subtitl
names.add(Normalization.removeTrailingBrackets(n));
}
}
return new TreeSet<String>(names);
TreeSet<String> treeSet = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
treeSet.addAll(names);
return treeSet;
};
@Override

View File

@ -71,6 +71,10 @@ public final class TunedUtilities {
return new Color(((int) ((alpha * 255)) << 24) | (color.getRGB() & 0x00FFFFFF), true);
}
public static String toHex(Color c) {
return String.format("#%02x%02x%02x", c.getRed(), c.getGreen(), c.getBlue());
}
public static boolean isShiftOrAltDown(ActionEvent evt) {
return checkModifiers(evt.getModifiers(), ActionEvent.SHIFT_MASK) || checkModifiers(evt.getModifiers(), ActionEvent.ALT_MASK);
}