diff --git a/images/src/META-INF/ImagesPlugin.xml b/images/src/META-INF/ImagesPlugin.xml index c11f25f8120a..7a7bf2602548 100644 --- a/images/src/META-INF/ImagesPlugin.xml +++ b/images/src/META-INF/ImagesPlugin.xml @@ -25,6 +25,9 @@ + + + + diff --git a/images/src/org/intellij/images/actions/ColorPickerForImageAction.java b/images/src/org/intellij/images/actions/ColorPickerForImageAction.java new file mode 100644 index 000000000000..ea70d4eb9cb8 --- /dev/null +++ b/images/src/org/intellij/images/actions/ColorPickerForImageAction.java @@ -0,0 +1,29 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.intellij.images.actions; + +import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.ui.ShowColorPickerAction; + +/** + * @author Konstantin Bulenkov + */ +public class ColorPickerForImageAction extends ShowColorPickerAction { + @Override + public void update(AnActionEvent e) { + EditExternallyAction.doUpdate(e); + } +} diff --git a/images/src/org/intellij/images/actions/EditExternallyAction.java b/images/src/org/intellij/images/actions/EditExternallyAction.java index 83c3ef7c8c94..e9d627737cba 100644 --- a/images/src/org/intellij/images/actions/EditExternallyAction.java +++ b/images/src/org/intellij/images/actions/EditExternallyAction.java @@ -106,6 +106,10 @@ public final class EditExternallyAction extends AnAction { public void update(AnActionEvent e) { super.update(e); + doUpdate(e); + } + + static void doUpdate(AnActionEvent e) { VirtualFile[] files = e.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY); final boolean isEnabled = isImages(files); if (e.getPlace().equals(ActionPlaces.PROJECT_VIEW_POPUP)) { diff --git a/images/src/org/intellij/images/editor/impl/ImageEditorUI.java b/images/src/org/intellij/images/editor/impl/ImageEditorUI.java index 359b7b383c92..0cd9f275cdc2 100644 --- a/images/src/org/intellij/images/editor/impl/ImageEditorUI.java +++ b/images/src/org/intellij/images/editor/impl/ImageEditorUI.java @@ -26,6 +26,7 @@ import com.intellij.psi.PsiElement; import com.intellij.psi.PsiManager; import com.intellij.ui.PopupHandler; import com.intellij.ui.ScrollPaneFactory; +import com.intellij.util.ui.UIUtil; import org.intellij.images.ImagesBundle; import org.intellij.images.editor.ImageDocument; import org.intellij.images.editor.ImageEditor; @@ -206,6 +207,15 @@ final class ImageEditorUI extends JPanel implements DataProvider { public Dimension getPreferredSize() { return imageComponent.getSize(); } + + @Override + protected void paintComponent(Graphics g) { + super.paintComponent(g); + if (UIUtil.isUnderDarcula()) { + g.setColor(UIUtil.getControlColor().brighter()); + g.fillRect(0,0,getWidth(), getHeight()); + } + } } private final class ImageWheelAdapter implements MouseWheelListener {