-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a79681c
commit 6ca1e2f
Showing
3 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/main/kotlin/com/github/catppuccin/jetbrains_icons/IconPack.kt
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,11 @@ | ||
package com.github.catppuccin.jetbrains_icons | ||
|
||
import com.github.catppuccin.jetbrains_icons.settings.PluginSettingsState | ||
|
||
class IconPack { | ||
val icons = Icons(PluginSettingsState.instance.variant) | ||
|
||
companion object { | ||
val instance = IconPack() | ||
} | ||
} |
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
11 changes: 5 additions & 6 deletions
11
...kotlin/com/github/catppuccin/jetbrains_icons/decorators/PythonProjectViewNodeDecorator.kt
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 |
---|---|---|
@@ -1,19 +1,18 @@ | ||
package com.github.catppuccin.jetbrains_icons.decorators | ||
|
||
import com.github.catppuccin.jetbrains_icons.Icons | ||
import com.github.catppuccin.jetbrains_icons.settings.PluginSettingsState | ||
import com.github.catppuccin.jetbrains_icons.IconPack | ||
import com.intellij.ide.projectView.ProjectViewNode | ||
import com.intellij.ide.projectView.PresentationData | ||
import com.intellij.ide.projectView.ProjectViewNodeDecorator | ||
|
||
class PythonProjectViewNodeDecorator : ProjectViewNodeDecorator { | ||
private var icons = Icons(PluginSettingsState.instance.variant) | ||
private var icons = IconPack.instance.icons | ||
|
||
override fun decorate(node: ProjectViewNode<*>, data: PresentationData) { | ||
val fileType = node.virtualFile?.name?.split(".")?.last() | ||
val extension = node.virtualFile?.name?.split(".")?.last() | ||
|
||
if (fileType.equals("py")) { | ||
data.setIcon(icons.EXT_TO_ICONS["py"]) | ||
if (extension.equals("py")) { | ||
data.setIcon(icons.EXT_TO_ICONS[extension]) | ||
} | ||
} | ||
} |