mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-90011 Color Picker doesn't show current custom color, RGB fields not wide enough for 3-digit values
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user