chore: changed use Color in SDProblem instead of String

This commit is contained in:
Alexander Klee 2024-05-31 20:40:53 +02:00 committed by JFronny
parent 3c786c2e1d
commit bdd107e7c5
Signed by: Johannes
GPG Key ID: E76429612C2929F4
2 changed files with 5 additions and 3 deletions

View File

@ -71,7 +71,7 @@ class SDProblemSelectionComboBoxAction : ComboBoxAction(), DumbAware {
init {
val name = (if (problem.solved) "" else "") + problem.name
templatePresentation.setText(name, false)
templatePresentation.icon = ColorIcon(13, Color.decode(problem.rgb))
templatePresentation.icon = ColorIcon(13, problem.rgb)
}
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT

View File

@ -1,9 +1,11 @@
package io.gitlab.jfronny.sdom.model
data class SDProblem(val id: String, val name: String, val rgb: String, var solved: Boolean) : Comparable<SDProblem> {
import java.awt.Color
data class SDProblem(val id: String, val name: String, val rgb: Color, var solved: Boolean) : Comparable<SDProblem> {
companion object {
fun of(problem: Problem, solved: Boolean): SDProblem {
return SDProblem(problem.id, problem.name, problem.rgb, solved)
return SDProblem(problem.id, problem.name, Color.decode(problem.rgb), solved)
}
}