Removed Adaptive namespace from FieldAutocomplete.

This commit is contained in:
23rd 2021-05-26 23:51:22 +03:00
parent 2d90a06078
commit 65779ec37e

View file

@ -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<SendMenu::Type()> _sendMenuType;
rpl::event_stream<FieldAutocomplete::MentionChosen> _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) {