Make chats list tabs closer to each other.

This commit is contained in:
John Preston 2024-05-20 18:00:34 +04:00
parent 42d53e5543
commit 7b7438cd7b
3 changed files with 11 additions and 7 deletions

View file

@ -649,7 +649,7 @@ dialogsSearchTabs: SettingsSlider(defaultSettingsSlider) {
barRadius: 2px; barRadius: 2px;
barFg: transparent; barFg: transparent;
barSnapToLabel: true; barSnapToLabel: true;
strictSkip: 34px; strictSkip: 18px;
labelTop: 7px; labelTop: 7px;
labelStyle: semiboldTextStyle; labelStyle: semiboldTextStyle;
labelFg: windowSubTextFg; labelFg: windowSubTextFg;
@ -659,7 +659,7 @@ dialogsSearchTabs: SettingsSlider(defaultSettingsSlider) {
rippleBgActive: lightButtonBgOver; rippleBgActive: lightButtonBgOver;
ripple: defaultRippleAnimation; ripple: defaultRippleAnimation;
} }
dialogsSearchTabsPadding: 8px;
dialogsStoriesList: DialogsStoriesList { dialogsStoriesList: DialogsStoriesList {
small: dialogsStories; small: dialogsStories;

View file

@ -110,7 +110,7 @@ ChatSearchTabs::ChatSearchTabs(QWidget *parent, ChatSearchTab active)
}) { }) {
_list.push_back({ tab, TabLabel(tab) }); _list.push_back({ tab, TabLabel(tab) });
} }
_tabs->move(0, 0); _tabs->move(st::dialogsSearchTabsPadding, 0);
_tabs->sectionActivated( _tabs->sectionActivated(
) | rpl::start_with_next([=](int index) { ) | rpl::start_with_next([=](int index) {
for (const auto &tab : _list) { for (const auto &tab : _list) {
@ -166,9 +166,9 @@ void ChatSearchTabs::refreshTabs(ChatSearchTab active) {
int ChatSearchTabs::resizeGetHeight(int newWidth) { int ChatSearchTabs::resizeGetHeight(int newWidth) {
_tabs->resizeToWidth(newWidth); _tabs->resizeToWidth(newWidth);
_shadow->setGeometry( _shadow->setGeometry(
_tabs->x(), 0,
_tabs->y() + _tabs->height() - st::lineWidth, _tabs->y() + _tabs->height() - st::lineWidth,
_tabs->width(), newWidth,
st::lineWidth); st::lineWidth);
return _tabs->height(); return _tabs->height();
} }

View file

@ -903,9 +903,13 @@ void Suggestions::setupTabs() {
const auto shadow = Ui::CreateChild<Ui::PlainShadow>(this); const auto shadow = Ui::CreateChild<Ui::PlainShadow>(this);
shadow->lower(); shadow->lower();
_tabs->sizeValue() | rpl::start_with_next([=](QSize size) { _tabs->move(st::dialogsSearchTabsPadding, 0);
rpl::combine(
widthValue(),
_tabs->heightValue()
) | rpl::start_with_next([=](int width, int height) {
const auto line = st::lineWidth; const auto line = st::lineWidth;
shadow->setGeometry(0, size.height() - line, size.width(), line); shadow->setGeometry(0, height - line, width, line);
}, shadow->lifetime()); }, shadow->lifetime());
shadow->showOn(_tabs->shownValue()); shadow->showOn(_tabs->shownValue());