FIR IDE: add fir icon to status bar to distinguish fir/fe10 ide
This commit is contained in:
committed by
teamcityserver
parent
8977e7766b
commit
af7766b3ac
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* 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.fir
|
||||||
|
|
||||||
|
import com.intellij.icons.AllIcons
|
||||||
|
import com.intellij.ide.lightEdit.LightEdit
|
||||||
|
import com.intellij.openapi.project.Project
|
||||||
|
import com.intellij.openapi.ui.Messages
|
||||||
|
import com.intellij.openapi.util.Disposer
|
||||||
|
import com.intellij.openapi.wm.StatusBar
|
||||||
|
import com.intellij.openapi.wm.StatusBarWidget
|
||||||
|
import com.intellij.openapi.wm.StatusBarWidgetFactory
|
||||||
|
import com.intellij.util.Consumer
|
||||||
|
import org.jetbrains.kotlin.idea.KotlinIconsIndependent
|
||||||
|
import java.awt.event.MouseEvent
|
||||||
|
import javax.swing.Icon
|
||||||
|
|
||||||
|
internal class FirStatusBarWidgetFactory: StatusBarWidgetFactory {
|
||||||
|
override fun getId(): String = ID
|
||||||
|
|
||||||
|
override fun getDisplayName(): String = "FIR IDE"
|
||||||
|
|
||||||
|
override fun isAvailable(project: Project): Boolean = true
|
||||||
|
|
||||||
|
override fun createWidget(project: Project): StatusBarWidget = Widget()
|
||||||
|
|
||||||
|
override fun disposeWidget(widget: StatusBarWidget) = Disposer.dispose(widget)
|
||||||
|
|
||||||
|
override fun canBeEnabledOn(statusBar: StatusBar): Boolean = true
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val ID = "kotlin.fir.ide"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class Widget : StatusBarWidget, StatusBarWidget.IconPresentation {
|
||||||
|
override fun getPresentation(): StatusBarWidget.WidgetPresentation = this
|
||||||
|
override fun ID(): String = FirStatusBarWidgetFactory.ID
|
||||||
|
override fun getTooltipText(): String = "FIR IDE"
|
||||||
|
override fun getIcon(): Icon = KotlinIconsIndependent.FIR
|
||||||
|
|
||||||
|
override fun dispose() {}
|
||||||
|
override fun install(statusBar: StatusBar) {}
|
||||||
|
override fun getClickConsumer(): Consumer<MouseEvent>? = null
|
||||||
|
}
|
||||||
+1
@@ -35,6 +35,7 @@ public interface KotlinIconsIndependent {
|
|||||||
|
|
||||||
Icon ACTUAL = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/actual.svg");
|
Icon ACTUAL = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/actual.svg");
|
||||||
Icon EXPECT = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/expect.svg");
|
Icon EXPECT = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/expect.svg");
|
||||||
|
Icon FIR = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/fir.svg");
|
||||||
|
|
||||||
Icon LAUNCH = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/kotlin_launch_configuration.svg");
|
Icon LAUNCH = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/kotlin_launch_configuration.svg");
|
||||||
Icon LOAD_SCRIPT_CONFIGURATION = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/loadScriptConfiguration.svg");
|
Icon LOAD_SCRIPT_CONFIGURATION = IconLoader.getIcon("/org/jetbrains/kotlin/idea/icons/loadScriptConfiguration.svg");
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ The Kotlin FIR plugin provides language support in IntelliJ IDEA and Android Stu
|
|||||||
|
|
||||||
<extensions defaultExtensionNs="com.intellij">
|
<extensions defaultExtensionNs="com.intellij">
|
||||||
<!-- fir-specific -->
|
<!-- fir-specific -->
|
||||||
|
<statusBarWidgetFactory implementation="org.jetbrains.kotlin.idea.fir.FirStatusBarWidgetFactory"/>
|
||||||
<projectService serviceInterface="org.jetbrains.kotlin.idea.frontend.api.KtAnalysisSessionProvider"
|
<projectService serviceInterface="org.jetbrains.kotlin.idea.frontend.api.KtAnalysisSessionProvider"
|
||||||
serviceImplementation="org.jetbrains.kotlin.idea.frontend.api.fir.KtFirAnalysisSessionProvider"/>
|
serviceImplementation="org.jetbrains.kotlin.idea.frontend.api.fir.KtFirAnalysisSessionProvider"/>
|
||||||
<applicationService serviceInterface="org.jetbrains.kotlin.idea.references.KotlinReferenceProviderContributor"
|
<applicationService serviceInterface="org.jetbrains.kotlin.idea.references.KotlinReferenceProviderContributor"
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
|
||||||
|
<g>
|
||||||
|
<title>Layer 1</title>
|
||||||
|
<path id="svg_2" d="m1.85687,6.43906l6.5,-6.8125l6.5,6.8125l-13,0z" fill="#007f00"/>
|
||||||
|
<rect id="svg_9" height="3.6875" width="3.125" y="13" x="6.375" fill="#7f3f00"/>
|
||||||
|
<rect id="svg_10" height="0" width="0.0625" y="15.1875" x="27.8125" fill="#7f3f00"/>
|
||||||
|
<path id="svg_12" d="m1.60687,10.50156l6.5,-6.8125l6.5,6.8125l-13,0z" fill="#007f00"/>
|
||||||
|
<path id="svg_13" d="m1.60687,14.50156l6.5,-6.8125l6.5,6.8125l-13,0z" fill="#007f00"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 542 B |
Reference in New Issue
Block a user