mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: Make commit options in project settings focusable
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.vcs.changes.ui
|
||||
|
||||
import com.intellij.ide.ui.UISettings
|
||||
import com.intellij.openapi.options.UnnamedConfigurable
|
||||
import com.intellij.openapi.vcs.CheckinProjectPanel
|
||||
import com.intellij.openapi.vcs.checkin.CheckinHandlerUtil.disableWhenDumb
|
||||
import com.intellij.openapi.vcs.configurable.CommitOptionsConfigurable
|
||||
import com.intellij.openapi.vcs.ui.RefreshableOnComponent
|
||||
import com.intellij.ui.NonFocusableCheckBox
|
||||
import com.intellij.ui.components.JBCheckBox
|
||||
import java.util.function.Consumer
|
||||
import javax.swing.JComponent
|
||||
|
||||
@@ -15,8 +16,9 @@ open class BooleanCommitOption(private val checkinPanel: CheckinProjectPanel,
|
||||
disableWhenDumb: Boolean,
|
||||
private val getter: () -> Boolean,
|
||||
private val setter: Consumer<Boolean>) : RefreshableOnComponent, UnnamedConfigurable {
|
||||
protected val checkBox = NonFocusableCheckBox(text).also {
|
||||
if (disableWhenDumb && !isInSettings) disableWhenDumb(checkinPanel.project, it, "Impossible until indices are up-to-date")
|
||||
protected val checkBox = JBCheckBox(text).apply {
|
||||
isFocusable = isInSettings || UISettings.shadowInstance.disableMnemonicsInControls
|
||||
if (disableWhenDumb && !isInSettings) disableWhenDumb(checkinPanel.project, this, "Impossible until indices are up-to-date")
|
||||
}
|
||||
|
||||
private val isInSettings get() = checkinPanel is CommitOptionsConfigurable.CheckinPanel
|
||||
|
||||
Reference in New Issue
Block a user