mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
parent
9401e7cb51
commit
e2439984ae
5 changed files with 17 additions and 15 deletions
|
@ -943,10 +943,10 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
|
|||
auto clip = e->rect();
|
||||
auto context = _controller->preparePaintContext({
|
||||
.theme = _theme.get(),
|
||||
.visibleAreaTop = _visibleTop,
|
||||
.visibleAreaTopGlobal = mapToGlobal(QPoint(0, _visibleTop)).y(),
|
||||
.visibleAreaWidth = width(),
|
||||
.clip = clip,
|
||||
.visibleAreaPositionGlobal = mapToGlobal(QPoint(0, _visibleTop)),
|
||||
.visibleAreaTop = _visibleTop,
|
||||
.visibleAreaWidth = width(),
|
||||
});
|
||||
if (_items.empty() && _upLoaded && _downLoaded) {
|
||||
paintEmpty(p, context.st);
|
||||
|
|
|
@ -979,14 +979,16 @@ void HistoryInner::paintEmpty(
|
|||
|
||||
Ui::ChatPaintContext HistoryInner::preparePaintContext(
|
||||
const QRect &clip) const {
|
||||
const auto visibleAreaTopGlobal = mapToGlobal(
|
||||
QPoint(0, _visibleAreaTop)).y();
|
||||
const auto visibleAreaPositionGlobal = mapToGlobal(
|
||||
QPoint(0, _visibleAreaTop));
|
||||
const auto visibleAreaPositionLocal = mapFromGlobal(
|
||||
visibleAreaPositionGlobal);
|
||||
return _controller->preparePaintContext({
|
||||
.theme = _theme.get(),
|
||||
.visibleAreaTop = _visibleAreaTop,
|
||||
.visibleAreaTopGlobal = visibleAreaTopGlobal,
|
||||
.visibleAreaWidth = width(),
|
||||
.clip = clip,
|
||||
.visibleAreaPositionGlobal = visibleAreaPositionGlobal,
|
||||
.visibleAreaTop = _visibleAreaTop,
|
||||
.visibleAreaWidth = width(),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -2009,10 +2009,10 @@ Ui::ChatPaintContext ListWidget::preparePaintContext(
|
|||
const QRect &clip) const {
|
||||
return controller()->preparePaintContext({
|
||||
.theme = _delegate->listChatTheme(),
|
||||
.visibleAreaTop = _visibleTop,
|
||||
.visibleAreaTopGlobal = mapToGlobal(QPoint(0, _visibleTop)).y(),
|
||||
.visibleAreaWidth = width(),
|
||||
.clip = clip,
|
||||
.visibleAreaPositionGlobal = mapToGlobal(QPoint(0, _visibleTop)),
|
||||
.visibleAreaTop = _visibleTop,
|
||||
.visibleAreaWidth = width(),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -2742,7 +2742,7 @@ void SessionController::openPeerStories(
|
|||
HistoryView::PaintContext SessionController::preparePaintContext(
|
||||
PaintContextArgs &&args) {
|
||||
const auto visibleAreaTopLocal = content()->mapFromGlobal(
|
||||
QPoint(0, args.visibleAreaTopGlobal)).y();
|
||||
args.visibleAreaPositionGlobal).y();
|
||||
const auto viewport = QRect(
|
||||
0,
|
||||
args.visibleAreaTop - visibleAreaTopLocal,
|
||||
|
|
|
@ -565,10 +565,10 @@ public:
|
|||
|
||||
struct PaintContextArgs {
|
||||
not_null<Ui::ChatTheme*> theme;
|
||||
int visibleAreaTop = 0;
|
||||
int visibleAreaTopGlobal = 0;
|
||||
int visibleAreaWidth = 0;
|
||||
QRect clip;
|
||||
QPoint visibleAreaPositionGlobal;
|
||||
int visibleAreaTop = 0;
|
||||
int visibleAreaWidth = 0;
|
||||
};
|
||||
[[nodiscard]] Ui::ChatPaintContext preparePaintContext(
|
||||
PaintContextArgs &&args);
|
||||
|
|
Loading…
Add table
Reference in a new issue