diff options
author | Yura <yura@google.com> | 2015-04-24 15:17:16 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-04-24 15:17:16 +0000 |
commit | fb8ba039bff44b64f9037df958a906f97e89761d (patch) | |
tree | 0cfd2fe85d0e7eccbacdcb488e8d10b3848c643e | |
parent | d3d9617fec615ab96d211498b19514d52d6e7b68 (diff) | |
parent | b708cc12a0bb8677335869b1a1f0f086dc9fc44c (diff) | |
download | idea-fb8ba039bff44b64f9037df958a906f97e89761d.tar.gz |
am b708cc12: am 56e1ea99: Merge "Got rid of default white background of the theme editor table." into studio-1.3-dev automerge: 393636f automerge: 799e63c
* commit 'b708cc12a0bb8677335869b1a1f0f086dc9fc44c':
Got rid of default white background of the theme editor table.
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())); } |