IDEA-90011 Color Picker doesn't show current custom color, RGB fields not wide enough for 3-digit values

This commit is contained in:
Konstantin Bulenkov
2012-08-22 19:28:32 +04:00
parent d3092844ee
commit 87af41aa28
2 changed files with 8 additions and 3 deletions
@@ -136,12 +136,17 @@ public class FileColorConfigurationEditDialog extends DialogWrapper {
private void updateCustomButton() {
final Object item = myScopeComboBox.getSelectedItem();
if (item instanceof String) {
@SuppressWarnings({"SuspiciousMethodCalls"})
final Color color = ColorUtil.getColor(myScopeNames.get(item).getClass());
Color color = myConfiguration == null ? null : ColorUtil.fromHex(myConfiguration.getColorName(), null);
final CustomColorButton button = (CustomColorButton)myColorToButtonMap.get(CUSTOM_COLOR_NAME);
if (color == null) {
color = ColorUtil.getColor(myScopeNames.get(item).getClass());
}
if (color != null) {
button.setColor(color);
button.setSelected(true);
button.repaint();
}
}
}
@@ -84,7 +84,7 @@ public abstract class FileColorSettingsTable extends JBTable {
@Override
public boolean editCellAt(int row, int column, EventObject e) {
if (e instanceof MouseEvent && ((MouseEvent)e).getClickCount() == 1) return false;
if (e == null || (e instanceof MouseEvent && ((MouseEvent)e).getClickCount() == 1)) return false;
final Object at = getModel().getValueAt(row, column);
final FileColorConfigurationEditDialog dialog = new FileColorConfigurationEditDialog(myManager, ((FileColorConfiguration)at));
dialog.getScopeComboBox().setEnabled(false);