status-desktop/ui/shared/status/StatusChatInputTextFormationAction.qml
Khushboo Mehta 0531d71e6c fix(@desktop/chat): Text formatting menu should not disappear when performing actions
Qt's Menu closes the menu when action is triggered and to overcome this default behaviour added a custom event to be called when action is clicked.
Fixed some formatting related bugs.

fixes #2349
2021-08-26 15:00:34 -04:00

15 lines
477 B
QML

import QtQuick 2.13
import QtQuick.Controls 2.13
Action {
property string wrapper
// adding this signal due to a known limitation from Qt: Menu closes when Action is triggered
signal actionTriggered()
icon.width: 12
icon.height: 16
onActionTriggered: checked ?
unwrapSelection(wrapper, textFormatMenu.selectedTextWithFormationChars) :
wrapSelection(wrapper)
checked: textFormatMenu.surroundedBy(wrapper)
}