Skip to content

Commit 193b5bc

Browse files
authored
Make performance tab warning text red (#7581)
Follow up to #7577 <img width="581" alt="Screenshot 2024-07-29 at 10 45 47 AM" src="https://github.com/user-attachments/assets/c3316e53-c41a-4866-9592-56731d6bc1f8">
1 parent 201e508 commit 193b5bc

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

flutter-idea/src/io/flutter/performance/FlutterPerformanceView.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545

4646
import javax.swing.*;
4747
import javax.swing.border.CompoundBorder;
48+
import javax.swing.text.SimpleAttributeSet;
49+
import javax.swing.text.StyleConstants;
50+
import javax.swing.text.StyleContext;
4851
import java.awt.*;
4952
import java.util.ArrayList;
5053
import java.util.HashMap;
@@ -189,17 +192,12 @@ private void addPerformanceViewContent(FlutterApp app, ToolWindow toolWindow) {
189192
FlutterSdkVersion sdkVersion = sdk == null ? null : sdk.getVersion();
190193
if (sdkVersion != null && sdkVersion.canUseDevToolsMultiEmbed()) {
191194
final JPanel warning = new JPanel(new BorderLayout(50, 50));
192-
JTextArea area = new JTextArea(
193-
"The performance panel is being removed soon. Use the Flutter DevTools panel instead: View -> Tool windows -> Flutter DevTools");
194-
area.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
195-
area.setLineWrap(true);
196-
area.setWrapStyleWord(true);
197-
area.setOpaque(false);
198-
area.setEditable(false);
199-
area.setFocusable(false);
200-
area.setFont(UIManager.getFont("Label.font").deriveFont(Font.BOLD));
201-
area.setBackground(UIManager.getColor("Label.background"));
202-
warning.add(area);
195+
JTextPane text = new JTextPane();
196+
text.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
197+
text.setCharacterAttributes(StyleContext.getDefaultStyleContext().addAttribute(SimpleAttributeSet.EMPTY, StyleConstants.Foreground, new Color(234, 57, 35)), false);
198+
text.setText("The performance panel is being removed soon. Use the Flutter DevTools panel instead: View -> Tool windows -> Flutter DevTools");
199+
text.setFont(UIManager.getFont("Label.font").deriveFont(Font.BOLD));
200+
warning.add(text);
203201
perfViewsPanel.add(warning);
204202
}
205203

0 commit comments

Comments
 (0)