mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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 clip = e->rect();
|
||||||
auto context = _controller->preparePaintContext({
|
auto context = _controller->preparePaintContext({
|
||||||
.theme = _theme.get(),
|
.theme = _theme.get(),
|
||||||
.visibleAreaTop = _visibleTop,
|
|
||||||
.visibleAreaTopGlobal = mapToGlobal(QPoint(0, _visibleTop)).y(),
|
|
||||||
.visibleAreaWidth = width(),
|
|
||||||
.clip = clip,
|
.clip = clip,
|
||||||
|
.visibleAreaPositionGlobal = mapToGlobal(QPoint(0, _visibleTop)),
|
||||||
|
.visibleAreaTop = _visibleTop,
|
||||||
|
.visibleAreaWidth = width(),
|
||||||
});
|
});
|
||||||
if (_items.empty() && _upLoaded && _downLoaded) {
|
if (_items.empty() && _upLoaded && _downLoaded) {
|
||||||
paintEmpty(p, context.st);
|
paintEmpty(p, context.st);
|
||||||
|
|
|
@ -979,14 +979,16 @@ void HistoryInner::paintEmpty(
|
||||||
|
|
||||||
Ui::ChatPaintContext HistoryInner::preparePaintContext(
|
Ui::ChatPaintContext HistoryInner::preparePaintContext(
|
||||||
const QRect &clip) const {
|
const QRect &clip) const {
|
||||||
const auto visibleAreaTopGlobal = mapToGlobal(
|
const auto visibleAreaPositionGlobal = mapToGlobal(
|
||||||
QPoint(0, _visibleAreaTop)).y();
|
QPoint(0, _visibleAreaTop));
|
||||||
|
const auto visibleAreaPositionLocal = mapFromGlobal(
|
||||||
|
visibleAreaPositionGlobal);
|
||||||
return _controller->preparePaintContext({
|
return _controller->preparePaintContext({
|
||||||
.theme = _theme.get(),
|
.theme = _theme.get(),
|
||||||
.visibleAreaTop = _visibleAreaTop,
|
|
||||||
.visibleAreaTopGlobal = visibleAreaTopGlobal,
|
|
||||||
.visibleAreaWidth = width(),
|
|
||||||
.clip = clip,
|
.clip = clip,
|
||||||
|
.visibleAreaPositionGlobal = visibleAreaPositionGlobal,
|
||||||
|
.visibleAreaTop = _visibleAreaTop,
|
||||||
|
.visibleAreaWidth = width(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2009,10 +2009,10 @@ Ui::ChatPaintContext ListWidget::preparePaintContext(
|
||||||
const QRect &clip) const {
|
const QRect &clip) const {
|
||||||
return controller()->preparePaintContext({
|
return controller()->preparePaintContext({
|
||||||
.theme = _delegate->listChatTheme(),
|
.theme = _delegate->listChatTheme(),
|
||||||
.visibleAreaTop = _visibleTop,
|
|
||||||
.visibleAreaTopGlobal = mapToGlobal(QPoint(0, _visibleTop)).y(),
|
|
||||||
.visibleAreaWidth = width(),
|
|
||||||
.clip = clip,
|
.clip = clip,
|
||||||
|
.visibleAreaPositionGlobal = mapToGlobal(QPoint(0, _visibleTop)),
|
||||||
|
.visibleAreaTop = _visibleTop,
|
||||||
|
.visibleAreaWidth = width(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2742,7 +2742,7 @@ void SessionController::openPeerStories(
|
||||||
HistoryView::PaintContext SessionController::preparePaintContext(
|
HistoryView::PaintContext SessionController::preparePaintContext(
|
||||||
PaintContextArgs &&args) {
|
PaintContextArgs &&args) {
|
||||||
const auto visibleAreaTopLocal = content()->mapFromGlobal(
|
const auto visibleAreaTopLocal = content()->mapFromGlobal(
|
||||||
QPoint(0, args.visibleAreaTopGlobal)).y();
|
args.visibleAreaPositionGlobal).y();
|
||||||
const auto viewport = QRect(
|
const auto viewport = QRect(
|
||||||
0,
|
0,
|
||||||
args.visibleAreaTop - visibleAreaTopLocal,
|
args.visibleAreaTop - visibleAreaTopLocal,
|
||||||
|
|
|
@ -565,10 +565,10 @@ public:
|
||||||
|
|
||||||
struct PaintContextArgs {
|
struct PaintContextArgs {
|
||||||
not_null<Ui::ChatTheme*> theme;
|
not_null<Ui::ChatTheme*> theme;
|
||||||
int visibleAreaTop = 0;
|
|
||||||
int visibleAreaTopGlobal = 0;
|
|
||||||
int visibleAreaWidth = 0;
|
|
||||||
QRect clip;
|
QRect clip;
|
||||||
|
QPoint visibleAreaPositionGlobal;
|
||||||
|
int visibleAreaTop = 0;
|
||||||
|
int visibleAreaWidth = 0;
|
||||||
};
|
};
|
||||||
[[nodiscard]] Ui::ChatPaintContext preparePaintContext(
|
[[nodiscard]] Ui::ChatPaintContext preparePaintContext(
|
||||||
PaintContextArgs &&args);
|
PaintContextArgs &&args);
|
||||||
|
|
Loading…
Add table
Reference in a new issue