-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicitly call virtual method to be compatible with 192 branch
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
idea/src/org/jetbrains/kotlin/idea/highlighter/markers/dslStyleIcon.kt.192
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license | ||
* that can be found in the license/LICENSE.txt file. | ||
*/ | ||
|
||
package org.jetbrains.kotlin.idea.highlighter.markers | ||
|
||
import com.intellij.openapi.editor.colors.EditorColorsManager | ||
import com.intellij.openapi.util.ScalableIcon | ||
import com.intellij.ui.LayeredIcon | ||
import com.intellij.util.ui.ColorsIcon | ||
import com.intellij.util.ui.JBUI | ||
import org.jetbrains.kotlin.idea.KotlinIcons | ||
import org.jetbrains.kotlin.idea.highlighter.dsl.DslHighlighterExtension | ||
import javax.swing.Icon | ||
|
||
// BUNCH: 182 | ||
// BUNCH: as35 | ||
// BUNCH: as34 | ||
internal fun createDslStyleIcon(styleId: Int): Icon { | ||
val globalScheme = EditorColorsManager.getInstance().globalScheme | ||
val markersColor = globalScheme.getAttributes(DslHighlighterExtension.styleById(styleId)).foregroundColor | ||
val icon = LayeredIcon(2) | ||
val defaultIcon = KotlinIcons.DSL_MARKER_ANNOTATION | ||
icon.setIcon(defaultIcon, 0) | ||
icon.setIcon( | ||
(ColorsIcon(defaultIcon.iconHeight / 2, markersColor) as ScalableIcon).scale(JBUI.pixScale()), | ||
1, | ||
defaultIcon.iconHeight / 2, | ||
defaultIcon.iconWidth / 2 | ||
) | ||
return icon | ||
} |