mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
IJPL-183113 IDE identity concept: color keys for main window
GitOrigin-RevId: 82ef3b4448e0f1bb7628d21e1100148cd4145b9e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
61eb40745b
commit
bb66ea709c
@@ -3,6 +3,8 @@
|
||||
|
||||
package com.intellij.ui.tabs.impl
|
||||
|
||||
import com.intellij.ide.ui.NavBarLocation
|
||||
import com.intellij.ide.ui.UISettings
|
||||
import com.intellij.openapi.rd.paint2DLine
|
||||
import com.intellij.openapi.util.registry.Registry
|
||||
import com.intellij.ui.ExperimentalUI
|
||||
@@ -72,8 +74,7 @@ class JBEditorTabsBorder(tabs: JBTabsImpl) : JBTabsBorder(tabs) {
|
||||
g as Graphics2D
|
||||
|
||||
if (ExperimentalUI.isNewUI()) {
|
||||
g.paint2DLine(Point(x, y), Point(x + width, y), LinePainter2D.StrokeType.INSIDE,
|
||||
thickness.toDouble(), JBUI.CurrentTheme.MainToolbar.borderColor())
|
||||
g.paint2DLine(Point(x, y), Point(x + width, y), LinePainter2D.StrokeType.INSIDE, thickness.toDouble(), getBorderColor())
|
||||
}
|
||||
else {
|
||||
tabs.tabPainter.paintBorderLine(g, thickness, Point(x, y), Point(x + width, y))
|
||||
@@ -126,6 +127,13 @@ class JBEditorTabsBorder(tabs: JBTabsImpl) : JBTabsBorder(tabs) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun getBorderColor(): Color {
|
||||
val uiSettings = UISettings.getInstance()
|
||||
if (uiSettings.showNavigationBar && uiSettings.navBarLocation == NavBarLocation.TOP) {
|
||||
return JBUI.CurrentTheme.EditorTabs.borderColor()
|
||||
}
|
||||
return JBUI.CurrentTheme.MainToolbar.borderColor()
|
||||
}
|
||||
|
||||
private fun calcRectangle(): Rectangle? {
|
||||
val selectedLabel = tabs.selectedLabel ?: return null
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.intellij.toolWindow
|
||||
|
||||
import com.intellij.accessibility.AccessibilityUtils
|
||||
import com.intellij.ide.IdeBundle
|
||||
import com.intellij.ide.ui.NavBarLocation
|
||||
import com.intellij.ide.ui.UISettings
|
||||
import com.intellij.openapi.actionSystem.*
|
||||
import com.intellij.openapi.actionSystem.impl.ActionButton
|
||||
import com.intellij.openapi.application.impl.InternalUICustomization
|
||||
@@ -578,7 +580,7 @@ class InternalDecoratorImpl internal constructor(
|
||||
height: Int,
|
||||
) {
|
||||
if (insets.top > 0) {
|
||||
g.color = JBUI.CurrentTheme.MainToolbar.borderColor()
|
||||
g.color = getTopBorderColor()
|
||||
LinePainter2D.paint(g, x.toDouble(), (y + insets.top - 1).toDouble(), (x + width - 1).toDouble(),
|
||||
(y + insets.top - 1).toDouble())
|
||||
LinePainter2D.paint(g, x.toDouble(), (y + insets.top).toDouble(), (x + width - 1).toDouble(), (y + insets.top).toDouble())
|
||||
@@ -600,6 +602,14 @@ class InternalDecoratorImpl internal constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun getTopBorderColor(): Color {
|
||||
val uiSettings = UISettings.getInstance()
|
||||
if (!toolWindow.toolWindowManager.isNewUi || uiSettings.showNavigationBar && uiSettings.navBarLocation == NavBarLocation.TOP) {
|
||||
return JBColor.border()
|
||||
}
|
||||
return JBUI.CurrentTheme.MainToolbar.borderColor()
|
||||
}
|
||||
|
||||
private fun doPaintInternalBorder(
|
||||
g: Graphics2D,
|
||||
insets: Insets,
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
package com.intellij.toolWindow
|
||||
|
||||
import com.intellij.accessibility.AccessibilityUtils
|
||||
import com.intellij.ide.ui.NavBarLocation
|
||||
import com.intellij.ide.ui.UISettings
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.ui.VerticalFlowLayout
|
||||
import com.intellij.openapi.util.NlsSafe
|
||||
@@ -13,6 +15,7 @@ import com.intellij.openapi.wm.impl.AbstractDroppableStripe
|
||||
import com.intellij.openapi.wm.impl.LayoutData
|
||||
import com.intellij.openapi.wm.impl.SquareStripeButton
|
||||
import com.intellij.ui.ComponentUtil
|
||||
import com.intellij.ui.JBColor
|
||||
import com.intellij.ui.UIBundle
|
||||
import com.intellij.ui.components.JBPanel
|
||||
import com.intellij.util.ui.JBUI
|
||||
@@ -46,7 +49,7 @@ abstract class ToolWindowToolbar(private val isPrimary: Boolean, val anchor: Too
|
||||
background = JBUI.CurrentTheme.ToolWindow.stripeBackground()
|
||||
|
||||
val topWrapper = JBPanel<JBPanel<*>>(BorderLayout()).apply {
|
||||
border = JBUI.Borders.customLineTop(JBUI.CurrentTheme.MainToolbar.borderColor())
|
||||
border = JBUI.Borders.customLineTop(getTopBorderColor())
|
||||
}
|
||||
border = createBorder()
|
||||
topStripe.background = JBUI.CurrentTheme.ToolWindow.stripeBackground()
|
||||
@@ -103,6 +106,18 @@ 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()
|
||||
|
||||
private fun getTopBorderColor(): Color {
|
||||
return JBColor.lazy {
|
||||
val uiSettings = UISettings.getInstance()
|
||||
if (uiSettings.showNavigationBar && uiSettings.navBarLocation == NavBarLocation.TOP) {
|
||||
JBUI.CurrentTheme.ToolWindow.borderColor()
|
||||
}
|
||||
else {
|
||||
JBUI.CurrentTheme.MainToolbar.borderColor()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal abstract fun getStripeFor(anchor: ToolWindowAnchor): AbstractDroppableStripe
|
||||
|
||||
internal fun getButtonFor(toolWindowId: String): StripeButtonManager? {
|
||||
|
||||
Reference in New Issue
Block a user