Fixed DSL Marker icon
#KT-30470 Fixed
This commit is contained in:
@@ -49,6 +49,8 @@ public interface KotlinIcons {
|
||||
Icon CLASS_INITIALIZER = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/classInitializerKotlin." + IconExtensionChooser.iconExtension());
|
||||
Icon TYPE_ALIAS = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/typeAlias." + IconExtensionChooser.iconExtension());
|
||||
|
||||
Icon DSL_MARKER_ANNOTATION = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/dslMarkerAnnotation.svg");
|
||||
|
||||
Icon SUSPEND_CALL = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/suspendCall." + IconExtensionChooser.iconExtension());
|
||||
|
||||
Icon ACTUAL = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/actual." + IconExtensionChooser.iconExtension());
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12">
|
||||
<path fill="#6E6E6E" fill-rule="evenodd" d="M5,6.65682683 L5,7.49348816 C4.95369035,7.49782933 4.90748201,7.5 4.861375,7.5 C3.84956488,7.5 2.500125,7.401375 2.500125,5.000125 C2.500125,2.90054321 4.31991577,2.500125 5.000125,2.500125 C5.191375,2.500125 7.181375,2.568875 7.280125,2.598875 L7.18904392,5 L5.95872887,5 C5.96186764,4.95605795 5.96442253,4.91149886 5.966375,4.866375 L6.052625,3.373875 L6.000125,3.361375 C5.856375,3.327625 5.747625,3.310125 5.625125,3.296375 C5.502625,3.283875 5.380125,3.277625 5.252625,3.277625 C4.972625,3.277625 4.732625,3.335125 4.535125,3.451375 C4.341375,3.563875 4.181375,3.717625 4.057625,3.905125 C3.938875,4.090125 3.851375,4.301375 3.798875,4.532625 C3.746375,4.761375 3.720125,4.995125 3.720125,5.230125 C3.720125,5.732625 3.811375,6.090125 3.996375,6.322625 C4.186375,6.560125 4.442625,6.681375 4.756375,6.681375 C4.84197941,6.681375 4.92327711,6.67319228 5,6.65682683 Z M9.97741689,5 L8.77592721,5 C8.81405384,4.73647037 8.825125,4.51994511 8.825125,4.433875 C8.825125,1.13426208 5.885125,0.931375 5.395125,0.931375 C4.713875,0.931375 1.1794281,1.06361389 1.1794281,5.00075 C1.1794281,5.73002889 1.1794281,9.057625 4.861375,9.057625 C4.88821817,9.057625 4.93579286,9.05472758 5,9.04922421 L5,9.99922003 C4.95798864,9.99981871 4.91553009,10.000125 4.872625,10.000125 C3.94470215,10.000125 0.002625,10.000125 0.002625,5.00075 C0.002625,0.001375 4.58427429,0.001375 5.395125,0.001375 C5.81382056,0.001375 10.000125,0.108036255 10.000125,4.446375 C10.000125,4.64334913 9.99225205,4.82761761 9.97741689,5 Z" transform="translate(1 1)"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12">
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path fill="#AFB1B3" d="M5,6.65682683 L5,7.49348816 C4.95369035,7.49782933 4.90748201,7.5 4.861375,7.5 C3.84956488,7.5 2.500125,7.401375 2.500125,5.000125 C2.500125,2.90054321 4.31991577,2.500125 5.000125,2.500125 C5.191375,2.500125 7.181375,2.568875 7.280125,2.598875 L7.18904392,5 L5.95872887,5 C5.96186764,4.95605795 5.96442253,4.91149886 5.966375,4.866375 L6.052625,3.373875 L6.000125,3.361375 C5.856375,3.327625 5.747625,3.310125 5.625125,3.296375 C5.502625,3.283875 5.380125,3.277625 5.252625,3.277625 C4.972625,3.277625 4.732625,3.335125 4.535125,3.451375 C4.341375,3.563875 4.181375,3.717625 4.057625,3.905125 C3.938875,4.090125 3.851375,4.301375 3.798875,4.532625 C3.746375,4.761375 3.720125,4.995125 3.720125,5.230125 C3.720125,5.732625 3.811375,6.090125 3.996375,6.322625 C4.186375,6.560125 4.442625,6.681375 4.756375,6.681375 C4.84197941,6.681375 4.92327711,6.67319228 5,6.65682683 Z M9.97741689,5 L8.77592721,5 C8.81405384,4.73647037 8.825125,4.51994511 8.825125,4.433875 C8.825125,1.13426208 5.885125,0.931375 5.395125,0.931375 C4.713875,0.931375 1.1794281,1.06361389 1.1794281,5.00075 C1.1794281,5.73002889 1.1794281,9.057625 4.861375,9.057625 C4.88821817,9.057625 4.93579286,9.05472758 5,9.04922421 L5,9.99922003 C4.95798864,9.99981871 4.91553009,10.000125 4.872625,10.000125 C3.94470215,10.000125 0.002625,10.000125 0.002625,5.00075 C0.002625,0.001375 4.58427429,0.001375 5.395125,0.001375 C5.81382056,0.001375 10.000125,0.108036255 10.000125,4.446375 C10.000125,4.64334913 9.99225205,4.82761761 9.97741689,5 Z" transform="translate(1 1)"/>
|
||||
<path fill="#AFB1B3" d="M5,6.65682683 L5,7.49348816 C4.95369035,7.49782933 4.90748201,7.5 4.861375,7.5 C3.84956488,7.5 2.500125,7.401375 2.500125,5.000125 C2.500125,2.90054321 4.31991577,2.500125 5.000125,2.500125 C5.191375,2.500125 7.181375,2.568875 7.280125,2.598875 L7.18904392,5 L5.95872887,5 C5.96186764,4.95605795 5.96442253,4.91149886 5.966375,4.866375 L6.052625,3.373875 L6.000125,3.361375 C5.856375,3.327625 5.747625,3.310125 5.625125,3.296375 C5.502625,3.283875 5.380125,3.277625 5.252625,3.277625 C4.972625,3.277625 4.732625,3.335125 4.535125,3.451375 C4.341375,3.563875 4.181375,3.717625 4.057625,3.905125 C3.938875,4.090125 3.851375,4.301375 3.798875,4.532625 C3.746375,4.761375 3.720125,4.995125 3.720125,5.230125 C3.720125,5.732625 3.811375,6.090125 3.996375,6.322625 C4.186375,6.560125 4.442625,6.681375 4.756375,6.681375 C4.84197941,6.681375 4.92327711,6.67319228 5,6.65682683 Z M9.97741689,5 L8.77592721,5 C8.81405384,4.73647037 8.825125,4.51994511 8.825125,4.433875 C8.825125,1.13426208 5.885125,0.931375 5.395125,0.931375 C4.713875,0.931375 1.1794281,1.06361389 1.1794281,5.00075 C1.1794281,5.73002889 1.1794281,9.057625 4.861375,9.057625 C4.88821817,9.057625 4.93579286,9.05472758 5,9.04922421 L5,9.99922003 C4.95798864,9.99981871 4.91553009,10.000125 4.872625,10.000125 C3.94470215,10.000125 0.002625,10.000125 0.002625,5.00075 C0.002625,0.001375 4.58427429,0.001375 5.395125,0.001375 C5.81382056,0.001375 10.000125,0.108036255 10.000125,4.446375 C10.000125,4.64334913 9.99225205,4.82761761 9.97741689,5 Z" transform="translate(1 1)"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.2 KiB |
@@ -10,11 +10,11 @@
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<path fill="#9AA7B0" fill-opacity=".8" d="M14.9593166,8 L8,8 L8,12.2027086 C7.46565017,12.3188603 6.96760481,12.8206291 6.62193929,14 L5.2613821,14 C4.98281046,11.9750823 3.35743823,11.89756 2.90282898,14 L1.11976134,14 C1.11976134,14 0.148334564,8.28999559 3.73881369,6.99656509 C3.73881369,6.99656509 4.06519636,7.77188831 4.48524548,8.44439933 C4.95135228,9.19055476 6.16655453,9.70626797 7.58416127,7.57182773 C7.58416127,7.57182773 5.68119521,9.68515927 4.81183043,8.23786454 C4.26449884,7.32661614 4.45159568,7.66438904 3.88713574,6.56356698 C3.47177332,5.75351221 3.95494106,5.4032292 5.00607535,5.05493565 C6.05724334,4.70657467 8.37897727,4.13387474 10.7664935,5.86225912 C13.153976,7.59064349 15.0613253,5.09475891 14.4434573,3.88205401 C14.1809013,3.36677919 13.7895455,3.18131937 13.4949582,3.1462506 C13.1867828,3.10956328 12.9150895,3.15424223 12.6608617,3.29225806 C12.5757257,3.33848814 12.3326583,3.49413951 12.196879,3.29154994 C12.1030777,3.15154464 11.9502713,2.81235548 11.9230952,2.74737711 C11.7964871,2.44470668 12.4659087,1.98365356 13.2809887,2.00044611 C13.9453191,2.01413641 14.8856586,2.30291422 15.411782,3.26915988 C16.2865871,4.79241848 15.7346628,6.50274839 14.9593166,8 Z"/>
|
||||
<g transform="translate(9 9)">
|
||||
<polygon fill="#0EAEFF" fill-rule="nonzero" points="0 7 3.512 3.488 7 7"/>
|
||||
<polygon fill="#0EAEFF" fill-rule="nonzero" points="0 0 3.512 0 0 3.792"/>
|
||||
<polygon fill="url(#kotlin_gradle_script-a)" fill-rule="nonzero" points="3.512 0 0 3.698 0 7 3.512 3.488 7 0"/>
|
||||
</g>
|
||||
<path fill="#9AA7B0" fill-opacity=".8" d="M8,11.8835562 C7.34792619,11.9938828 6.82763219,12.5177842 6.73846154,13.1928571 C6.72441543,13.304366 6.62996984,13.3882394 6.51758242,13.389011 L5.50549451,13.389011 C5.39282778,13.3889705 5.29796847,13.3047298 5.28461538,13.1928571 C5.18401571,12.43126 4.53469609,11.8620691 3.76648352,11.8620691 C2.99827094,11.8620691 2.34895132,12.43126 2.24835165,13.1928571 C2.23794367,13.3108071 2.13759924,13.400323 2.01923077,13.3972527 L0.984065934,13.3972527 C0.87657333,13.3967131 0.784593729,13.3199481 0.764835165,13.2142857 C0.181318681,10.1747253 1.25934066,7.77472527 3.01483516,6.52527473 L3.93296703,8.10934066 C4.15349312,8.48926563 4.56016448,8.7224574 4.99945055,8.72087912 C5.2078359,8.72133735 5.41280716,8.66796533 5.59450549,8.56593407 L6.02472527,8.32527473 L6.03956044,8.32527473 C6.54724302,8.00930666 7.02602633,7.64911599 7.47032967,7.2489011 C7.5160865,7.20559883 7.54117571,7.14481875 7.53928662,7.08184887 C7.53739752,7.018879 7.5087099,6.95971222 7.46043956,6.91923077 C7.36925385,6.84623809 7.23851675,6.85043286 7.1521978,6.92912088 C6.73006329,7.30380047 6.27677592,7.64183594 5.79725275,7.93956044 L5.37197802,8.17692308 L5.39010989,8.16373626 L5.36703297,8.17692308 C5.00127872,8.38296898 4.53780584,8.25569786 4.32857143,7.89175824 L3.35769231,6.21538462 C3.24953676,6.03055516 3.22363551,5.80890759 3.28626138,5.604121 C3.34888725,5.3993344 3.49432879,5.23008524 3.68736264,5.13736264 C9.34450549,2.44065934 11.8368132,7.67252747 13.7043956,5.80659341 C14.2302016,5.31030007 14.2709593,4.48760862 13.7967823,3.94177424 C13.3226052,3.39593986 12.5022959,3.32127425 11.9373626,3.77252747 C11.8482945,3.83996474 11.7231667,3.83152916 11.643956,3.75274725 L11.3604396,3.46263736 C11.3152865,3.4196968 11.2897252,3.36011347 11.2897252,3.2978022 C11.2897252,3.23549093 11.3152865,3.1759076 11.3604396,3.13296703 C12.2870627,2.26771896 13.7327043,2.29250555 14.6291209,3.18901099 C15.3644528,3.92434286 16.1838656,5.75506282 14.1739533,8 L8,8 L8,11.8835562 Z M10.7802198,7.4532967 L10.7802198,7.45494505 C10.9512714,7.32835109 11.0107505,7.09952965 10.9229983,6.90566309 C10.8352462,6.71179653 10.6240715,6.60548435 10.4160772,6.65046251 C10.2080828,6.69544067 10.0597014,6.8795058 10.0598901,7.09230769 L10.7802198,7.4532967 Z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -13,11 +13,13 @@ import com.intellij.ide.DataManager
|
||||
import com.intellij.openapi.editor.colors.EditorColorsManager
|
||||
import com.intellij.openapi.editor.markup.GutterIconRenderer
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.ui.LayeredIcon
|
||||
import com.intellij.util.Function
|
||||
import com.intellij.util.ui.ColorsIcon
|
||||
import com.intellij.util.ui.JBUI
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.idea.KotlinIcons
|
||||
import org.jetbrains.kotlin.idea.KotlinLanguage
|
||||
import org.jetbrains.kotlin.idea.core.toDescriptor
|
||||
import org.jetbrains.kotlin.idea.highlighter.dsl.DslHighlighterExtension
|
||||
@@ -28,7 +30,7 @@ import javax.swing.JComponent
|
||||
|
||||
private val navHandler = GutterIconNavigationHandler<PsiElement> { event, element ->
|
||||
val dataContext = (event.component as? JComponent)?.let { DataManager.getInstance().getDataContext(it) }
|
||||
?: return@GutterIconNavigationHandler
|
||||
?: return@GutterIconNavigationHandler
|
||||
val ktClass = element?.parent as? KtClass ?: return@GutterIconNavigationHandler
|
||||
val styleId = ktClass.styleIdForMarkerAnnotation() ?: return@GutterIconNavigationHandler
|
||||
ColorAndFontOptions.selectOrEditColor(dataContext, DslHighlighterExtension.styleOptionDisplayName(styleId), KotlinLanguage.NAME)
|
||||
@@ -61,8 +63,16 @@ fun collectHighlightingColorsMarkers(
|
||||
private fun createIcon(styleId: Int): Icon {
|
||||
val globalScheme = EditorColorsManager.getInstance().globalScheme
|
||||
val markersColor = globalScheme.getAttributes(DslHighlighterExtension.styleById(styleId)).foregroundColor
|
||||
val defaultColor = globalScheme.defaultForeground
|
||||
return JBUI.scale(ColorsIcon(12, markersColor, defaultColor, defaultColor, markersColor))
|
||||
val icon = LayeredIcon(2)
|
||||
val defaultIcon = KotlinIcons.DSL_MARKER_ANNOTATION
|
||||
icon.setIcon(defaultIcon, 0)
|
||||
icon.setIcon(
|
||||
ColorsIcon(defaultIcon.iconHeight / 2, markersColor).scale(JBUI.pixScale()),
|
||||
1,
|
||||
defaultIcon.iconHeight / 2,
|
||||
defaultIcon.iconWidth / 2
|
||||
)
|
||||
return icon
|
||||
}
|
||||
|
||||
private fun KtClass.styleIdForMarkerAnnotation(): Int? {
|
||||
|
||||
Reference in New Issue
Block a user