mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Don't copy empty selected text.
This commit is contained in:
parent
b46659eb22
commit
fda2f56fd8
2 changed files with 7 additions and 3 deletions
|
@ -2341,7 +2341,8 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
|||
const auto item = _dragStateItem;
|
||||
const auto itemId = item ? item->fullId() : FullMsgId();
|
||||
if (isUponSelected > 0) {
|
||||
if (!hasCopyRestrictionForSelected()) {
|
||||
if (!hasCopyRestrictionForSelected()
|
||||
&& !getSelectedText().empty()) {
|
||||
_menu->addAction(
|
||||
(isUponSelected > 1
|
||||
? tr::lng_context_copy_selected_items(tr::now)
|
||||
|
@ -2442,7 +2443,8 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
|||
: QString();
|
||||
|
||||
if (isUponSelected > 0) {
|
||||
if (!hasCopyRestrictionForSelected()) {
|
||||
if (!hasCopyRestrictionForSelected()
|
||||
&& !getSelectedText().empty()) {
|
||||
_menu->addAction(
|
||||
((isUponSelected > 1)
|
||||
? tr::lng_context_copy_selected_items(tr::now)
|
||||
|
|
|
@ -995,7 +995,9 @@ base::unique_qptr<Ui::PopupMenu> FillContextMenu(
|
|||
list,
|
||||
st::popupMenuWithIcons);
|
||||
|
||||
if (request.overSelection && !list->hasCopyRestrictionForSelected()) {
|
||||
if (request.overSelection
|
||||
&& !list->hasCopyRestrictionForSelected()
|
||||
&& !list->getSelectedText().empty()) {
|
||||
const auto text = request.selectedItems.empty()
|
||||
? tr::lng_context_copy_selected(tr::now)
|
||||
: tr::lng_context_copy_selected_items(tr::now);
|
||||
|
|
Loading…
Add table
Reference in a new issue