void (final Graphics g) { Graphics2D g2d = (Graphics2D)g.create(); try { Color tabBg = getEffectiveBackground(); Color transparent = ColorUtil.withAlpha(tabBg, 0); int borderThickness = myTabs.getBorderThickness(); int width = JBUI.scale(MathUtil.clamp(Registry.intValue("ide.editor.tabs.fadeout.width", 10), 1, 200)); Rectangle myRect = getBounds(); myRect.height -= borderThickness + (isSelected() ? myTabs.getTabPainter().getTabTheme().getUnderlineHeight() : borderThickness); // Fadeout for left part (needed only in top and bottom placements) if (myRect.x < 0) { Rectangle leftRect = new Rectangle(-myRect.x, borderThickness, width, myRect.height - 2 * borderThickness); paintGradientRect(g2d, leftRect, tabBg, transparent); } Rectangle contentRect = myLabelPlaceholder.getBounds(); // Fadeout for right side before pin/close button (needed only in side placements and in squeezing layout) if (contentRect.width < myLabelPlaceholder.getPreferredSize().width + myTabs.getTabHGap()) { Rectangle rightRect = new Rectangle(contentRect.x + contentRect.width - width, borderThickness, width, myRect.height - 2 * borderThickness); paintGradientRect(g2d, rightRect, transparent, tabBg); } // Fadeout for right side else if (myTabs.getEffectiveLayout$intellij_platform_ide().isScrollable() && myRect.width < getPreferredSize().width + myTabs.getTabHGap()) { Rectangle rightRect = new Rectangle(myRect.width - width, borderThickness, width, myRect.height - 2 * borderThickness); paintGradientRect(g2d, rightRect, transparent, tabBg); } } finally { g2d.dispose(); } }