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:
BIN
Telegram/Resources/icons/chat/mini_copy.png
Normal file
BIN
Telegram/Resources/icons/chat/mini_copy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 324 B |
BIN
Telegram/Resources/icons/chat/mini_copy@2x.png
Normal file
BIN
Telegram/Resources/icons/chat/mini_copy@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 484 B |
BIN
Telegram/Resources/icons/chat/mini_copy@3x.png
Normal file
BIN
Telegram/Resources/icons/chat/mini_copy@3x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 623 B |
@@ -2686,6 +2686,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
"lng_formatting_link_create" = "Create";
|
"lng_formatting_link_create" = "Create";
|
||||||
|
|
||||||
"lng_text_copied" = "Text copied to clipboard.";
|
"lng_text_copied" = "Text copied to clipboard.";
|
||||||
|
"lng_code_copied" = "Code copied to clipboard.";
|
||||||
|
|
||||||
"lng_spellchecker_submenu" = "Spelling";
|
"lng_spellchecker_submenu" = "Spelling";
|
||||||
"lng_spellchecker_add" = "Add to Dictionary";
|
"lng_spellchecker_add" = "Add to Dictionary";
|
||||||
|
@@ -243,6 +243,16 @@ bool UiIntegration::handleUrlClick(
|
|||||||
return true;
|
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(
|
std::unique_ptr<Ui::Text::CustomEmoji> UiIntegration::createCustomEmoji(
|
||||||
const QString &data,
|
const QString &data,
|
||||||
const std::any &context) {
|
const std::any &context) {
|
||||||
|
@@ -53,6 +53,7 @@ public:
|
|||||||
bool handleUrlClick(
|
bool handleUrlClick(
|
||||||
const QString &url,
|
const QString &url,
|
||||||
const QVariant &context) override;
|
const QVariant &context) override;
|
||||||
|
bool copyPreOnClick(const QVariant &context) override;
|
||||||
rpl::producer<> forcePopupMenuHideRequests() override;
|
rpl::producer<> forcePopupMenuHideRequests() override;
|
||||||
const Ui::Emoji::One *defaultEmojiVariant(
|
const Ui::Emoji::One *defaultEmojiVariant(
|
||||||
const Ui::Emoji::One *emoji) override;
|
const Ui::Emoji::One *emoji) override;
|
||||||
|
@@ -56,6 +56,8 @@ messageTextStyle: TextStyle(defaultTextStyle) {
|
|||||||
header: 20px;
|
header: 20px;
|
||||||
headerPosition: point(10px, 2px);
|
headerPosition: point(10px, 2px);
|
||||||
scrollable: true;
|
scrollable: true;
|
||||||
|
icon: icon{{ "chat/mini_copy", windowFg }};
|
||||||
|
iconPosition: point(4px, 2px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
msgDateTextStyle: defaultTextStyle;
|
msgDateTextStyle: defaultTextStyle;
|
||||||
|
@@ -60,6 +60,8 @@ void EnsurePreCache(
|
|||||||
cache->outline.setAlphaF(0.9);
|
cache->outline.setAlphaF(0.9);
|
||||||
cache->header = color->c;
|
cache->header = color->c;
|
||||||
cache->header.setAlphaF(0.25);
|
cache->header.setAlphaF(0.25);
|
||||||
|
cache->icon = cache->outline;
|
||||||
|
cache->icon.setAlphaF(0.6);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
2
Telegram/ThirdParty/libprisma
vendored
2
Telegram/ThirdParty/libprisma
vendored
Submodule Telegram/ThirdParty/libprisma updated: 7f62494bb8...629dc69fbf
Submodule Telegram/lib_spellcheck updated: 5227bec65b...c97b3fe73d
Submodule Telegram/lib_ui updated: 9eb9fcf043...17d73a5c0c
Reference in New Issue
Block a user