Skip to content

Commit 52eb974

Browse files
committed
Upgrade logo
1 parent 0d742a2 commit 52eb974

File tree

11 files changed

+21
-23
lines changed

11 files changed

+21
-23
lines changed

README-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Sbt Dependency Analyzer for IntelliJ IDEA
22
---------
33

4-
<img src="./logo.png" width = "200" height = "100" alt="logo" align="right" />
4+
<img src="./logo.svg" width = "250" height = "150" alt="logo" align="right" />
55

66
[![Build](https://github.com/bitlap/intellij-sbt-dependency-analyzer/actions/workflows/ScalaCI.yml/badge.svg)](https://github.com/bitlap/intellij-sbt-dependency-analyzer/actions/workflows/ScalaCI.yml)
77
[![Version](https://img.shields.io/jetbrains/plugin/v/22427-sbt-dependency-analyzer?label=Version)](https://plugins.jetbrains.com/plugin/22427-sbt-dependency-analyzer/versions)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Sbt Dependency Analyzer for IntelliJ IDEA
22
---------
33

4-
<img src="./logo.png" width = "200" height = "100" alt="logo" align="right" />
4+
<img src="./logo.svg" width = "250" height = "150" alt="logo" align="right" />
55

66
[![Build](https://github.com/bitlap/intellij-sbt-dependency-analyzer/actions/workflows/ScalaCI.yml/badge.svg)](https://github.com/bitlap/intellij-sbt-dependency-analyzer/actions/workflows/ScalaCI.yml)
77
[![Version](https://img.shields.io/jetbrains/plugin/v/22427-sbt-dependency-analyzer?label=Version)](https://plugins.jetbrains.com/plugin/22427-sbt-dependency-analyzer/versions)

logo.png

-31.9 KB
Binary file not shown.

logo.svg

Lines changed: 1 addition & 0 deletions
Loading

src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/ExternalProjectUiUtil.kt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import com.intellij.openapi.observable.util.whenMousePressed
1616
import com.intellij.ui.ListUtil
1717
import com.intellij.ui.components.DropDownLink
1818
import com.intellij.ui.components.JBList
19+
import com.intellij.util.ui.EmptyIcon
1920
import com.intellij.util.ui.JBUI
2021

2122
@Suppress("DEPRECATION")
@@ -24,10 +25,17 @@ internal class ExternalProjectSelector(
2425
externalProjects: List<DependencyAnalyzerProject>,
2526
private val iconProvider: ExternalSystemIconProvider
2627
) : JPanel() {
28+
29+
private val projectIcon = if (iconProvider.projectIcon is EmptyIcon) {
30+
PROJECT_ICON
31+
} else {
32+
iconProvider.projectIcon
33+
}
34+
2735
init {
2836
val dropDownLink = ExternalProjectDropDownLink(property, externalProjects)
2937
.apply { border = JBUI.Borders.empty(BORDER, ICON_TEXT_GAP / 2, BORDER, BORDER) }
30-
val label = JLabel(iconProvider.projectIcon)
38+
val label = JLabel(projectIcon)
3139
.apply { border = JBUI.Borders.empty(BORDER, BORDER, BORDER, ICON_TEXT_GAP / 2) }
3240
.apply { labelFor = dropDownLink }
3341

@@ -70,7 +78,7 @@ internal class ExternalProjectSelector(
7078
cellHasFocus: Boolean
7179
): Component {
7280
return JLabel()
73-
.apply { if (value != null) icon = iconProvider.projectIcon }
81+
.apply { if (value != null) icon = projectIcon }
7482
.apply { if (value != null) text = value.title }
7583
.apply { border = emptyListCellBorder(list, index) }
7684
.apply { iconTextGap = JBUI.scale(ICON_TEXT_GAP) }
@@ -93,7 +101,7 @@ internal class ExternalProjectSelector(
93101
super.popupPoint()
94102
.apply { x += insets.left }
95103
.apply { x -= JBUI.scale(BORDER) }
96-
.apply { x -= iconProvider.projectIcon.iconWidth }
104+
.apply { x -= projectIcon.iconWidth }
97105
.apply { x -= JBUI.scale(ICON_TEXT_GAP) }
98106

99107
override fun itemToString(item: DependencyAnalyzerProject?): String = when (item) {

src/main/kotlin/bitlap/sbt/analyzer/jbexternal/util/UiUtils.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
22
package bitlap.sbt.analyzer.jbexternal.util
33

4+
import bitlap.sbt.analyzer.jbexternal.DependencyAnalyzerManager
45
import java.awt.BorderLayout
56
import javax.swing.JComponent
67
import javax.swing.JLabel
78
import javax.swing.JList
89
import javax.swing.JPanel
910
import javax.swing.JTree
11+
import javax.swing.Icon
1012
import javax.swing.border.Border
1113

1214
import com.intellij.icons.AllIcons
@@ -26,6 +28,7 @@ import com.intellij.openapi.observable.util.bind
2628
import com.intellij.openapi.project.DumbAware
2729
import com.intellij.openapi.ui.SimpleToolWindowPanel
2830
import com.intellij.openapi.util.Disposer
31+
import com.intellij.openapi.util.IconLoader
2932
import com.intellij.ui.CardLayoutPanel
3033
import com.intellij.ui.OnePixelSplitter
3134
import com.intellij.ui.components.JBLoadingPanel
@@ -34,6 +37,7 @@ import com.intellij.util.ui.components.BorderLayoutPanel
3437
import com.intellij.util.ui.tree.TreeUtil
3538

3639

40+
internal val PROJECT_ICON: Icon = IconLoader.getIcon("/icons/sbt_dependency_analyzer.svg", DependencyAnalyzerManager::class.java)
3741
internal const val BORDER = 6
3842
internal const val INDENT = 16
3943
internal const val ICON_TEXT_GAP = 4
-31.9 KB
Binary file not shown.
Lines changed: 1 addition & 17 deletions
Loading
-999 Bytes
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)