Moved out back button for admin log to td_ui.

This commit is contained in:
23rd
2026-01-02 10:45:52 +03:00
parent 3ac4eefe1d
commit 29ca797b3b
5 changed files with 6 additions and 45 deletions
-2
View File
@@ -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
@@ -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);
@@ -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<Main::Session*> session,
const QString &text,
rpl::producer<bool> 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) {
@@ -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<Main::Session*> session,
const QString &text,
rpl::producer<bool> 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<Main::Session*> _session;
rpl::lifetime _unreadBadgeLifetime;
QString _text;
QString _subtext;
+3
View File
@@ -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