action.Vcs.CopyRevisionNumberAction.text=Copy Revision Number
action.Vcs.CopyRevisionNumberAction.description=Copy revision numbers of selected commits to the clipboard
action.VcsToolbarLabelAction.text=VCS Label
-action.CommitView.ShowEditorPreviewOnDoubleClick.text=Show Diff Instead of File Content on Double-Click
+group.CommitView.ShowOnDoubleClick.text=Show on Double-Click
+action.CommitView.ShowOnDoubleClick.EditorPreview.text=Show Diff on Double-Click
+action.CommitView.ShowOnDoubleClick.EditorPreview.ToolwindowPopup.text=Diff
+action.CommitView.ShowOnDoubleClick.Source.text=Show Source on Double-Click
+action.CommitView.ShowOnDoubleClick.Source.ToolwindowPopup.text=Source
action.CommitView.SwitchToCommitDialog.text=Switch to Commit Dialog
action.Vcs.ToggleAmendCommitMode.text=Amend Commit
action.Vcs.ToggleAmendCommitMode.description=Modify the latest commit of the current branch
<group id="CommitView.GearActions">
<action id="CommitView.SwitchToCommitDialog" class="com.intellij.vcs.commit.SwitchToCommitDialogAction"/>
- <action id="CommitView.ShowEditorPreviewOnDoubleClick"
- class="com.intellij.openapi.vcs.changes.actions.ShowEditorPreviewOnDoubleClickToggleAction"/>
+ <group id="CommitView.ShowOnDoubleClick" popup="true" searchable="false">
+ <action id="CommitView.ShowOnDoubleClick.EditorPreview"
+ class="com.intellij.openapi.vcs.changes.actions.ShowOnDoubleClickToggleAction$EditorPreview">
+ <override-text place="ToolwindowPopup"/>
+ </action>
+ <action id="CommitView.ShowOnDoubleClick.Source"
+ class="com.intellij.openapi.vcs.changes.actions.ShowOnDoubleClickToggleAction$Source">
+ <override-text place="ToolwindowPopup"/>
+ </action>
+ </group>
<add-to-group group-id="VcsGeneral.KeymapGroup"/>
</group>
-// Copyright 2000-2020 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.
+// Copyright 2000-2021 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.actions
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.vcs.changes.ChangeListManager
import com.intellij.openapi.vcs.changes.ChangesViewManager
-private class ShowEditorPreviewOnDoubleClickToggleAction : DumbAwareToggleAction() {
+private abstract class ShowOnDoubleClickToggleAction(private val isEditorPreview: Boolean) : DumbAwareToggleAction() {
override fun update(e: AnActionEvent) {
super.update(e)
changesViewManager?.isEditorPreview == true || changeListManager?.areChangeListsEnabled() == false
}
- override fun isSelected(e: AnActionEvent): Boolean = VcsApplicationSettings.getInstance().SHOW_EDITOR_PREVIEW_ON_DOUBLE_CLICK
+ override fun isSelected(e: AnActionEvent): Boolean =
+ VcsApplicationSettings.getInstance().SHOW_EDITOR_PREVIEW_ON_DOUBLE_CLICK == isEditorPreview
override fun setSelected(e: AnActionEvent, state: Boolean) {
- VcsApplicationSettings.getInstance().SHOW_EDITOR_PREVIEW_ON_DOUBLE_CLICK = state
+ VcsApplicationSettings.getInstance().SHOW_EDITOR_PREVIEW_ON_DOUBLE_CLICK = isEditorPreview
}
+
+ class EditorPreview : ShowOnDoubleClickToggleAction(true)
+
+ class Source : ShowOnDoubleClickToggleAction(false)
}
\ No newline at end of file