mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added ability to copy link from confirmation box on hidden url.
Fixed #17480.
This commit is contained in:
parent
df66743c61
commit
c14d9b18f7
1 changed files with 13 additions and 6 deletions
|
@ -26,6 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "window/window_controller.h"
|
#include "window/window_controller.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
|
#include "styles/style_layers.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -123,12 +124,18 @@ void HiddenUrlClickHandler::Open(QString url, QVariant context) {
|
||||||
const auto use = controller
|
const auto use = controller
|
||||||
? &controller->window()
|
? &controller->window()
|
||||||
: Core::App().activeWindow();
|
: Core::App().activeWindow();
|
||||||
auto box = Ui::MakeConfirmBox({
|
auto box = Box([=](not_null<Ui::GenericBox*> box) {
|
||||||
.text = (tr::lng_open_this_link(tr::now)
|
Ui::ConfirmBox(box, {
|
||||||
+ qsl("\n\n")
|
.text = (tr::lng_open_this_link(tr::now)),
|
||||||
+ displayUrl),
|
.confirmed = [=](Fn<void()> hide) { hide(); open(); },
|
||||||
.confirmed = [=](Fn<void()> hide) { hide(); open(); },
|
.confirmText = tr::lng_open_link(),
|
||||||
.confirmText = tr::lng_open_link(),
|
});
|
||||||
|
const auto &st = st::boxLabel;
|
||||||
|
box->addSkip(st.style.lineHeight - st::boxPadding.bottom());
|
||||||
|
const auto url = box->addRow(
|
||||||
|
object_ptr<Ui::FlatLabel>(box, displayUrl, st));
|
||||||
|
url->setSelectable(true);
|
||||||
|
url->setContextCopyText(tr::lng_context_copy_link(tr::now));
|
||||||
});
|
});
|
||||||
if (my.show) {
|
if (my.show) {
|
||||||
my.show->showBox(std::move(box));
|
my.show->showBox(std::move(box));
|
||||||
|
|
Loading…
Add table
Reference in a new issue