mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-25 01:50:36 +00:00
Add fsqr promo footer.
This commit is contained in:
parent
b83b403b75
commit
8a92c89f39
@ -3199,6 +3199,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_maps_places_in_area" = "Places in this area";
|
||||
"lng_maps_no_places" = "No places found";
|
||||
"lng_maps_choose_to_search" = "Choose location to see places nearby.";
|
||||
"lng_maps_venues_source" = "Powered by Foursquare";
|
||||
"lng_live_location" = "Live Location";
|
||||
"lng_live_location_now" = "updated just now";
|
||||
"lng_live_location_minutes#one" = "updated {count} minute ago";
|
||||
|
@ -1474,3 +1474,4 @@ pickLocationLoading: InfiniteRadialAnimation(defaultInfiniteRadialAnimation) {
|
||||
color: windowSubTextFg;
|
||||
thickness: 4px;
|
||||
}
|
||||
pickLocationPromoHeight: 32px;
|
||||
|
@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/widgets/scroll_area.h"
|
||||
#include "ui/widgets/separate_panel.h"
|
||||
#include "ui/widgets/shadow.h"
|
||||
#include "ui/widgets/buttons.h"
|
||||
#include "ui/wrap/slide_wrap.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
@ -182,6 +183,27 @@ private:
|
||||
return query.trimmed().toLower();
|
||||
}
|
||||
|
||||
[[nodiscard]] object_ptr<RpWidget> MakeFoursquarePromo() {
|
||||
auto result = object_ptr<RpWidget>((QWidget*)nullptr);
|
||||
const auto raw = result.data();
|
||||
raw->resize(0, st::pickLocationPromoHeight);
|
||||
const auto shadow = CreateChild<PlainShadow>(raw);
|
||||
raw->widthValue() | rpl::start_with_next([=](int width) {
|
||||
shadow->setGeometry(0, 0, width, st::lineWidth);
|
||||
}, raw->lifetime());
|
||||
raw->paintRequest() | rpl::start_with_next([=](QRect clip) {
|
||||
auto p = QPainter(raw);
|
||||
p.fillRect(clip, st::windowBg);
|
||||
p.setPen(st::windowSubTextFg);
|
||||
p.setFont(st::normalFont);
|
||||
p.drawText(
|
||||
raw->rect(),
|
||||
tr::lng_maps_venues_source(tr::now),
|
||||
style::al_center);
|
||||
}, raw->lifetime());
|
||||
return result;
|
||||
}
|
||||
|
||||
VenuesController::VenuesController(
|
||||
not_null<Main::Session*> session,
|
||||
rpl::producer<std::vector<VenueData>> content,
|
||||
@ -214,6 +236,11 @@ void VenuesController::rebuild(const std::vector<VenueData> &rows) {
|
||||
delegate()->peerListRemoveRow(delegate()->peerListRowAt(i));
|
||||
--count;
|
||||
}
|
||||
if (i > 0) {
|
||||
delegate()->peerListSetBelowWidget(MakeFoursquarePromo());
|
||||
} else {
|
||||
delegate()->peerListSetBelowWidget({ nullptr });
|
||||
}
|
||||
delegate()->peerListRefreshRows();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user