2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Remove some usages of App::main().

This commit is contained in:
John Preston
2020-06-10 22:08:17 +04:00
parent ea86433be5
commit ee43027bea
53 changed files with 518 additions and 429 deletions

View File

@@ -84,17 +84,20 @@ QPixmap SectionWidget::grabForShowAnimation(
return Ui::GrabWidget(this);
}
void SectionWidget::PaintBackground(not_null<QWidget*> widget, QRect clip) {
void SectionWidget::PaintBackground(
not_null<Window::SessionController*> controller,
not_null<QWidget*> widget,
QRect clip) {
Painter p(widget);
auto fill = QRect(0, 0, widget->width(), App::main()->height());
auto fill = QRect(0, 0, widget->width(), controller->content()->height());
if (const auto color = Window::Theme::Background()->colorForFill()) {
p.fillRect(fill, *color);
return;
}
auto fromy = App::main()->backgroundFromY();
auto fromy = controller->content()->backgroundFromY();
auto x = 0, y = 0;
auto cached = App::main()->cachedBackground(fill, x, y);
auto cached = controller->content()->cachedBackground(fill, x, y);
if (cached.isNull()) {
if (Window::Theme::Background()->tile()) {
auto &pix = Window::Theme::Background()->pixmapForTiled();