mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-217440 Rework the inactive window rendering mechanism
GitOrigin-RevId: 32e9e610d74aea5ccc1893689eab2f893b3cee39
This commit is contained in:
committed by
intellij-monorepo-bot
parent
89314060c4
commit
d087296f00
@@ -15,6 +15,7 @@ import com.intellij.openapi.application.EDT
|
||||
import com.intellij.openapi.application.UI
|
||||
import com.intellij.openapi.application.impl.BorderPainterHolder
|
||||
import com.intellij.openapi.application.impl.InternalUICustomization
|
||||
import com.intellij.openapi.application.impl.islands.isIjpl217440
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.wm.IdeRootPaneNorthExtension
|
||||
import com.intellij.openapi.wm.StatusBar
|
||||
@@ -31,7 +32,6 @@ import com.intellij.ui.hover.HoverListener
|
||||
import com.intellij.ui.scale.JBUIScale.scale
|
||||
import com.intellij.util.concurrency.AppExecutorUtil
|
||||
import com.intellij.util.ui.JBInsets
|
||||
import com.intellij.util.ui.JBSwingUtilities
|
||||
import com.intellij.util.ui.JBUI
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
@@ -100,7 +100,7 @@ internal class NavBarRootPaneExtension : IdeRootPaneNorthExtension {
|
||||
// used externally
|
||||
abstract class NavBarWrapperPanel(layout: LayoutManager?) : JPanel(layout), UISettingsListener {
|
||||
override fun getComponentGraphics(graphics: Graphics): Graphics {
|
||||
return JBSwingUtilities.runGlobalCGTransform(this, super.getComponentGraphics(graphics))
|
||||
return InternalUICustomization.runGlobalCGTransformWithInactiveFrameSupport(this, super.getComponentGraphics(graphics))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -276,6 +276,7 @@ internal open class MyNavBarWrapperPanel(private val project: Project, useAsComp
|
||||
}
|
||||
}
|
||||
|
||||
// todo remove with isIjpl217440 property
|
||||
internal class MyTopNavBarWrapperPanel(project: Project, useAsComponent: Boolean) :
|
||||
MyNavBarWrapperPanel(project, useAsComponent), BorderPainterHolder {
|
||||
|
||||
@@ -283,7 +284,9 @@ internal class MyTopNavBarWrapperPanel(project: Project, useAsComponent: Boolean
|
||||
|
||||
override fun paintChildren(g: Graphics) {
|
||||
super.paintChildren(g)
|
||||
borderPainter.paintAfterChildren(this, g)
|
||||
if (!isIjpl217440) {
|
||||
borderPainter.paintAfterChildren(this, g)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.ex.*;
|
||||
import com.intellij.openapi.application.WriteIntentReadAction;
|
||||
import com.intellij.openapi.application.impl.InternalUICustomization;
|
||||
import com.intellij.openapi.application.impl.islands.IslandsUICustomizationKt;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.keymap.KeymapUtil;
|
||||
@@ -472,12 +473,13 @@ public class ActionButton extends JComponent implements ActionButtonComponent, A
|
||||
return KeymapUtil.getFirstKeyboardShortcutText(myAction);
|
||||
}
|
||||
|
||||
// todo remove with isIjpl217440 property
|
||||
private final InternalUICustomization myCustomization = InternalUICustomization.getInstance();
|
||||
|
||||
@Override
|
||||
public void paintComponent(Graphics g) {
|
||||
jComponentPaint(g);
|
||||
if (myCustomization != null) {
|
||||
if (myCustomization != null && !IslandsUICustomizationKt.isIjpl217440()) {
|
||||
g = myCustomization.preserveGraphics(g);
|
||||
}
|
||||
paintButtonLook(g);
|
||||
|
||||
+16
@@ -18,6 +18,7 @@ import com.intellij.toolWindow.StripesUxCustomizer
|
||||
import com.intellij.toolWindow.ToolWindowButtonManager
|
||||
import com.intellij.toolWindow.xNext.XNextStripesUxCustomizer
|
||||
import com.intellij.ui.BorderPainter
|
||||
import com.intellij.ui.Graphics2DDelegate
|
||||
import com.intellij.ui.JBColor
|
||||
import com.intellij.ui.mac.WindowTabsComponent
|
||||
import com.intellij.ui.tabs.JBTabPainter
|
||||
@@ -25,6 +26,7 @@ import com.intellij.ui.tabs.JBTabsPosition
|
||||
import com.intellij.ui.tabs.impl.JBTabsImpl
|
||||
import com.intellij.ui.tabs.impl.TabLabel
|
||||
import com.intellij.ui.tabs.impl.TabPainterAdapter
|
||||
import com.intellij.util.ui.JBSwingUtilities
|
||||
import com.intellij.util.ui.JBUI
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import java.awt.*
|
||||
@@ -51,6 +53,17 @@ open class InternalUICustomization {
|
||||
instance = result
|
||||
return result
|
||||
}
|
||||
|
||||
fun runGlobalCGTransformWithInactiveFrameSupport(component: JComponent, graphics: Graphics): Graphics {
|
||||
if (graphics is Graphics2DDelegate) {
|
||||
return graphics
|
||||
}
|
||||
|
||||
val customization = getInstance()
|
||||
val inactiveFrameGraphics = customization?.inactiveFrameGraphics(graphics, component) ?: graphics
|
||||
|
||||
return JBSwingUtilities.runGlobalCGTransform(component, inactiveFrameGraphics)
|
||||
}
|
||||
}
|
||||
|
||||
open fun progressWidget(project: Project): JComponent? = null
|
||||
@@ -132,6 +145,8 @@ open class InternalUICustomization {
|
||||
|
||||
open fun preserveGraphics(graphics: Graphics): Graphics = graphics
|
||||
|
||||
open fun inactiveFrameGraphics(graphics: Graphics, component: Component): Graphics = graphics
|
||||
|
||||
open fun backgroundImageGraphics(component: JComponent, graphics: Graphics): Graphics = graphics
|
||||
|
||||
open fun createCustomDivider(isVertical: Boolean, splitter: Splittable): Divider? = null
|
||||
@@ -196,6 +211,7 @@ open class InternalUICustomization {
|
||||
open fun getSingleRowTabInsets(tabsPosition: JBTabsPosition): Insets? = null
|
||||
}
|
||||
|
||||
// todo remove with isIjpl217440 property
|
||||
@ApiStatus.Internal
|
||||
interface BorderPainterHolder {
|
||||
var borderPainter: BorderPainter
|
||||
|
||||
+29
-14
@@ -22,21 +22,27 @@ import com.intellij.ui.scale.ScaleContext
|
||||
import com.intellij.util.ui.JBUI
|
||||
import java.awt.*
|
||||
import javax.swing.JComponent
|
||||
import javax.swing.SwingUtilities
|
||||
|
||||
/**
|
||||
* The list of auto replaced colors. Should contain only very specific colors, don't add widely used like `Panel.background`
|
||||
*/
|
||||
private val islandsGradientColors = setOf(
|
||||
// Root components
|
||||
"MainWindow.background",
|
||||
"MainToolbar.background",
|
||||
"MainToolbar.inactiveBackground",
|
||||
"ToolWindow.Stripe.background",
|
||||
"StatusBar.background",
|
||||
)
|
||||
|
||||
internal fun isIslandsGradientColor(paint: Paint?): Boolean {
|
||||
val colorName = (paint as? JBColor)?.name ?: return false
|
||||
return colorName in islandsGradientColors
|
||||
}
|
||||
|
||||
internal class IslandsGradientPainter(private val frame: IdeFrame, private val mainColor: Color, private val enabled: () -> Boolean) : AbstractPainter() {
|
||||
|
||||
/**
|
||||
* The list of auto replaced colors. Should contain only very specific colors, don't add widely used like `Panel.background`
|
||||
*/
|
||||
private val islandsGradientColors = setOf(
|
||||
// Root components
|
||||
"MainWindow.background",
|
||||
"MainToolbar.background",
|
||||
"MainToolbar.inactiveBackground",
|
||||
"ToolWindow.Stripe.background",
|
||||
"StatusBar.background",
|
||||
)
|
||||
|
||||
private val projectWindowCustomizer = ProjectWindowCustomizerService.getInstance()
|
||||
|
||||
private var doPaint = true
|
||||
@@ -48,8 +54,7 @@ internal class IslandsGradientPainter(private val frame: IdeFrame, private val m
|
||||
try {
|
||||
doPaint = false
|
||||
|
||||
val colorName = (g.paint as? JBColor)?.name
|
||||
if (colorName in islandsGradientColors) {
|
||||
if (isIslandsGradientColor(g.paint)) {
|
||||
islandsGradientPaint(frame, mainColor, projectWindowCustomizer, component, g)
|
||||
}
|
||||
}
|
||||
@@ -98,6 +103,13 @@ private fun doGradientPaint(frame: IdeFrame, mainColor: Color, project: Project,
|
||||
|
||||
val leftGradientTexture = cache.left.getHorizontalTexture(g, leftWidth, mainColor, blendedColor)
|
||||
val rightGradientTexture = cache.right.getHorizontalTexture(g, rightWidth, blendedColor, mainColor, leftWidth)
|
||||
val initialComposite = g.composite
|
||||
val islandsInactiveFrameGraphics2D = g as? IslandsInactiveFrameGraphics2D
|
||||
|
||||
if (isIjpl217440 && SwingUtilities.getWindowAncestor(frame.component)?.isActive == false) {
|
||||
islandsInactiveFrameGraphics2D?.preserveComposite = true
|
||||
g.composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, islandsInactiveAlpha)
|
||||
}
|
||||
|
||||
g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY)
|
||||
|
||||
@@ -114,6 +126,9 @@ private fun doGradientPaint(frame: IdeFrame, mainColor: Color, project: Project,
|
||||
val startColor = if (SystemInfo.isMac) Gray.TRANSPARENT else ColorUtil.toAlpha(mainColor, 0)
|
||||
g.paint = GradientPaint(0f, 0f, startColor, 0f, height.toFloat(), mainColor)
|
||||
g.fillRect(0, 0, totalWidth, height)
|
||||
|
||||
g.composite = initialComposite
|
||||
islandsInactiveFrameGraphics2D?.preserveComposite = false
|
||||
}
|
||||
|
||||
private class GradientCache {
|
||||
|
||||
+188
@@ -0,0 +1,188 @@
|
||||
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.application.impl.islands
|
||||
|
||||
import com.intellij.ui.Graphics2DDelegate
|
||||
import java.awt.*
|
||||
import java.awt.image.BufferedImage
|
||||
import java.awt.image.BufferedImageOp
|
||||
import java.awt.image.ImageObserver
|
||||
import java.text.AttributedCharacterIterator
|
||||
import javax.swing.SwingUtilities
|
||||
|
||||
/**
|
||||
* Paints everything with alpha [islandsInactiveAlpha] when the frame is not active
|
||||
*/
|
||||
internal class IslandsInactiveFrameGraphics2D(g: Graphics2D, private val component: Component) : Graphics2DDelegate(g) {
|
||||
|
||||
var preserveComposite: Boolean = false
|
||||
|
||||
private fun getAlpha(): Float {
|
||||
return if (SwingUtilities.getWindowAncestor(component)?.isActive == false) islandsInactiveAlpha else 1f
|
||||
}
|
||||
|
||||
private fun <R> wrapPaint(runnable: () -> R): R {
|
||||
val alpha = getAlpha()
|
||||
|
||||
if (alpha == 1f || preserveComposite || isIslandsGradientColor(paint)) {
|
||||
return runnable.invoke()
|
||||
}
|
||||
|
||||
val composite = getComposite()
|
||||
try {
|
||||
when (composite) {
|
||||
is AlphaComposite -> {
|
||||
setComposite(AlphaComposite.getInstance(composite.getRule(), composite.alpha * alpha))
|
||||
}
|
||||
null -> {
|
||||
setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha))
|
||||
}
|
||||
}
|
||||
|
||||
return runnable.invoke()
|
||||
}
|
||||
finally {
|
||||
setComposite(composite)
|
||||
}
|
||||
}
|
||||
|
||||
override fun clearRect(x: Int, y: Int, width: Int, height: Int) {
|
||||
wrapPaint {
|
||||
super.clearRect(x, y, width, height)
|
||||
}
|
||||
}
|
||||
|
||||
override fun fillRect(x: Int, y: Int, width: Int, height: Int) {
|
||||
wrapPaint {
|
||||
super.fillRect(x, y, width, height)
|
||||
}
|
||||
}
|
||||
|
||||
override fun fillArc(x: Int, y: Int, width: Int, height: Int, startAngle: Int, arcAngle: Int) {
|
||||
wrapPaint {
|
||||
super.fillArc(x, y, width, height, startAngle, arcAngle)
|
||||
}
|
||||
}
|
||||
|
||||
override fun fillOval(x: Int, y: Int, width: Int, height: Int) {
|
||||
wrapPaint {
|
||||
super.fillOval(x, y, width, height)
|
||||
}
|
||||
}
|
||||
|
||||
override fun fillPolygon(xPoints: IntArray, yPoints: IntArray, nPoints: Int) {
|
||||
wrapPaint {
|
||||
super.fillPolygon(xPoints, yPoints, nPoints)
|
||||
}
|
||||
}
|
||||
|
||||
override fun fillPolygon(s: Polygon) {
|
||||
wrapPaint {
|
||||
super.fillPolygon(s)
|
||||
}
|
||||
}
|
||||
|
||||
override fun fillRoundRect(x: Int, y: Int, width: Int, height: Int, arcWidth: Int, arcHeight: Int) {
|
||||
wrapPaint {
|
||||
super.fillRoundRect(x, y, width, height, arcWidth, arcHeight)
|
||||
}
|
||||
}
|
||||
|
||||
override fun fill(s: Shape) {
|
||||
wrapPaint {
|
||||
super.fill(s)
|
||||
}
|
||||
}
|
||||
|
||||
override fun drawImage(img: BufferedImage, op: BufferedImageOp?, x: Int, y: Int) {
|
||||
wrapPaint {
|
||||
super.drawImage(img, op, x, y)
|
||||
}
|
||||
}
|
||||
|
||||
override fun drawImage(img: Image?, x: Int, y: Int, width: Int, height: Int, observer: ImageObserver?): Boolean {
|
||||
return wrapPaint {
|
||||
super.drawImage(img, x, y, width, height, observer)
|
||||
}
|
||||
}
|
||||
|
||||
override fun drawImage(img: Image?, x: Int, y: Int, width: Int, height: Int, c: Color?, observer: ImageObserver?): Boolean {
|
||||
return wrapPaint {
|
||||
super.drawImage(img, x, y, width, height, c, observer)
|
||||
}
|
||||
}
|
||||
|
||||
override fun drawImage(img: Image, x: Int, y: Int, observer: ImageObserver?): Boolean {
|
||||
return wrapPaint {
|
||||
super.drawImage(img, x, y, observer)
|
||||
}
|
||||
}
|
||||
|
||||
override fun drawImage(img: Image, x: Int, y: Int, c: Color?, observer: ImageObserver?): Boolean {
|
||||
return wrapPaint {
|
||||
super.drawImage(img, x, y, c, observer)
|
||||
}
|
||||
}
|
||||
|
||||
override fun drawImage(
|
||||
img: Image?,
|
||||
dx1: Int,
|
||||
dy1: Int,
|
||||
dx2: Int,
|
||||
dy2: Int,
|
||||
sx1: Int,
|
||||
sy1: Int,
|
||||
sx2: Int,
|
||||
sy2: Int,
|
||||
observer: ImageObserver?,
|
||||
): Boolean {
|
||||
return wrapPaint {
|
||||
super.drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer)
|
||||
}
|
||||
}
|
||||
|
||||
override fun drawImage(
|
||||
img: Image?,
|
||||
dx1: Int,
|
||||
dy1: Int,
|
||||
dx2: Int,
|
||||
dy2: Int,
|
||||
sx1: Int,
|
||||
sy1: Int,
|
||||
sx2: Int,
|
||||
sy2: Int,
|
||||
c: Color?,
|
||||
observer: ImageObserver?,
|
||||
): Boolean {
|
||||
return wrapPaint {
|
||||
super.drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, c, observer)
|
||||
}
|
||||
}
|
||||
|
||||
override fun drawString(iterator: AttributedCharacterIterator?, x: Float, y: Float) {
|
||||
wrapPaint {
|
||||
super.drawString(iterator, x, y)
|
||||
}
|
||||
}
|
||||
|
||||
override fun drawString(iterator: AttributedCharacterIterator?, x: Int, y: Int) {
|
||||
wrapPaint {
|
||||
super.drawString(iterator, x, y)
|
||||
}
|
||||
}
|
||||
|
||||
override fun drawString(s: String?, x: Float, y: Float) {
|
||||
wrapPaint {
|
||||
super.drawString(s, x, y)
|
||||
}
|
||||
}
|
||||
|
||||
override fun drawString(str: String, x: Int, y: Int) {
|
||||
wrapPaint {
|
||||
super.drawString(str, x, y)
|
||||
}
|
||||
}
|
||||
|
||||
override fun create(): Graphics {
|
||||
return IslandsInactiveFrameGraphics2D(super.create() as Graphics2D, component)
|
||||
}
|
||||
}
|
||||
+30
-6
@@ -27,6 +27,7 @@ import com.intellij.openapi.ui.*
|
||||
import com.intellij.openapi.util.Key
|
||||
import com.intellij.openapi.util.SystemInfo
|
||||
import com.intellij.openapi.util.SystemInfoRt
|
||||
import com.intellij.openapi.util.registry.Registry
|
||||
import com.intellij.openapi.wm.*
|
||||
import com.intellij.openapi.wm.ex.ToolWindowManagerEx
|
||||
import com.intellij.openapi.wm.impl.*
|
||||
@@ -53,6 +54,7 @@ import com.intellij.ui.tabs.impl.JBTabsImpl
|
||||
import com.intellij.ui.tabs.impl.TabLabel
|
||||
import com.intellij.ui.tabs.impl.TabPainterAdapter
|
||||
import com.intellij.util.ui.*
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import java.awt.*
|
||||
import java.awt.event.AWTEventListener
|
||||
import java.awt.event.HierarchyEvent
|
||||
@@ -70,7 +72,21 @@ private data class WindowBackgroundComponentData(val origOpaque: Boolean, val or
|
||||
|
||||
private val WINDOW_BACKGROUND_COMPONENT_KEY: Key<WindowBackgroundComponentData> = Key.create("Islands.WINDOW_BACKGROUND_COMPONENT_KEY")
|
||||
|
||||
/**
|
||||
* After removing isIjpl217440 property
|
||||
* * Re3move from registry.properties
|
||||
* * Check all places, marked with: todo remove with isIjpl217440 property
|
||||
* * Remove inactiveAlphaInStatusBar property from everywhere including themes
|
||||
*/
|
||||
@get:ApiStatus.Internal
|
||||
val isIjpl217440: Boolean
|
||||
get() = Registry.`is`("idea.islands.ijpl217440.enabled")
|
||||
|
||||
internal val islandsInactiveAlpha: Float
|
||||
get() = JBUI.getFloat("Island.inactiveAlpha", 0.5f)
|
||||
|
||||
internal class IslandsUICustomization : InternalUICustomization() {
|
||||
|
||||
private val isIslandsAvailable = ExperimentalUI.isNewUI()
|
||||
|
||||
private var isManyIslandEnabledCache: Boolean? = null
|
||||
@@ -582,12 +598,14 @@ internal class IslandsUICustomization : InternalUICustomization() {
|
||||
}
|
||||
|
||||
private fun configureMainFrameChildren(component: Component, install: Boolean) {
|
||||
when (component) {
|
||||
is IdeStatusBarImpl -> {
|
||||
component.borderPainter = if (install) inactivePainter else DefaultBorderPainter()
|
||||
}
|
||||
is BorderPainterHolder -> {
|
||||
component.borderPainter = if (install) inactivePainter else DefaultBorderPainter()
|
||||
if (!isIjpl217440) {
|
||||
when (component) {
|
||||
is IdeStatusBarImpl -> {
|
||||
component.borderPainter = if (install) inactivePainter else DefaultBorderPainter()
|
||||
}
|
||||
is BorderPainterHolder -> {
|
||||
component.borderPainter = if (install) inactivePainter else DefaultBorderPainter()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1062,6 +1080,12 @@ internal class IslandsUICustomization : InternalUICustomization() {
|
||||
return graphics
|
||||
}
|
||||
|
||||
override fun inactiveFrameGraphics(graphics: Graphics, component: Component): Graphics {
|
||||
return if (isManyIslandEnabled && isIjpl217440)
|
||||
IslandsInactiveFrameGraphics2D(graphics as Graphics2D, component)
|
||||
else super.inactiveFrameGraphics(graphics, component)
|
||||
}
|
||||
|
||||
override fun backgroundImageGraphics(component: JComponent, graphics: Graphics): Graphics {
|
||||
if (isManyIslandEnabled && isIslandsGradientEnabled) {
|
||||
return IdeBackgroundUtil.getOriginalGraphics(graphics) // not supported for island themes with gradients yet
|
||||
|
||||
+5
-1
@@ -7,6 +7,7 @@ import com.intellij.icons.AllIcons
|
||||
import com.intellij.openapi.MnemonicHelper
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.impl.BorderPainterHolder
|
||||
import com.intellij.openapi.application.impl.islands.isIjpl217440
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.ui.JBPopupMenu
|
||||
import com.intellij.openapi.util.NlsActions
|
||||
@@ -290,9 +291,12 @@ internal sealed class CustomHeader(@JvmField internal val window: Window) : JPan
|
||||
closeMenuItem.font = JBFont.label().deriveFont(Font.BOLD)
|
||||
}
|
||||
|
||||
// todo remove with isIjpl217440 property
|
||||
override fun paint(g: Graphics) {
|
||||
super.paint(g)
|
||||
borderPainter.paintAfterChildren(this, g)
|
||||
if (!isIjpl217440) {
|
||||
borderPainter.paintAfterChildren(this, g)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getAccessibleContext(): AccessibleContext {
|
||||
|
||||
+5
-1
@@ -13,6 +13,7 @@ import com.intellij.openapi.application.UI
|
||||
import com.intellij.openapi.application.asContextElement
|
||||
import com.intellij.openapi.application.impl.BorderPainterHolder
|
||||
import com.intellij.openapi.application.impl.InternalUICustomization
|
||||
import com.intellij.openapi.application.impl.islands.isIjpl217440
|
||||
import com.intellij.openapi.wm.impl.ToolbarHolder
|
||||
import com.intellij.openapi.wm.impl.customFrameDecorations.header.titleLabel.SimpleCustomDecorationPath
|
||||
import com.intellij.openapi.wm.impl.headertoolbar.MainToolbar
|
||||
@@ -159,9 +160,12 @@ internal class MacToolbarFrameHeader(
|
||||
return CustomWindowHeaderUtil.getPreferredWindowHeaderHeight(view is CompactHeaderView)
|
||||
}
|
||||
|
||||
// todo remove with isIjpl217440 property
|
||||
override fun paint(g: Graphics) {
|
||||
super.paint(g)
|
||||
borderPainter.paintAfterChildren(this, g)
|
||||
if (!isIjpl217440) {
|
||||
borderPainter.paintAfterChildren(this, g)
|
||||
}
|
||||
}
|
||||
|
||||
override fun paintComponent(g: Graphics) {
|
||||
|
||||
+1
-2
@@ -33,7 +33,6 @@ import com.intellij.ui.dsl.gridLayout.VerticalAlign
|
||||
import com.intellij.ui.dsl.gridLayout.builders.RowsGridBuilder
|
||||
import com.intellij.util.ui.GridBag
|
||||
import com.intellij.util.ui.JBDimension
|
||||
import com.intellij.util.ui.JBSwingUtilities
|
||||
import com.intellij.util.ui.JBUI
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.channels.BufferOverflow
|
||||
@@ -393,7 +392,7 @@ internal class ToolbarFrameHeader(
|
||||
}
|
||||
|
||||
override fun getComponentGraphics(graphics: Graphics): Graphics {
|
||||
return JBSwingUtilities.runGlobalCGTransform(this, super.getComponentGraphics(graphics))
|
||||
return InternalUICustomization.runGlobalCGTransformWithInactiveFrameSupport(this, super.getComponentGraphics(graphics))
|
||||
}
|
||||
|
||||
override fun updateActive() {
|
||||
|
||||
+8
-3
@@ -29,6 +29,7 @@ import com.intellij.openapi.application.EDT
|
||||
import com.intellij.openapi.application.UiWithModelAccess
|
||||
import com.intellij.openapi.application.impl.BorderPainterHolder
|
||||
import com.intellij.openapi.application.impl.InternalUICustomization
|
||||
import com.intellij.openapi.application.impl.islands.isIjpl217440
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil
|
||||
import com.intellij.openapi.project.DumbAwareAction
|
||||
@@ -48,7 +49,6 @@ import com.intellij.ui.components.panels.HorizontalLayout
|
||||
import com.intellij.ui.mac.touchbar.TouchbarSupport
|
||||
import com.intellij.util.containers.ContainerUtil
|
||||
import com.intellij.util.ui.JBInsets
|
||||
import com.intellij.util.ui.JBSwingUtilities
|
||||
import com.intellij.util.ui.JBUI
|
||||
import com.intellij.util.ui.JBUI.CurrentTheme.Toolbar.mainToolbarButtonInsets
|
||||
import com.intellij.util.ui.showingScope
|
||||
@@ -181,7 +181,9 @@ class MainToolbar(
|
||||
}
|
||||
}
|
||||
|
||||
override fun getComponentGraphics(g: Graphics): Graphics = JBSwingUtilities.runGlobalCGTransform(this, g)
|
||||
override fun getComponentGraphics(g: Graphics): Graphics {
|
||||
return InternalUICustomization.runGlobalCGTransformWithInactiveFrameSupport(this, g)
|
||||
}
|
||||
|
||||
suspend fun init(customTitleBar: WindowDecorations.CustomTitleBar? = null) {
|
||||
val schema = CustomActionsSchema.getInstanceAsync()
|
||||
@@ -301,9 +303,12 @@ class MainToolbar(
|
||||
}
|
||||
}
|
||||
|
||||
// todo remove with isIjpl217440 property
|
||||
override fun paintChildren(g: Graphics) {
|
||||
super.paintChildren(g)
|
||||
borderPainter.paintAfterChildren(this, g)
|
||||
if (!isIjpl217440) {
|
||||
borderPainter.paintAfterChildren(this, g)
|
||||
}
|
||||
}
|
||||
|
||||
private fun installClickListener(popupHandler: PopupHandler, customTitleBar: WindowDecorations.CustomTitleBar?) {
|
||||
|
||||
@@ -10,6 +10,8 @@ import com.intellij.internal.statistic.service.fus.collectors.UIEventLogger.Stat
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.actionSystem.*
|
||||
import com.intellij.openapi.application.*
|
||||
import com.intellij.openapi.application.impl.InternalUICustomization
|
||||
import com.intellij.openapi.application.impl.islands.isIjpl217440
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.components.serviceAsync
|
||||
import com.intellij.openapi.diagnostic.debug
|
||||
@@ -57,7 +59,6 @@ import com.intellij.ui.util.height
|
||||
import com.intellij.util.EventDispatcher
|
||||
import com.intellij.util.concurrency.annotations.RequiresEdt
|
||||
import com.intellij.util.ui.EdtInvocationManager
|
||||
import com.intellij.util.ui.JBSwingUtilities
|
||||
import com.intellij.util.ui.JBUI
|
||||
import com.intellij.util.ui.UIUtil
|
||||
import kotlinx.coroutines.*
|
||||
@@ -126,6 +127,7 @@ open class IdeStatusBarImpl @Internal constructor(
|
||||
|
||||
private val progressFlow = MutableSharedFlow<ProgressSetChangeEvent>(replay = 1, extraBufferCapacity = Int.MAX_VALUE)
|
||||
|
||||
// todo remove with isIjpl217440 property
|
||||
internal var borderPainter: BorderPainter = DefaultBorderPainter()
|
||||
|
||||
companion object {
|
||||
@@ -555,7 +557,9 @@ open class IdeStatusBarImpl @Internal constructor(
|
||||
override fun paintChildren(g: Graphics) {
|
||||
effectRenderer.paintBackground(g)
|
||||
super.paintChildren(g)
|
||||
borderPainter.paintAfterChildren(this, g)
|
||||
if (!isIjpl217440) {
|
||||
borderPainter.paintAfterChildren(this, g)
|
||||
}
|
||||
}
|
||||
|
||||
private fun dispatchMouseEvent(e: MouseEvent): Boolean {
|
||||
@@ -635,7 +639,7 @@ open class IdeStatusBarImpl @Internal constructor(
|
||||
}
|
||||
|
||||
override fun getComponentGraphics(g: Graphics): Graphics {
|
||||
return JBSwingUtilities.runGlobalCGTransform(this, super.getComponentGraphics(g))
|
||||
return InternalUICustomization.runGlobalCGTransformWithInactiveFrameSupport(this, super.getComponentGraphics(g))
|
||||
}
|
||||
|
||||
override fun removeWidget(id: String) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.intellij.ide.ui.UISettingsListener
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.impl.BorderPainterHolder
|
||||
import com.intellij.openapi.application.impl.InternalUICustomization
|
||||
import com.intellij.openapi.application.impl.islands.isIjpl217440
|
||||
import com.intellij.openapi.diagnostic.debug
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.ui.Divider
|
||||
@@ -399,7 +400,9 @@ class ToolWindowPane private constructor(
|
||||
|
||||
override fun paintChildren(g: Graphics) {
|
||||
super.paintChildren(g)
|
||||
borderPainter.paintAfterChildren(this, g)
|
||||
if (!isIjpl217440) {
|
||||
borderPainter.paintAfterChildren(this, g)
|
||||
}
|
||||
}
|
||||
|
||||
val bottomHeight: Int
|
||||
|
||||
@@ -4,6 +4,8 @@ package com.intellij.toolWindow
|
||||
|
||||
import com.intellij.accessibility.AccessibilityUtils
|
||||
import com.intellij.openapi.application.impl.BorderPainterHolder
|
||||
import com.intellij.openapi.application.impl.InternalUICustomization
|
||||
import com.intellij.openapi.application.impl.islands.isIjpl217440
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.ui.VerticalFlowLayout
|
||||
import com.intellij.openapi.util.NlsSafe
|
||||
@@ -109,9 +111,16 @@ abstract class ToolWindowToolbar(private val isPrimary: Boolean, val anchor: Too
|
||||
open fun createBorder():Border = JBUI.Borders.empty()
|
||||
open fun getBorderColor(): Color? = JBUI.CurrentTheme.ToolWindow.borderColor()
|
||||
|
||||
// todo remove with isIjpl217440 property
|
||||
override fun paint(g: Graphics) {
|
||||
super.paint(g)
|
||||
borderPainter.paintAfterChildren(this, g)
|
||||
if (!isIjpl217440) {
|
||||
borderPainter.paintAfterChildren(this, g)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getComponentGraphics(graphics: Graphics?): Graphics? {
|
||||
return InternalUICustomization.runGlobalCGTransformWithInactiveFrameSupport(this, graphics as Graphics2D)
|
||||
}
|
||||
|
||||
internal abstract fun getStripeFor(anchor: ToolWindowAnchor): AbstractDroppableStripe
|
||||
@@ -175,9 +184,9 @@ abstract class ToolWindowToolbar(private val isPrimary: Boolean, val anchor: Too
|
||||
}
|
||||
|
||||
internal class StripeV2(private val toolBar: ToolWindowToolbar,
|
||||
paneId: String,
|
||||
override val anchor: ToolWindowAnchor,
|
||||
override val split: Boolean = false,
|
||||
paneId: String,
|
||||
override val anchor: ToolWindowAnchor,
|
||||
override val split: Boolean = false,
|
||||
layout : LayoutManager = VerticalFlowLayout(0, 0)
|
||||
) : AbstractDroppableStripe(paneId, layout) {
|
||||
var bottomAnchorDropAreaComponent: JComponent? = null
|
||||
@@ -236,6 +245,10 @@ abstract class ToolWindowToolbar(private val isPrimary: Boolean, val anchor: Too
|
||||
return super.containsPoint(screenPoint)
|
||||
}
|
||||
|
||||
override fun getComponentGraphics(graphics: Graphics?): Graphics {
|
||||
return InternalUICustomization.runGlobalCGTransformWithInactiveFrameSupport(this, graphics as Graphics2D)
|
||||
}
|
||||
|
||||
private fun getFirstVisibleToolWindowSize(width: Boolean): Int {
|
||||
for (button in getButtons()) {
|
||||
if (button.toolWindow.isVisible) {
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.impl.BorderPainterHolder;
|
||||
import com.intellij.openapi.application.impl.InternalUICustomization;
|
||||
import com.intellij.openapi.application.impl.islands.IslandsUICustomizationKt;
|
||||
import com.intellij.openapi.components.ComponentManagerEx;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -71,6 +72,7 @@ public final class WindowTabsComponent extends JBTabsImpl implements BorderPaint
|
||||
private final Disposable myParentDisposable;
|
||||
private final Map<IdeFrameImpl, Integer> myIndexes = new HashMap<>();
|
||||
|
||||
// todo remove with isIjpl217440 property
|
||||
private BorderPainter borderPainter = new DefaultBorderPainter();
|
||||
|
||||
public WindowTabsComponent(@NotNull IdeFrameImpl nativeWindow, @Nullable Project project, @NotNull Disposable parentDisposable) {
|
||||
@@ -141,10 +143,13 @@ public final class WindowTabsComponent extends JBTabsImpl implements BorderPaint
|
||||
return new Dimension(super.getPreferredSize().width, JBUI.scale(TAB_HEIGHT));
|
||||
}
|
||||
|
||||
// todo remove with isIjpl217440 property
|
||||
@Override
|
||||
public void paintChildren(Graphics g) {
|
||||
super.paintChildren(g);
|
||||
borderPainter.paintAfterChildren(this, g);
|
||||
if (!IslandsUICustomizationKt.isIjpl217440()) {
|
||||
borderPainter.paintAfterChildren(this, g);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2359,6 +2359,9 @@ station.enable.welcome.screen.promo.description=Enables promo for Toolbox App
|
||||
|
||||
idea.islands.color.gradient.enabled=false
|
||||
idea.islands.color.gradient.enabled.description=Enable gradient backgrounds for UI Islands color scheme elements
|
||||
idea.islands.ijpl217440.enabled=false
|
||||
idea.islands.ijpl217440.enabled.description=Enables IJPL-217440: Rework the inactive window rendering mechanism. Instead of restarting switching themes can be used
|
||||
idea.islands.ijpl217440.enabled.restartRequired=true
|
||||
|
||||
vfs.fetch.case.sensitivity.using.eel=true
|
||||
vfs.fetch.case.sensitivity.using.eel.description=Enable directory case sensitivity fetching using EEL on WSL and Docker. \
|
||||
|
||||
Reference in New Issue
Block a user