[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
This commit is contained in:
Sergei Tachenov
2025-11-03 21:35:27 +00:00
committed by intellij-monorepo-bot
parent abd4080c6c
commit 59e5932730
@@ -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()