mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
UX-2470 [SE] hide action if the feature is disabled
GitOrigin-RevId: 98fea3bb0da52e8c130afe2d894be4116bafced4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4890593a89
commit
bf8bfd5990
@@ -3,6 +3,7 @@ package com.intellij.ide.actions.searcheverywhere
|
||||
|
||||
import com.intellij.icons.ExpUiIcons
|
||||
import com.intellij.ide.IdeBundle
|
||||
import com.intellij.ide.actions.searcheverywhere.SearchEverywhereUI.isPreviewEnabled
|
||||
import com.intellij.ide.util.PropertiesComponent
|
||||
import com.intellij.openapi.actionSystem.ActionUpdateThread
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
@@ -15,6 +16,11 @@ class PreviewAction(val callback: () -> Unit) :
|
||||
ExpUiIcons.General.PreviewHorizontally) {
|
||||
override fun getActionUpdateThread() = ActionUpdateThread.BGT
|
||||
|
||||
override fun update(e: AnActionEvent) {
|
||||
e.presentation.isEnabledAndVisible = isPreviewEnabled()
|
||||
super.update(e)
|
||||
}
|
||||
|
||||
override fun isSelected(e: AnActionEvent) =
|
||||
PropertiesComponent.getInstance(e.project!!).isTrueValue(SearchEverywhereUI.PREVIEW_PROPERTY_KEY)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user