Skip to content

Add support for Gateway 2023.2 #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

## Unreleased

### Added
- Support for Gateway 2023.2.

## 2.4.0 - 2023-06-02

### Added
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
pluginGroup=com.coder.gateway
pluginName=coder-gateway
# SemVer format -> https://semver.org
pluginVersion=2.4.0
pluginVersion=2.5.0
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
pluginSinceBuild=223.7571.70
pluginUntilBuild=231.*
pluginUntilBuild=232.*
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
# Gateway available build versions https://www.jetbrains.com/intellij-repository/snapshots and https://www.jetbrains.com/intellij-repository/releases
platformType=GW
platformVersion=231.8109.172-CUSTOM-SNAPSHOT
instrumentationCompiler=231.8109.172-CUSTOM-SNAPSHOT
platformVersion=232.8296.17-CUSTOM-SNAPSHOT
instrumentationCompiler=232.8296.17-CUSTOM-SNAPSHOT
platformDownloadSources=true
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
Expand Down
14 changes: 13 additions & 1 deletion src/main/kotlin/com/coder/gateway/sdk/TemplateIconDownloader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.coder.gateway.icons.CoderIcons
import com.intellij.openapi.components.Service
import com.intellij.openapi.components.service
import com.intellij.ui.JreHiDpiUtil
import com.intellij.ui.paint.alignToInt
import com.intellij.ui.paint.PaintUtil
import com.intellij.ui.scale.JBUIScale
import com.intellij.util.ImageLoader
import com.intellij.util.ui.ImageUtil
Expand All @@ -16,6 +16,16 @@ import java.awt.image.BufferedImage
import java.net.URL
import javax.swing.Icon

fun alignToInt(g: Graphics) {
if (g !is Graphics2D) {
return
}

val rm = PaintUtil.RoundingMode.ROUND_FLOOR_BIAS
PaintUtil.alignTxToInt(g, null, true, true, rm)
PaintUtil.alignClipToInt(g, true, true, rm, rm)
}

@Service(Service.Level.APP)
class TemplateIconDownloader {
private val clientService: CoderRestClientService = service()
Expand Down Expand Up @@ -45,6 +55,8 @@ class TemplateIconDownloader {
return iconForChar(workspaceName.lowercase().first())
}

// We could replace this with com.intellij.ui.icons.toRetinaAwareIcon at
// some point if we want to break support for Gateway < 232.
private fun toRetinaAwareIcon(image: BufferedImage): Icon {
val sysScale = JBUIScale.sysScale()
return object : Icon {
Expand Down