2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Copy code blocks on header click.

This commit is contained in:
John Preston
2023-10-20 18:00:28 +04:00
parent 575684670c
commit 66f73a5a64
11 changed files with 19 additions and 3 deletions

View File

@@ -243,6 +243,16 @@ bool UiIntegration::handleUrlClick(
return true;
}
bool UiIntegration::copyPreOnClick(const QVariant &context) {
const auto my = context.value<ClickHandlerContext>();
if (const auto window = my.sessionWindow.get()) {
window->showToast(tr::lng_code_copied(tr::now));
} else if (my.show) {
my.show->showToast(tr::lng_code_copied(tr::now));
}
return true;
}
std::unique_ptr<Ui::Text::CustomEmoji> UiIntegration::createCustomEmoji(
const QString &data,
const std::any &context) {

View File

@@ -53,6 +53,7 @@ public:
bool handleUrlClick(
const QString &url,
const QVariant &context) override;
bool copyPreOnClick(const QVariant &context) override;
rpl::producer<> forcePopupMenuHideRequests() override;
const Ui::Emoji::One *defaultEmojiVariant(
const Ui::Emoji::One *emoji) override;