From 65779ec37e84099adfe6d97adbf8fc92bebeff64 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 26 May 2021 23:51:22 +0300 Subject: [PATCH] Removed Adaptive namespace from FieldAutocomplete. --- .../chat_helpers/field_autocomplete.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp index bd344cf63..fed9f200e 100644 --- a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp +++ b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp @@ -34,8 +34,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/cached_round_corners.h" #include "base/unixtime.h" #include "base/openssl_help.h" +#include "window/window_adaptive.h" #include "window/window_session_controller.h" -#include "facades.h" #include "styles/style_chat.h" #include "styles/style_widgets.h" #include "styles/style_chat_helpers.h" @@ -123,6 +123,8 @@ private: bool _previewShown = false; + bool _isOneColumn = false; + Fn _sendMenuType; rpl::event_stream _mentionChosen; @@ -741,6 +743,12 @@ FieldAutocomplete::Inner::Inner( ) | rpl::start_with_next([=] { update(); }, lifetime()); + + controller->adaptive().changed( + ) | rpl::start_with_next([=] { + _isOneColumn = controller->adaptive().isOneColumn(); + update(); + }, lifetime()); } void FieldAutocomplete::Inner::paintEvent(QPaintEvent *e) { @@ -937,9 +945,9 @@ void FieldAutocomplete::Inner::paintEvent(QPaintEvent *e) { } } } - p.fillRect(Adaptive::OneColumn() ? 0 : st::lineWidth, _parent->innerBottom() - st::lineWidth, width() - (Adaptive::OneColumn() ? 0 : st::lineWidth), st::lineWidth, st::shadowFg); + p.fillRect(_isOneColumn ? 0 : st::lineWidth, _parent->innerBottom() - st::lineWidth, width() - (_isOneColumn ? 0 : st::lineWidth), st::lineWidth, st::shadowFg); } - p.fillRect(Adaptive::OneColumn() ? 0 : st::lineWidth, _parent->innerTop(), width() - (Adaptive::OneColumn() ? 0 : st::lineWidth), st::lineWidth, st::shadowFg); + p.fillRect(_isOneColumn ? 0 : st::lineWidth, _parent->innerTop(), width() - (_isOneColumn ? 0 : st::lineWidth), st::lineWidth, st::shadowFg); } void FieldAutocomplete::Inner::resizeEvent(QResizeEvent *e) {