From 40f0fe58b183c175ab768a16946f5c5a6eee0fe4 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Tue, 22 Sep 2009 17:25:39 +0400 Subject: [PATCH] paint dotted border over background filled areas, not the other way around. --- .../intellij/ui/SimpleColoredComponent.java | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java b/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java index 0f21feacb6ca..b19eb23feb90 100644 --- a/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java +++ b/platform/platform-api/src/com/intellij/ui/SimpleColoredComponent.java @@ -1,17 +1,17 @@ /* - * Copyright 2000-2007 JetBrains s.r.o. + * Copyright 2000-2009 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 + * 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 + * 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. + * 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 com.intellij.ui; @@ -356,15 +356,7 @@ public class SimpleColoredComponent extends JComponent { xOffset = myIpad.left; } - // Paint focus border around the text and icon (if necessary) - if (myPaintFocusBorder) { - if (myFocusBorderAroundIcon || icon == null) { - myBorder.paintBorder(this, g, 0, 0, getWidth(), getHeight()); - } - else { - myBorder.paintBorder(this, g, xOffset, 0, getWidth() - xOffset, getHeight()); - } - } + int textStart = xOffset; xOffset += myBorder.getBorderInsets(this).left; // Paint text @@ -426,6 +418,16 @@ public class SimpleColoredComponent extends JComponent { xOffset = myAlignWidth; } } + + // Paint focus border around the text and icon (if necessary) + if (myPaintFocusBorder) { + if (myFocusBorderAroundIcon || icon == null) { + myBorder.paintBorder(this, g, 0, 0, getWidth(), getHeight()); + } + else { + myBorder.paintBorder(this, g, textStart, 0, getWidth() - textStart, getHeight()); + } + } } private static void checkCanPaint() {