mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fixed preview of chats filters in filter link box when window is small.
This commit is contained in:
parent
bf26de495a
commit
8060691f3d
1 changed files with 9 additions and 4 deletions
|
@ -140,7 +140,8 @@ void InitFilterLinkHeader(
|
||||||
Ui::FilterLinkHeaderType type,
|
Ui::FilterLinkHeaderType type,
|
||||||
const QString &title,
|
const QString &title,
|
||||||
const QString &iconEmoji,
|
const QString &iconEmoji,
|
||||||
rpl::producer<int> count) {
|
rpl::producer<int> count,
|
||||||
|
bool horizontalFilters) {
|
||||||
const auto icon = Ui::LookupFilterIcon(
|
const auto icon = Ui::LookupFilterIcon(
|
||||||
Ui::LookupFilterIconByEmoji(
|
Ui::LookupFilterIconByEmoji(
|
||||||
iconEmoji
|
iconEmoji
|
||||||
|
@ -154,7 +155,7 @@ void InitFilterLinkHeader(
|
||||||
.badge = (type == Ui::FilterLinkHeaderType::AddingChats
|
.badge = (type == Ui::FilterLinkHeaderType::AddingChats
|
||||||
? std::move(count)
|
? std::move(count)
|
||||||
: rpl::single(0)),
|
: rpl::single(0)),
|
||||||
.horizontalFilters = Core::App().settings().chatFiltersHorizontal(),
|
.horizontalFilters = horizontalFilters,
|
||||||
});
|
});
|
||||||
const auto widget = header.widget;
|
const auto widget = header.widget;
|
||||||
widget->resizeToWidth(st::boxWideWidth);
|
widget->resizeToWidth(st::boxWideWidth);
|
||||||
|
@ -593,6 +594,8 @@ void ProcessFilterInvite(
|
||||||
title,
|
title,
|
||||||
std::move(peers),
|
std::move(peers),
|
||||||
std::move(already));
|
std::move(already));
|
||||||
|
const auto horizontalFilters = !strong->enoughSpaceForFilters()
|
||||||
|
|| Core::App().settings().chatFiltersHorizontal();
|
||||||
const auto raw = controller.get();
|
const auto raw = controller.get();
|
||||||
auto initBox = [=](not_null<PeerListBox*> box) {
|
auto initBox = [=](not_null<PeerListBox*> box) {
|
||||||
box->setStyle(st::filterInviteBox);
|
box->setStyle(st::filterInviteBox);
|
||||||
|
@ -609,7 +612,7 @@ void ProcessFilterInvite(
|
||||||
});
|
});
|
||||||
InitFilterLinkHeader(box, [=](int min, int max, int addedTop) {
|
InitFilterLinkHeader(box, [=](int min, int max, int addedTop) {
|
||||||
raw->adjust(min, max, addedTop);
|
raw->adjust(min, max, addedTop);
|
||||||
}, type, title, iconEmoji, rpl::duplicate(badge));
|
}, type, title, iconEmoji, rpl::duplicate(badge), horizontalFilters);
|
||||||
|
|
||||||
raw->setRealContentHeight(box->heightValue());
|
raw->setRealContentHeight(box->heightValue());
|
||||||
|
|
||||||
|
@ -821,6 +824,8 @@ void ProcessFilterRemove(
|
||||||
title,
|
title,
|
||||||
std::move(suggest),
|
std::move(suggest),
|
||||||
std::move(all));
|
std::move(all));
|
||||||
|
const auto horizontalFilters = !strong->enoughSpaceForFilters()
|
||||||
|
|| Core::App().settings().chatFiltersHorizontal();
|
||||||
const auto raw = controller.get();
|
const auto raw = controller.get();
|
||||||
auto initBox = [=](not_null<PeerListBox*> box) {
|
auto initBox = [=](not_null<PeerListBox*> box) {
|
||||||
box->setStyle(st::filterInviteBox);
|
box->setStyle(st::filterInviteBox);
|
||||||
|
@ -832,7 +837,7 @@ void ProcessFilterRemove(
|
||||||
});
|
});
|
||||||
InitFilterLinkHeader(box, [=](int min, int max, int addedTop) {
|
InitFilterLinkHeader(box, [=](int min, int max, int addedTop) {
|
||||||
raw->adjust(min, max, addedTop);
|
raw->adjust(min, max, addedTop);
|
||||||
}, type, title, iconEmoji, rpl::single(0));
|
}, type, title, iconEmoji, rpl::single(0), horizontalFilters);
|
||||||
|
|
||||||
auto owned = Ui::FilterLinkProcessButton(
|
auto owned = Ui::FilterLinkProcessButton(
|
||||||
box,
|
box,
|
||||||
|
|
Loading…
Add table
Reference in a new issue