summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYura <yura@google.com>2015-04-23 19:11:10 +0100
committerYura <yura@google.com>2015-04-23 19:31:52 +0100
commitd270e94f2406ccd592a6d6048d62ba854687f990 (patch)
tree678ff6e21cb26c02328ff70d8d689eaa285aea9d
parent685775679acf45f53e036282a68ee1557ff4d676 (diff)
downloadidea-d270e94f2406ccd592a6d6048d62ba854687f990.tar.gz
Got rid of default white background of the theme editor table.
Change-Id: I3141449f77c6d9c2d413db8dcd602cfac499041c
-rw-r--r--android/src/com/android/tools/idea/editors/theme/ThemeEditorComponent.java3
-rw-r--r--android/src/com/android/tools/idea/editors/theme/attributes/editors/ColorComponent.java5
-rw-r--r--android/src/com/android/tools/idea/editors/theme/attributes/editors/ColorEditor.java1
-rw-r--r--android/src/com/android/tools/idea/editors/theme/attributes/editors/ColorRenderer.java1
4 files changed, 4 insertions, 6 deletions
diff --git a/android/src/com/android/tools/idea/editors/theme/ThemeEditorComponent.java b/android/src/com/android/tools/idea/editors/theme/ThemeEditorComponent.java
index a1441d9aa8b..2ca8ad22812 100644
--- a/android/src/com/android/tools/idea/editors/theme/ThemeEditorComponent.java
+++ b/android/src/com/android/tools/idea/editors/theme/ThemeEditorComponent.java
@@ -171,6 +171,9 @@ public class ThemeEditorComponent extends Splitter {
renderTask = service.createTask(null, configuration, new RenderLogger("ThemeEditorLogger", module), null);
}
+ // Get rid of default white background of the table.
+ myAttributesTable.setBackground(null);
+
myAttributesTable.setDefaultRenderer(Color.class, new DelegatingCellRenderer(new ColorRenderer(myConfiguration)));
myAttributesTable.setDefaultRenderer(EditedStyleItem.class, new DelegatingCellRenderer(new AttributeReferenceRendererEditor(project, completionProvider)));
myAttributesTable.setDefaultRenderer(ThemeEditorStyle.class, new DelegatingCellRenderer(new AttributeReferenceRendererEditor(project, completionProvider)));
diff --git a/android/src/com/android/tools/idea/editors/theme/attributes/editors/ColorComponent.java b/android/src/com/android/tools/idea/editors/theme/attributes/editors/ColorComponent.java
index f7bab3ed280..95db3fe4175 100644
--- a/android/src/com/android/tools/idea/editors/theme/attributes/editors/ColorComponent.java
+++ b/android/src/com/android/tools/idea/editors/theme/attributes/editors/ColorComponent.java
@@ -65,6 +65,7 @@ public class ColorComponent extends JPanel {
myColorChooserButton = new ColorChooserButton();
myColorChooserButton.setBorder(null);
+ myColorChooserButton.setBackground(JBColor.WHITE);
add(myColorChooserButton, BorderLayout.CENTER);
}
@@ -76,10 +77,6 @@ public class ColorComponent extends JPanel {
}
}
- public void setButtonBackground(@NotNull final Color color) {
- myColorChooserButton.setBackground(color);
- }
-
public void configure(final EditedStyleItem resValue, final List<Color> color) {
myNameLabel.setText(ThemeEditorUtils.getDisplayHtml(resValue));
myValueLabel.setText(color.isEmpty() ? "" : ResourceHelper.colorToString(color.get(0)));
diff --git a/android/src/com/android/tools/idea/editors/theme/attributes/editors/ColorEditor.java b/android/src/com/android/tools/idea/editors/theme/attributes/editors/ColorEditor.java
index f9d5ef5f024..b47c8c97cd5 100644
--- a/android/src/com/android/tools/idea/editors/theme/attributes/editors/ColorEditor.java
+++ b/android/src/com/android/tools/idea/editors/theme/attributes/editors/ColorEditor.java
@@ -61,7 +61,6 @@ public class ColorEditor extends AbstractTableCellEditor {
myItem = (EditedStyleItem) value;
final List<Color> colors = ResourceHelper.resolveMultipleColors(myConfiguration.getResourceResolver(), myItem.getItemResourceValue());
myComponent.configure(myItem, colors);
- myComponent.setButtonBackground(table.getBackground());
} else {
LOG.error(String.format("Object passed to ColorRendererEditor has class %1$s instead of ItemResourceValueWrapper", value.getClass().getName()));
}
diff --git a/android/src/com/android/tools/idea/editors/theme/attributes/editors/ColorRenderer.java b/android/src/com/android/tools/idea/editors/theme/attributes/editors/ColorRenderer.java
index 4e2aa5f7272..9cf9731faa1 100644
--- a/android/src/com/android/tools/idea/editors/theme/attributes/editors/ColorRenderer.java
+++ b/android/src/com/android/tools/idea/editors/theme/attributes/editors/ColorRenderer.java
@@ -44,7 +44,6 @@ public class ColorRenderer implements TableCellRenderer {
final EditedStyleItem item = (EditedStyleItem) obj;
final List<Color> colors = ResourceHelper.resolveMultipleColors(myConfiguration.getResourceResolver(), item.getItemResourceValue());
myComponent.configure(item, colors);
- myComponent.setButtonBackground(table.getBackground());
} else {
LOG.error(String.format("Object passed to ColorRendererEditor has class %1$s instead of ItemResourceValueWrapper", obj.getClass().getName()));
}