summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYura <yura@google.com>2015-04-24 14:58:34 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-04-24 14:58:34 +0000
commit56e1ea99ce9fcd80e24ea808bc6fb511c7691667 (patch)
tree0cfd2fe85d0e7eccbacdcb488e8d10b3848c643e
parentaaec9f2ee234874051011f0933c0cb658f9e1ed4 (diff)
parent799e63cf350d80d38da36644459215845bfe9f58 (diff)
downloadidea-56e1ea99ce9fcd80e24ea808bc6fb511c7691667.tar.gz
Merge "Got rid of default white background of the theme editor table." into studio-1.3-dev automerge: 393636f
automerge: 799e63c * commit '799e63cf350d80d38da36644459215845bfe9f58': Got rid of default white background of the theme editor table.
-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 b36baa04d54..5f09da77eb6 100644
--- a/android/src/com/android/tools/idea/editors/theme/ThemeEditorComponent.java
+++ b/android/src/com/android/tools/idea/editors/theme/ThemeEditorComponent.java
@@ -173,6 +173,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 1b4bf026904..53e509fd147 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
@@ -85,7 +85,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()));
}