summaryrefslogtreecommitdiff
path: root/src/main/kotlin/me/kyren223/trident/SettingsConfigurable.kt
diff options
context:
space:
mode:
authorKyren223 <ulmliad223@gmail.com>2024-05-09 00:41:36 +0300
committerKyren223 <ulmliad223@gmail.com>2024-05-09 00:41:36 +0300
commit1e30fa7ded9939fa45a45f82f84c1e8cd95d68aa (patch)
treef2b60d48330937603a8b068dbb5a983be33d8fb8 /src/main/kotlin/me/kyren223/trident/SettingsConfigurable.kt
parent5da72c7ec98edfab7fbebc335e1a9fba116988a5 (diff)
Refactored a lot of the code and added a bunch of features and settings. Not finished yet but committing, so I can push to GitHub
Diffstat (limited to 'src/main/kotlin/me/kyren223/trident/SettingsConfigurable.kt')
-rw-r--r--src/main/kotlin/me/kyren223/trident/SettingsConfigurable.kt50
1 files changed, 0 insertions, 50 deletions
diff --git a/src/main/kotlin/me/kyren223/trident/SettingsConfigurable.kt b/src/main/kotlin/me/kyren223/trident/SettingsConfigurable.kt
deleted file mode 100644
index 3caaf4b..0000000
--- a/src/main/kotlin/me/kyren223/trident/SettingsConfigurable.kt
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
-package me.kyren223.trident
-
-import com.intellij.openapi.options.Configurable
-import com.intellij.openapi.util.NlsContexts.ConfigurableName
-import javax.swing.JComponent
-
-class SettingsConfigurable : Configurable {
- private var settings: SettingsData? = null
- override fun getDisplayName(): @ConfigurableName String {
- return "Trident Settings"
- }
-
- override fun createComponent(): JComponent {
- settings = SettingsData()
- return settings!!.panel
- }
-
- override fun isModified(): Boolean {
- val settings = SettingsState.instance
- if (settings.width != this.settings!!.getWidth()) return true
- if (settings.height != this.settings!!.getHeight()) return true
- if (settings.fontSize != this.settings!!.getFontSize()) return true
- if (settings.enterToSelect != this.settings!!.getEnterToSelect()) return true
- return false
- }
-
- override fun apply() {
- val settings = SettingsState.instance
- settings.width = this.settings!!.getWidth()
- settings.height = this.settings!!.getHeight()
- settings.fontSize = this.settings!!.getFontSize()
- settings.enterToSelect = this.settings!!.getEnterToSelect()
- }
-
- override fun reset() {
- val settings = SettingsState.instance
- if (this.settings == null) {
- this.settings = SettingsData()
- }
- this.settings!!.setWidth(settings.width)
- this.settings!!.setHeight(settings.height)
- this.settings!!.setFontSize(settings.fontSize)
- this.settings!!.setEnterToSelect(settings.enterToSelect)
- }
-
- override fun disposeUIResources() {
- settings = null
- }
-}