Java Code Examples for com.intellij.util.ui.UIUtil#getLabelDisabledForeground()

The following examples show how to use com.intellij.util.ui.UIUtil#getLabelDisabledForeground() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FrameRenderingDisplay.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
FrameRenderingPanel(@NotNull FlutterFramesMonitor framesMonitor, @NotNull DisplayRefreshRateManager displayRefreshRateManager) {
  this.framesMonitor = framesMonitor;
  this.displayRefreshRateManager = displayRefreshRateManager;

  setLayout(null);
  final Color color = UIUtil.getLabelDisabledForeground();
  //noinspection UseJBColor
  setForeground(new Color(color.getRed(), color.getGreen(), color.getBlue(), 0x7f));
}
 
Example 2
Source File: FrameRenderingDisplay.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
FrameRenderingPanel(@NotNull FlutterFramesMonitor framesMonitor, @NotNull DisplayRefreshRateManager displayRefreshRateManager) {
  this.framesMonitor = framesMonitor;
  this.displayRefreshRateManager = displayRefreshRateManager;

  setLayout(null);
  final Color color = UIUtil.getLabelDisabledForeground();
  //noinspection UseJBColor
  setForeground(new Color(color.getRed(), color.getGreen(), color.getBlue(), 0x7f));
}
 
Example 3
Source File: JBLabel.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public Color getForeground() {
  if (!isEnabled()) {
    return UIUtil.getLabelDisabledForeground();
  }
  if (myFontColor != null) {
    return UIUtil.getLabelFontColor(myFontColor);
  }
  return super.getForeground();
}
 
Example 4
Source File: ContentTabLabel.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
protected Color getPassiveFg(boolean selected) {
  if (contentManager().getContentCount() > 1) {
    return selected && !UIUtil.isUnderDarcula() ? Gray._255 : UIUtil.isUnderDarcula() ? UIUtil.getLabelDisabledForeground() : Gray._75;
  }

  return super.getPassiveFg(selected);
}
 
Example 5
Source File: HeapDisplay.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
private static Color getForegroundColor() {
  return UIUtil.getLabelDisabledForeground();
}
 
Example 6
Source File: HeapDisplay.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
private static Color getForegroundColor() {
  return UIUtil.getLabelDisabledForeground();
}
 
Example 7
Source File: TimeTrackerWidget.java    From DarkyenusTimeTracker with The Unlicense 4 votes vote down vote up
@Override
public void paintComponent(final Graphics g) {
    final int timeToShow = service.getTotalTimeSeconds();
    final String info = currentShowTimePattern().secondsToString(timeToShow);

    final Dimension size = getSize();
    final Insets insets = getInsets();

    final int totalBarLength = size.width - insets.left - insets.right;
    final int barHeight = Math.max(size.height, getFont().getSize() + 2);
    final int yOffset = (size.height - barHeight) / 2;
    final int xOffset = insets.left;

    final TimeTrackingStatus status = service.getStatus();
    if (mouseInside) {
        if (status == RUNNING) {
            g.setColor(COLOR_MENU_ON);
        } else {
            g.setColor(COLOR_MENU_OFF);
        }
    } else {
        switch (status) {
            case RUNNING:
                g.setColor(COLOR_ON);
                break;
            case IDLE:
                g.setColor(COLOR_IDLE);
                break;
            case STOPPED:
                g.setColor(COLOR_OFF);
                break;
        }
    }
    g.fillRect(insets.left, insets.bottom, totalBarLength, size.height - insets.bottom - insets.top);
    UISettings.setupAntialiasing(g);

    if (mouseInside) {
        // Draw controls
        g.setColor(JBUI.CurrentTheme.CustomFrameDecorations.separatorForeground());
        final int resumeStopWidth = resumeStopButtonWidth(totalBarLength);
        final int settingsWidth = totalBarLength - resumeStopWidth;

        g.drawLine(xOffset + resumeStopWidth, yOffset, xOffset + resumeStopWidth, yOffset + barHeight);

        Icon firstIcon = status == RUNNING ? STOP_ICON : START_ICON;
        firstIcon.paintIcon(this, g, xOffset + (resumeStopWidth - firstIcon.getIconWidth()) / 2, yOffset + (barHeight - firstIcon.getIconHeight())/2);
        SETTINGS_ICON.paintIcon(this, g, xOffset + resumeStopWidth + (settingsWidth - SETTINGS_ICON.getIconWidth()) / 2, yOffset + (barHeight - SETTINGS_ICON.getIconHeight())/2);
    } else {
        // Draw time text
        final Color fg = getModel().isPressed() ? UIUtil.getLabelDisabledForeground() : JBColor.foreground();
        g.setColor(fg);
        g.setFont(WIDGET_FONT);
        final FontMetrics fontMetrics = g.getFontMetrics();
        final int infoWidth = fontMetrics.charsWidth(info.toCharArray(), 0, info.length());
        final int infoHeight = fontMetrics.getAscent();
        g.drawString(info, xOffset + (totalBarLength - infoWidth) / 2, yOffset + infoHeight + (barHeight - infoHeight) / 2 - 1);
    }
}