mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 13:47:05 +02:00
Added ability to generate QR code for self from settings.
This commit is contained in:
parent
6abce8d976
commit
155305f0f7
2 changed files with 31 additions and 0 deletions
|
@ -169,6 +169,13 @@ infoTopBarCall: IconButton(infoTopBarMenu) {
|
|||
iconPosition: point(5px, -1px);
|
||||
rippleAreaPosition: point(0px, 6px);
|
||||
}
|
||||
infoTopBarQr: IconButton(infoTopBarMenu) {
|
||||
width: 52px;
|
||||
icon: icon {{ "menu/qr_code", boxTitleCloseFg }};
|
||||
iconOver: icon {{ "menu/qr_code", boxTitleCloseFgOver }};
|
||||
iconPosition: point(9px, -1px);
|
||||
rippleAreaPosition: point(0px, 6px);
|
||||
}
|
||||
infoTopBarForward: IconButton(infoTopBarBack) {
|
||||
width: 46px;
|
||||
icon: icon {{ "info/info_media_forward", boxTitleCloseFg }};
|
||||
|
@ -262,6 +269,12 @@ infoLayerTopBarCall: IconButton(infoLayerTopBarMenu) {
|
|||
iconOver: icon {{ "top_bar_call", boxTitleCloseFgOver }};
|
||||
iconPosition: point(3px, -1px);
|
||||
}
|
||||
infoLayerTopBarQr: IconButton(infoLayerTopBarClose) {
|
||||
width: 40px;
|
||||
icon: icon {{ "menu/qr_code", boxTitleCloseFg }};
|
||||
iconOver: icon {{ "menu/qr_code", boxTitleCloseFgOver }};
|
||||
iconPosition: point(8px, -1px);
|
||||
}
|
||||
infoLayerTopBarForward: IconButton(infoLayerTopBarBack) {
|
||||
width: 45px;
|
||||
icon: icon {{ "info/info_media_forward", boxTitleCloseFg }};
|
||||
|
|
|
@ -16,6 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "info/info_top_bar.h"
|
||||
#include "settings/cloud_password/settings_cloud_password_email_confirm.h"
|
||||
#include "settings/settings_chat.h"
|
||||
#include "settings/settings_information.h"
|
||||
#include "settings/settings_main.h"
|
||||
#include "settings/settings_premium.h"
|
||||
#include "ui/effects/ripple_animation.h" // MaskByDrawer.
|
||||
|
@ -35,6 +36,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "window/window_slide_animation.h"
|
||||
#include "boxes/peer_list_box.h"
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
#include "ui/boxes/peer_qr_box.h"
|
||||
#include "main/main_session.h"
|
||||
#include "mtproto/mtproto_config.h"
|
||||
#include "data/data_download_manager.h"
|
||||
|
@ -384,6 +386,22 @@ void WrapWidget::setupTopBarMenuToggle() {
|
|||
addProfileCallsButton();
|
||||
} else if (section.type() == Section::Type::Settings) {
|
||||
addTopBarMenuButton();
|
||||
if (section.settingsType() == ::Settings::Information::Id()) {
|
||||
const auto controller = _controller->parentController();
|
||||
const auto self = controller->session().user();
|
||||
if (!self->username().isEmpty()) {
|
||||
const auto show = controller->uiShow();
|
||||
const auto &st = (wrap() == Wrap::Layer)
|
||||
? st::infoLayerTopBarQr
|
||||
: st::infoTopBarQr;
|
||||
const auto button = _topBar->addButton(
|
||||
base::make_unique_q<Ui::IconButton>(_topBar, st));
|
||||
button->addClickHandler([show, self] {
|
||||
show->show(
|
||||
Box(Ui::FillPeerQrBox, self, std::nullopt, nullptr));
|
||||
});
|
||||
}
|
||||
}
|
||||
} else if (section.type() == Section::Type::Downloads) {
|
||||
auto &manager = Core::App().downloadManager();
|
||||
rpl::merge(
|
||||
|
|
Loading…
Add table
Reference in a new issue