diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index f7ac2a9715..5a07fbbea5 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -1485,8 +1485,6 @@ PRIVATE platform/platform_tray.h platform/platform_webauthn.h platform/platform_window_title.h - profile/profile_back_button.cpp - profile/profile_back_button.h profile/profile_block_widget.cpp profile/profile_block_widget.h profile/profile_cover_drop_area.cpp diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_section.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_section.cpp index 0acb4a8477..30a79c4984 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_section.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_section.cpp @@ -111,11 +111,7 @@ FixedBar::FixedBar( , _controller(controller) , _channel(channel) , _field(this, st::defaultMultiSelectSearchField, tr::lng_dlg_filter()) -, _backButton( - this, - &controller->session(), - tr::lng_admin_log_title_all(tr::now), - controller->adaptive().oneColumnValue()) +, _backButton(this) , _search(this, st::topBarSearch) , _cancel(this, st::historyAdminLogCancelSearch) { _backButton->moveToLeft(0, 0); diff --git a/Telegram/SourceFiles/profile/profile_back_button.cpp b/Telegram/SourceFiles/profile/profile_back_button.cpp index c0dd41128f..e2f24033c6 100644 --- a/Telegram/SourceFiles/profile/profile_back_button.cpp +++ b/Telegram/SourceFiles/profile/profile_back_button.cpp @@ -7,8 +7,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "profile/profile_back_button.h" -#include "main/main_session.h" -#include "data/data_session.h" #include "ui/painter.h" #include "styles/style_widgets.h" #include "styles/style_window.h" @@ -21,32 +19,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Profile { -BackButton::BackButton( - QWidget *parent, - not_null session, - const QString &text, - rpl::producer oneColumnValue) -: Ui::AbstractButton(parent) -, _session(session) -, _text(text) { +BackButton::BackButton(QWidget *parent) : Ui::AbstractButton(parent) { setCursor(style::cur_pointer); - - std::move( - oneColumnValue - ) | rpl::on_next([=](bool oneColumn) { - if (!oneColumn) { - _unreadBadgeLifetime.destroy(); - } else if (!_unreadBadgeLifetime) { - _session->data().unreadBadgeChanges( - ) | rpl::on_next([=] { - rtlupdate( - 0, - 0, - st::titleUnreadCounterRight, - st::titleUnreadCounterTop); - }, _unreadBadgeLifetime); - } - }, lifetime()); } void BackButton::setText(const QString &text) { diff --git a/Telegram/SourceFiles/profile/profile_back_button.h b/Telegram/SourceFiles/profile/profile_back_button.h index 7b6d557107..f8df0a0bd8 100644 --- a/Telegram/SourceFiles/profile/profile_back_button.h +++ b/Telegram/SourceFiles/profile/profile_back_button.h @@ -11,19 +11,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL class QGraphicsOpacityEffect; -namespace Main { -class Session; -} // namespace Main - namespace Profile { class BackButton final : public Ui::AbstractButton { public: - BackButton( - QWidget *parent, - not_null session, - const QString &text, - rpl::producer oneColumnValue); + BackButton(QWidget *parent); void setText(const QString &text); void setSubtext(const QString &subtext); @@ -39,8 +31,6 @@ protected: private: void updateCache(); - const not_null _session; - rpl::lifetime _unreadBadgeLifetime; QString _text; QString _subtext; diff --git a/Telegram/cmake/td_ui.cmake b/Telegram/cmake/td_ui.cmake index 9dd90296aa..1b770ad198 100644 --- a/Telegram/cmake/td_ui.cmake +++ b/Telegram/cmake/td_ui.cmake @@ -253,6 +253,9 @@ PRIVATE platform/platform_current_geo_location.h platform/platform_text_recognition.h + profile/profile_back_button.cpp + profile/profile_back_button.h + settings/settings_common.cpp settings/settings_common.h settings/cloud_password/settings_cloud_password_common.cpp