From 59e59327302fafbc276f05b201d4cbe3a63802a5 Mon Sep 17 00:00:00 2001 From: Sergei Tachenov Date: Mon, 3 Nov 2025 10:01:11 +0200 Subject: [PATCH] [UI] IJPL-192439 Enable the background image for the main toolbar It was initially removed because it wasn't supported for the entire header. Now that this has changed, we need to enable it back because it doesn't look good when the toolbar is in a separate row, the header has the background image, but the toolbar does not. (cherry picked from commit 4d674661d6fe7cdbc7a3b0fa50b98f5f16ca5fa6) IJ-CR-180802 GitOrigin-RevId: f34b7e9199b69f9e8281a6ebc6adf802046bf0d3 --- .../com/intellij/openapi/wm/impl/headertoolbar/MainToolbar.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/headertoolbar/MainToolbar.kt b/platform/platform-impl/src/com/intellij/openapi/wm/impl/headertoolbar/MainToolbar.kt index e50f94db96b3..24c503e91170 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/headertoolbar/MainToolbar.kt +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/headertoolbar/MainToolbar.kt @@ -48,6 +48,7 @@ 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 @@ -129,7 +130,6 @@ class MainToolbar( else { DefaultMainToolbarFlavor } - ClientProperty.put(this, IdeBackgroundUtil.NO_BACKGROUND, true) showingScope("Main toolbar update") { ApplicationManager.getApplication().messageBus.connect(this).subscribe(LafManagerListener.TOPIC, LafManagerListener { updateToolbarActions() @@ -181,7 +181,7 @@ class MainToolbar( } } - override fun getComponentGraphics(g: Graphics): Graphics = super.getComponentGraphics(IdeBackgroundUtil.getOriginalGraphics(g)) + override fun getComponentGraphics(g: Graphics): Graphics = JBSwingUtilities.runGlobalCGTransform(this, g) suspend fun init(customTitleBar: WindowDecorations.CustomTitleBar? = null) { val schema = CustomActionsSchema.getInstanceAsync()