IDEA-158861 right arrow correct support
authorAlexey Utkin <alexey.utkin@jetbrains.com>
Wed, 24 Aug 2016 12:38:44 +0000 (15:38 +0300)
committerAlexey Utkin <alexey.utkin@jetbrains.com>
Wed, 24 Aug 2016 12:38:44 +0000 (15:38 +0300)
platform/lang-impl/src/com/intellij/application/options/colors/RainbowDescriptionPanel.java
platform/platform-resources-en/src/messages/ApplicationBundle.properties

index 77d65a359017d87ddd551a18dc47fb693fb6065a..3c0a1d3a79b53ac51799c189ff91ad2a859e5e56 100644 (file)
@@ -18,13 +18,16 @@ package com.intellij.application.options.colors;
 import com.intellij.openapi.application.ApplicationBundle;
 import com.intellij.openapi.editor.colors.EditorColorsScheme;
 import com.intellij.openapi.editor.colors.EditorSchemeAttributeDescriptor;
+import com.intellij.openapi.editor.colors.EditorSchemeAttributeDescriptorWithPath;
 import com.intellij.openapi.options.OptionsBundle;
 import com.intellij.openapi.ui.Messages;
 import com.intellij.openapi.util.Pair;
 import com.intellij.ui.ColorPanel;
 import com.intellij.ui.components.JBCheckBox;
 import com.intellij.util.EventDispatcher;
+import com.intellij.util.FontUtil;
 import com.intellij.util.ui.JBUI;
+import com.intellij.util.ui.UIUtil;
 import org.jetbrains.annotations.NotNull;
 
 import javax.swing.*;
@@ -82,26 +85,35 @@ public class RainbowDescriptionPanel extends JPanel implements OptionsPanelImpl.
     myInheritedMessage = ApplicationBundle.message("label.inherited.gradient",
                                                    rainbowOptionsID,
                                                    languageDefaultPageID);
-    myInheritedMessageTooltip = ApplicationBundle.message("label.inherited.gradient.tooltip",
-                                                          rainbowOptionsID,
-                                                          languageDefaultPageID);
+
+    myInheritedMessageTooltip = checkRightArrow(ApplicationBundle.message("label.inherited.gradient.tooltip",
+                                                                          rainbowOptionsID,
+                                                                          languageDefaultPageID));
+
     myOverrideMessage = ApplicationBundle.message("label.override.gradient");
     HyperlinkListener listener = e -> myDispatcher.getMulticaster().onHyperLinkClicked(e);
 
     Messages.configureMessagePaneUi(myGradientLabel, myOverrideMessage, null);
     myGradientLabel.addHyperlinkListener(listener);
 
-    Messages.configureMessagePaneUi(myInheritanceLabel, ApplicationBundle.message("label.rainbow.inheritance",
-                                                                                  rainbowOptionsID,
-                                                                                  rainbowOptionsID,
-                                                                                  languageDefaultPageID), null);
-    myInheritanceLabel.setToolTipText(ApplicationBundle.message("label.rainbow.inheritance.tooltip",
-                                                                rainbowOptionsID,
-                                                                languageDefaultPageID));
+    Messages.configureMessagePaneUi(myInheritanceLabel,
+                                    checkRightArrow(ApplicationBundle.message("label.rainbow.inheritance",
+                                                                              rainbowOptionsID,
+                                                                              rainbowOptionsID,
+                                                                              languageDefaultPageID)),
+                                    null);
+    myInheritanceLabel.setToolTipText(checkRightArrow(ApplicationBundle.message("label.rainbow.inheritance.tooltip",
+                                                                                rainbowOptionsID,
+                                                                                languageDefaultPageID)));
     myInheritanceLabel.addHyperlinkListener(listener);
     myInheritanceLabel.setBorder(JBUI.Borders.empty(4, 0, 4, 4));
   }
 
+  @NotNull
+  private static String checkRightArrow(@NotNull String str) {
+    return str.replaceAll("->", FontUtil.rightArrow(UIUtil.getLabelFont()));
+  }
+
   @NotNull
   @Override
   public JComponent getPanel() {
index 0f0638e649834c19c454ebf6a137a9f90f57baf7..437d8e23a340f8e643eff41cc19547a21f3cdbe2 100644 (file)
@@ -746,12 +746,12 @@ checkbox.line.comment.add.space=Add a space at comment start
 rainbow.option.panel.display.name=Semantic highlighting
 label.override.gradient=<html>Override gradient:</html>
 label.inherited.gradient=<html>Inherited from <a href="{0}">{1}</a> gradient:</html>
-label.inherited.gradient.tooltip=<html>''{0}\u2192Override gradient'' from<br>''{1}'' section</html>
+label.inherited.gradient.tooltip=<html>''{0}->Override gradient'' from<br>''{1}'' section</html>
 checkbox.stop.1=Stop #1
 checkbox.stop.2=Stop #2
 checkbox.stop.3=Stop #3
 checkbox.stop.4=Stop #4
 checkbox.stop.5=Stop #5
 checkbox.rainbow=<html>Unique color for each parameter<br>and local variable<br><font color=gray><sub>Chosen from generated gradient</sub></font></html>
-label.rainbow.inheritance=<html><div style="text-align:right" vertical-align="top">''{0}\u2192Unique color''<br>of <a href="{1}">{2}</html>
-label.rainbow.inheritance.tooltip=<html>''{0}\u2192Unique color'' from<br>''{1}'' section</html>
\ No newline at end of file
+label.rainbow.inheritance=<html><div style="text-align:right" vertical-align="top">''{0}->Unique color''<br>of <a href="{1}">{2}</html>
+label.rainbow.inheritance.tooltip=<html>''{0}->Unique color'' from<br>''{1}'' section</html>
\ No newline at end of file