Intro cover now shows palette changes in realtime.

This commit is contained in:
John Preston 2017-02-18 14:29:19 +03:00
parent 8ffdfa7923
commit f2e69d2621
4 changed files with 12 additions and 3 deletions

View File

@ -32,7 +32,7 @@ class FlatLabel;
namespace Intro {
class PhoneWidget : public Widget::Step, private base::Subscriber {
class PhoneWidget : public Widget::Step {
Q_OBJECT
public:

View File

@ -31,7 +31,7 @@ class NewAvatarButton;
namespace Intro {
class SignupWidget : public Widget::Step, private base::Subscriber {
class SignupWidget : public Widget::Step {
Q_OBJECT
public:

View File

@ -43,6 +43,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_boxes.h"
#include "styles/style_intro.h"
#include "styles/style_window.h"
#include "window/themes/window_theme.h"
namespace Intro {
@ -663,6 +664,14 @@ Widget::Step::Step(QWidget *parent, Data *data, bool hasCover) : TWidget(parent)
, _title(this, _hasCover ? st::introCoverTitle : st::introTitle)
, _description(this, object_ptr<Ui::FlatLabel>(this, _hasCover ? st::introCoverDescription : st::introDescription), st::introErrorDuration) {
hide();
subscribe(Window::Theme::Background(), [this](const Window::Theme::BackgroundUpdate &update) {
if (update.paletteChanged()) {
if (!_coverMask.isNull()) {
_coverMask = QPixmap();
prepareCoverMask();
}
}
});
}
void Widget::Step::prepareShowAnimated(Step *after) {

View File

@ -92,7 +92,7 @@ public:
Forward,
Replace,
};
class Step : public TWidget, public RPCSender {
class Step : public TWidget, public RPCSender, protected base::Subscriber {
public:
Step(QWidget *parent, Data *data, bool hasCover = false);