[collab] use presentation properties instead of function override

GitOrigin-RevId: 6e40d1cfc633722c9b672aecf1c54984a9abf8fc
This commit is contained in:
Ivan Semenov
2025-09-01 13:20:57 +00:00
committed by intellij-monorepo-bot
parent da21bb91a3
commit 321fcfde15
@@ -36,14 +36,11 @@ class CodeReviewInEditorToolbarActionGroup(private val vm: CodeReviewInEditorVie
override fun getChildren(e: AnActionEvent?): Array<AnAction> =
arrayOf(updateAction, Separator.create(), disableReviewAction, hideResolvedAction, showAllAction)
override fun displayTextInToolbar(): Boolean = true
override fun useSmallerFontForTextInToolbar(): Boolean = true
init {
with(templatePresentation) {
isPopupGroup = true
putClientProperty(ActionUtil.HIDE_DROPDOWN_ICON, true)
putClientProperty(ActionUtil.USE_SMALL_FONT_IN_TOOLBAR, true)
description = CollaborationToolsBundle.message("review.editor.mode.description.title")
val tooltip = HelpTooltip()
.setTitle(CollaborationToolsBundle.message("review.editor.mode.description.title"))
@@ -58,10 +55,12 @@ class CodeReviewInEditorToolbarActionGroup(private val vm: CodeReviewInEditorVie
with(e.presentation) {
if (shown) {
text = CollaborationToolsBundle.message("review.editor.mode.title")
putClientProperty(ActionUtil.SHOW_TEXT_IN_TOOLBAR, true)
icon = if (synced) null else getWarningIcon()
}
else {
text = null
putClientProperty(ActionUtil.SHOW_TEXT_IN_TOOLBAR, false)
icon = AllIcons.Actions.Preview
}
}