mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +02:00
Open link on webpreview attach click.
This commit is contained in:
parent
2d3e2b1ef8
commit
aad157cf56
1 changed files with 5 additions and 21 deletions
|
@ -822,29 +822,13 @@ TextState WebPage::textState(QPoint point, StateRequest request) const {
|
||||||
|
|
||||||
ClickHandlerPtr WebPage::replaceAttachLink(
|
ClickHandlerPtr WebPage::replaceAttachLink(
|
||||||
const ClickHandlerPtr &link) const {
|
const ClickHandlerPtr &link) const {
|
||||||
if (!link || !_attach->isReadyForOpen() || !_collage.empty()) {
|
if (!_attach->isReadyForOpen()
|
||||||
|
|| (_siteName.isEmpty()
|
||||||
|
&& _title.isEmpty()
|
||||||
|
&& _description.isEmpty())) {
|
||||||
return link;
|
return link;
|
||||||
}
|
}
|
||||||
if (_data->document) {
|
|
||||||
if (_data->document->isWallPaper() || _data->document->isTheme()) {
|
|
||||||
return _openl;
|
return _openl;
|
||||||
}
|
|
||||||
} else if (_data->photo) {
|
|
||||||
if (_data->type == WebPageType::Profile
|
|
||||||
|| _data->type == WebPageType::Video) {
|
|
||||||
return _openl;
|
|
||||||
} else if (_data->type == WebPageType::Photo
|
|
||||||
|| _data->type == WebPageType::Document
|
|
||||||
|| _data->siteName == u"Twitter"_q
|
|
||||||
|| _data->siteName == u"Facebook"_q) {
|
|
||||||
// leave photo link
|
|
||||||
} else {
|
|
||||||
return _openl;
|
|
||||||
}
|
|
||||||
} else if (ThemeDocument::ParamsFromUrl(_data->url).has_value()) {
|
|
||||||
return _openl;
|
|
||||||
}
|
|
||||||
return link;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TextSelection WebPage::adjustSelection(TextSelection selection, TextSelectType type) const {
|
TextSelection WebPage::adjustSelection(TextSelection selection, TextSelectType type) const {
|
||||||
|
|
Loading…
Add table
Reference in a new issue