mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix empty state of Downloads section.
This commit is contained in:
parent
1710863231
commit
1f2eba9dc9
6 changed files with 24 additions and 7 deletions
|
@ -27,6 +27,8 @@ public:
|
||||||
protected:
|
protected:
|
||||||
int resizeGetHeight(int newWidth) override;
|
int resizeGetHeight(int newWidth) override;
|
||||||
|
|
||||||
|
void paintEvent(QPaintEvent *e) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
object_ptr<Ui::FlatLabel> _text;
|
object_ptr<Ui::FlatLabel> _text;
|
||||||
int _height = 0;
|
int _height = 0;
|
||||||
|
@ -70,6 +72,14 @@ int EmptyWidget::resizeGetHeight(int newWidth) {
|
||||||
return _height;
|
return _height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EmptyWidget::paintEvent(QPaintEvent *e) {
|
||||||
|
auto p = QPainter(this);
|
||||||
|
|
||||||
|
const auto iconLeft = (width() - st::infoEmptyFile.width()) / 2;
|
||||||
|
const auto iconTop = height() - st::infoEmptyIconTop;
|
||||||
|
st::infoEmptyFile.paint(p, iconLeft, iconTop, width());
|
||||||
|
}
|
||||||
|
|
||||||
InnerWidget::InnerWidget(
|
InnerWidget::InnerWidget(
|
||||||
QWidget *parent,
|
QWidget *parent,
|
||||||
not_null<Controller*> controller)
|
not_null<Controller*> controller)
|
||||||
|
|
|
@ -114,6 +114,7 @@ void Provider::refreshViewer() {
|
||||||
ranges::remove(_elements, item, &Element::item),
|
ranges::remove(_elements, item, &Element::item),
|
||||||
end(_elements));
|
end(_elements));
|
||||||
}
|
}
|
||||||
|
_fullCount = _elements.size();
|
||||||
if (added) {
|
if (added) {
|
||||||
ranges::sort(_elements, ranges::less(), &Element::started);
|
ranges::sort(_elements, ranges::less(), &Element::started);
|
||||||
_refreshed.fire({});
|
_refreshed.fire({});
|
||||||
|
|
|
@ -51,6 +51,11 @@ Widget::Widget(
|
||||||
_inner = setInnerWidget(object_ptr<InnerWidget>(
|
_inner = setInnerWidget(object_ptr<InnerWidget>(
|
||||||
this,
|
this,
|
||||||
controller));
|
controller));
|
||||||
|
_inner->setScrollHeightValue(scrollHeightValue());
|
||||||
|
_inner->scrollToRequests(
|
||||||
|
) | rpl::start_with_next([this](Ui::ScrollToRequest request) {
|
||||||
|
scrollTo(request);
|
||||||
|
}, _inner->lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Widget::showInternal(not_null<ContentMemento*> memento) {
|
bool Widget::showInternal(not_null<ContentMemento*> memento) {
|
||||||
|
|
|
@ -325,7 +325,7 @@ rpl::producer<bool> Controller::searchEnabledByContent() const {
|
||||||
rpl::producer<QString> Controller::mediaSourceQueryValue() const {
|
rpl::producer<QString> Controller::mediaSourceQueryValue() const {
|
||||||
return _searchController
|
return _searchController
|
||||||
? _searchController->currentQueryValue()
|
? _searchController->currentQueryValue()
|
||||||
: rpl::never<QString>(); // #TODO downloads
|
: rpl::single(QString()); // #TODO downloads
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<SparseIdsMergedSlice> Controller::mediaSource(
|
rpl::producer<SparseIdsMergedSlice> Controller::mediaSource(
|
||||||
|
|
|
@ -479,6 +479,7 @@ int ListWidget::resizeGetHeight(int newWidth) {
|
||||||
|
|
||||||
auto ListWidget::findItemByPoint(QPoint point) const -> FoundItem {
|
auto ListWidget::findItemByPoint(QPoint point) const -> FoundItem {
|
||||||
Expects(!_sections.empty());
|
Expects(!_sections.empty());
|
||||||
|
|
||||||
auto sectionIt = findSectionAfterTop(point.y());
|
auto sectionIt = findSectionAfterTop(point.y());
|
||||||
if (sectionIt == _sections.end()) {
|
if (sectionIt == _sections.end()) {
|
||||||
--sectionIt;
|
--sectionIt;
|
||||||
|
|
|
@ -73,12 +73,12 @@ paymentsSectionButton: SettingsButton(infoProfileButton) {
|
||||||
padding: margins(68px, 11px, 14px, 9px);
|
padding: margins(68px, 11px, 14px, 9px);
|
||||||
}
|
}
|
||||||
|
|
||||||
paymentsIconPaymentMethod: icon {{ "payments/payment_card", menuIconFg }};
|
paymentsIconPaymentMethod: icon {{ "payments/payment_card", windowBoldFg }};
|
||||||
paymentsIconShippingAddress: icon {{ "payments/payment_address", menuIconFg }};
|
paymentsIconShippingAddress: icon {{ "payments/payment_address", windowBoldFg }};
|
||||||
paymentsIconName: icon {{ "payments/payment_name", menuIconFg }};
|
paymentsIconName: icon {{ "payments/payment_name", windowBoldFg }};
|
||||||
paymentsIconEmail: icon {{ "payments/payment_email", menuIconFg }};
|
paymentsIconEmail: icon {{ "payments/payment_email", windowBoldFg }};
|
||||||
paymentsIconPhone: icon {{ "payments/payment_phone", menuIconFg }};
|
paymentsIconPhone: icon {{ "payments/payment_phone", windowBoldFg }};
|
||||||
paymentsIconShippingMethod: icon {{ "payments/payment_shipping", menuIconFg }};
|
paymentsIconShippingMethod: icon {{ "payments/payment_shipping", windowBoldFg }};
|
||||||
|
|
||||||
paymentsField: defaultInputField;
|
paymentsField: defaultInputField;
|
||||||
paymentsMoneyField: InputField(paymentsField) {
|
paymentsMoneyField: InputField(paymentsField) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue