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:
@@ -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) {
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user