Intro cover now shows palette changes in realtime.
This commit is contained in:
		
							parent
							
								
									8ffdfa7923
								
							
						
					
					
						commit
						f2e69d2621
					
				
					 4 changed files with 12 additions and 3 deletions
				
			
		| 
						 | 
					@ -32,7 +32,7 @@ class FlatLabel;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Intro {
 | 
					namespace Intro {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class PhoneWidget : public Widget::Step, private base::Subscriber {
 | 
					class PhoneWidget : public Widget::Step {
 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,7 +31,7 @@ class NewAvatarButton;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Intro {
 | 
					namespace Intro {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class SignupWidget : public Widget::Step, private base::Subscriber {
 | 
					class SignupWidget : public Widget::Step {
 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -43,6 +43,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
 | 
				
			||||||
#include "styles/style_boxes.h"
 | 
					#include "styles/style_boxes.h"
 | 
				
			||||||
#include "styles/style_intro.h"
 | 
					#include "styles/style_intro.h"
 | 
				
			||||||
#include "styles/style_window.h"
 | 
					#include "styles/style_window.h"
 | 
				
			||||||
 | 
					#include "window/themes/window_theme.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Intro {
 | 
					namespace Intro {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -663,6 +664,14 @@ Widget::Step::Step(QWidget *parent, Data *data, bool hasCover) : TWidget(parent)
 | 
				
			||||||
, _title(this, _hasCover ? st::introCoverTitle : st::introTitle)
 | 
					, _title(this, _hasCover ? st::introCoverTitle : st::introTitle)
 | 
				
			||||||
, _description(this, object_ptr<Ui::FlatLabel>(this, _hasCover ? st::introCoverDescription : st::introDescription), st::introErrorDuration) {
 | 
					, _description(this, object_ptr<Ui::FlatLabel>(this, _hasCover ? st::introCoverDescription : st::introDescription), st::introErrorDuration) {
 | 
				
			||||||
	hide();
 | 
						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) {
 | 
					void Widget::Step::prepareShowAnimated(Step *after) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -92,7 +92,7 @@ public:
 | 
				
			||||||
		Forward,
 | 
							Forward,
 | 
				
			||||||
		Replace,
 | 
							Replace,
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
	class Step : public TWidget, public RPCSender {
 | 
						class Step : public TWidget, public RPCSender, protected base::Subscriber {
 | 
				
			||||||
	public:
 | 
						public:
 | 
				
			||||||
		Step(QWidget *parent, Data *data, bool hasCover = false);
 | 
							Step(QWidget *parent, Data *data, bool hasCover = false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue