mirror of
https://github.com/chylex/IntelliJ-AceJump.git
synced 2024-11-25 17:42:46 +01:00
Compare commits
No commits in common. "9921409aff9e21b79c01557f11435dd6c5aa5fc5" and "d905909e31c40d7ededd9f1a422c6592641d2a8c" have entirely different histories.
9921409aff
...
d905909e31
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
- Add buttons to reset colors to default values in Settings, [#411](https://github.com/acejump/AceJump/issues/411)
|
|
||||||
|
|
||||||
## 3.8.16
|
## 3.8.16
|
||||||
|
|
||||||
- Fix issue with unselectable tags, [#446](https://github.com/acejump/AceJump/issues/446)
|
- Fix issue with unselectable tags, [#446](https://github.com/acejump/AceJump/issues/446)
|
||||||
|
@ -2,14 +2,18 @@ import org.jetbrains.changelog.Changelog.OutputType.HTML
|
|||||||
import org.jetbrains.changelog.date
|
import org.jetbrains.changelog.date
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
idea
|
idea apply true
|
||||||
kotlin("jvm") version "1.8.20" // https://plugins.jetbrains.com/docs/intellij/using-kotlin.html#kotlin-standard-library
|
kotlin("jvm") version "1.9.20-Beta"
|
||||||
id("org.jetbrains.intellij") version "1.15.0"
|
id("org.jetbrains.intellij") version "1.15.0"
|
||||||
id("org.jetbrains.changelog") version "2.2.0"
|
id("org.jetbrains.changelog") version "2.2.0"
|
||||||
id("com.github.ben-manes.versions") version "0.48.0"
|
id("com.github.ben-manes.versions") version "0.48.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
compileKotlin {
|
||||||
|
kotlinOptions.jvmTarget = JavaVersion.VERSION_17.toString()
|
||||||
|
}
|
||||||
|
|
||||||
named<Zip>("buildPlugin") {
|
named<Zip>("buildPlugin") {
|
||||||
dependsOn("test")
|
dependsOn("test")
|
||||||
archiveFileName = "AceJump.zip"
|
archiveFileName = "AceJump.zip"
|
||||||
@ -47,7 +51,11 @@ tasks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvmToolchain(17)
|
jvmToolchain {
|
||||||
|
run {
|
||||||
|
languageVersion = JavaLanguageVersion.of(17)
|
||||||
|
}
|
||||||
|
}
|
||||||
sourceSets.all {
|
sourceSets.all {
|
||||||
languageSettings.apply {
|
languageSettings.apply {
|
||||||
languageVersion = "2.0"
|
languageVersion = "2.0"
|
||||||
|
@ -1,4 +1 @@
|
|||||||
kotlin.stdlib.default.dependency=false
|
|
||||||
kotlin.incremental.useClasspathSnapshot=false
|
|
||||||
|
|
||||||
org.gradle.jvmargs=-Xmx2048m
|
org.gradle.jvmargs=-Xmx2048m
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package org.acejump.config
|
package org.acejump.config
|
||||||
|
|
||||||
import com.intellij.openapi.ui.ComboBox
|
import com.intellij.openapi.ui.ComboBox
|
||||||
|
import com.intellij.ui.ColorPanel
|
||||||
import com.intellij.ui.components.*
|
import com.intellij.ui.components.*
|
||||||
import com.intellij.ui.dsl.builder.*
|
import com.intellij.ui.dsl.builder.*
|
||||||
import org.acejump.input.JumpMode
|
import org.acejump.input.*
|
||||||
import org.acejump.input.KeyLayout
|
|
||||||
import java.awt.*
|
import java.awt.*
|
||||||
import javax.swing.*
|
import javax.swing.*
|
||||||
import javax.swing.text.JTextComponent
|
import javax.swing.text.JTextComponent
|
||||||
@ -15,8 +15,6 @@ import kotlin.reflect.KProperty
|
|||||||
*/
|
*/
|
||||||
@Suppress("UsePropertyAccessSyntax")
|
@Suppress("UsePropertyAccessSyntax")
|
||||||
internal class AceSettingsPanel {
|
internal class AceSettingsPanel {
|
||||||
private val defaults = AceSettings()
|
|
||||||
|
|
||||||
private val tagCharsField = JBTextField()
|
private val tagCharsField = JBTextField()
|
||||||
private val keyboardLayoutCombo = ComboBox<KeyLayout>()
|
private val keyboardLayoutCombo = ComboBox<KeyLayout>()
|
||||||
private val keyboardLayoutArea = JBTextArea().apply { isEditable = false }
|
private val keyboardLayoutArea = JBTextArea().apply { isEditable = false }
|
||||||
@ -25,13 +23,13 @@ internal class AceSettingsPanel {
|
|||||||
private val cycleModeCombo3 = ComboBox<JumpMode>()
|
private val cycleModeCombo3 = ComboBox<JumpMode>()
|
||||||
private val cycleModeCombo4 = ComboBox<JumpMode>()
|
private val cycleModeCombo4 = ComboBox<JumpMode>()
|
||||||
private val minQueryLengthField = JBTextField()
|
private val minQueryLengthField = JBTextField()
|
||||||
private val jumpModeColorWheel = ResettableColorPicker(defaults.getJumpModeJBC())
|
private val jumpModeColorWheel = ColorPanel()
|
||||||
private val jumpEndModeColorWheel = ResettableColorPicker(defaults.getJumpEndModeJBC())
|
private val jumpEndModeColorWheel = ColorPanel()
|
||||||
private val targetModeColorWheel = ResettableColorPicker(defaults.getTargetModeJBC())
|
private val targetModeColorWheel = ColorPanel()
|
||||||
private val definitionModeColorWheel = ResettableColorPicker(defaults.getDefinitionModeJBC())
|
private val definitionModeColorWheel = ColorPanel()
|
||||||
private val textHighlightColorWheel = ResettableColorPicker(defaults.getTextHighlightJBC())
|
private val textHighlightColorWheel = ColorPanel()
|
||||||
private val tagForegroundColorWheel = ResettableColorPicker(defaults.getTagForegroundJBC())
|
private val tagForegroundColorWheel = ColorPanel()
|
||||||
private val tagBackgroundColorWheel = ResettableColorPicker(defaults.getTagBackgroundJBC())
|
private val tagBackgroundColorWheel = ColorPanel()
|
||||||
private val searchWholeFileCheckBox = JBCheckBox()
|
private val searchWholeFileCheckBox = JBCheckBox()
|
||||||
private val mapToASCIICheckBox = JBCheckBox()
|
private val mapToASCIICheckBox = JBCheckBox()
|
||||||
private val showSearchNotificationCheckBox = JBCheckBox()
|
private val showSearchNotificationCheckBox = JBCheckBox()
|
||||||
@ -135,8 +133,8 @@ internal class AceSettingsPanel {
|
|||||||
private operator fun JTextComponent.getValue(a: AceSettingsPanel, p: KProperty<*>) = text.lowercase()
|
private operator fun JTextComponent.getValue(a: AceSettingsPanel, p: KProperty<*>) = text.lowercase()
|
||||||
private operator fun JTextComponent.setValue(a: AceSettingsPanel, p: KProperty<*>, s: String) = setText(s)
|
private operator fun JTextComponent.setValue(a: AceSettingsPanel, p: KProperty<*>, s: String) = setText(s)
|
||||||
|
|
||||||
private operator fun ResettableColorPicker.getValue(a: AceSettingsPanel, p: KProperty<*>) = getSelectedColor()
|
private operator fun ColorPanel.getValue(a: AceSettingsPanel, p: KProperty<*>) = selectedColor
|
||||||
private operator fun ResettableColorPicker.setValue(a: AceSettingsPanel, p: KProperty<*>, c: Color?) = setSelectedColor(c)
|
private operator fun ColorPanel.setValue(a: AceSettingsPanel, p: KProperty<*>, c: Color?) = setSelectedColor(c)
|
||||||
|
|
||||||
private operator fun JCheckBox.getValue(a: AceSettingsPanel, p: KProperty<*>) = isSelected
|
private operator fun JCheckBox.getValue(a: AceSettingsPanel, p: KProperty<*>) = isSelected
|
||||||
private operator fun JCheckBox.setValue(a: AceSettingsPanel, p: KProperty<*>, selected: Boolean) = setSelected(selected)
|
private operator fun JCheckBox.setValue(a: AceSettingsPanel, p: KProperty<*>, selected: Boolean) = setSelected(selected)
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
package org.acejump.config
|
|
||||||
|
|
||||||
import com.intellij.icons.AllIcons
|
|
||||||
import com.intellij.openapi.actionSystem.*
|
|
||||||
import com.intellij.openapi.actionSystem.impl.ActionButton
|
|
||||||
import com.intellij.ui.ColorPanel
|
|
||||||
import com.intellij.ui.JBColor
|
|
||||||
import java.awt.*
|
|
||||||
import javax.swing.*
|
|
||||||
|
|
||||||
internal class ResettableColorPicker(private val defaultColor: JBColor) : JPanel(FlowLayout()) {
|
|
||||||
private val resetAction = object : AnAction({ "Reset to Default" }, AllIcons.General.Reset) {
|
|
||||||
override fun getActionUpdateThread(): ActionUpdateThread {
|
|
||||||
return ActionUpdateThread.EDT
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun update(e: AnActionEvent) {
|
|
||||||
e.presentation.isEnabled = colorPanel.selectedColor != defaultColor
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun actionPerformed(e: AnActionEvent) {
|
|
||||||
setSelectedColor(defaultColor)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private val colorPanel = ColorPanel()
|
|
||||||
private val resetButton = ActionButton(resetAction, null, ActionPlaces.UNKNOWN, ActionToolbar.DEFAULT_MINIMUM_BUTTON_SIZE)
|
|
||||||
|
|
||||||
init {
|
|
||||||
add(colorPanel)
|
|
||||||
add(resetButton)
|
|
||||||
setSelectedColor(defaultColor)
|
|
||||||
|
|
||||||
colorPanel.addActionListener {
|
|
||||||
resetButton.update()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getSelectedColor(): Color? {
|
|
||||||
return colorPanel.selectedColor
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setSelectedColor(color: Color?) {
|
|
||||||
colorPanel.selectedColor = color
|
|
||||||
resetButton.update()
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user