Added text selection to context menu request from FlatLabel.
This commit is contained in:
parent
7fcfaa9dd5
commit
08b56a1789
2 changed files with 3 additions and 3 deletions
|
|
@ -687,7 +687,7 @@ void FlatLabel::showContextMenu(QContextMenuEvent *e, ContextMenuReason reason)
|
|||
const auto request = ContextMenuRequest{
|
||||
.menu = _contextMenu.get(),
|
||||
.link = ClickHandler::getActive(),
|
||||
.hasSelection = hasSelection,
|
||||
.selection = _selectable ? _selection : TextSelection(),
|
||||
.uponSelection = uponSelection,
|
||||
.fullSelection = _selectable && _text.isFullSelection(_selection),
|
||||
};
|
||||
|
|
@ -716,7 +716,7 @@ void FlatLabel::fillContextMenu(ContextMenuRequest request) {
|
|||
Integration::Instance().phraseContextCopySelected(),
|
||||
[=] { copySelectedText(); });
|
||||
} else if (_selectable
|
||||
&& !request.hasSelection
|
||||
&& request.selection.empty()
|
||||
&& !_contextCopyText.isEmpty()) {
|
||||
request.menu->addAction(
|
||||
_contextCopyText,
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ public:
|
|||
struct ContextMenuRequest {
|
||||
not_null<PopupMenu*> menu;
|
||||
ClickHandlerPtr link;
|
||||
bool hasSelection = false;
|
||||
TextSelection selection;
|
||||
bool uponSelection = false;
|
||||
bool fullSelection = false;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue