2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-10-17 14:19:43 +00:00

First version of CalendarBox is done.

Also moved BackgroundBox::Inner declaration inside backgroundbox.cpp
This commit is contained in:
John Preston
2017-03-07 17:03:07 +03:00
parent 6d80471fc9
commit ae977044f6
13 changed files with 600 additions and 78 deletions

View File

@@ -29,6 +29,36 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/effects/round_checkbox.h"
#include "auth_session.h"
class BackgroundBox::Inner : public TWidget, public RPCSender, private base::Subscriber {
public:
Inner(QWidget *parent);
void setBackgroundChosenCallback(base::lambda<void(int index)> callback) {
_backgroundChosenCallback = std::move(callback);
}
~Inner();
protected:
void paintEvent(QPaintEvent *e) override;
void mouseMoveEvent(QMouseEvent *e) override;
void mousePressEvent(QMouseEvent *e) override;
void mouseReleaseEvent(QMouseEvent *e) override;
private:
void gotWallpapers(const MTPVector<MTPWallPaper> &result);
void updateWallpapers();
base::lambda<void(int index)> _backgroundChosenCallback;
int _bgCount = 0;
int _rows = 0;
int _over = -1;
int _overDown = -1;
std::unique_ptr<Ui::RoundCheckbox> _check; // this is not a widget
};
BackgroundBox::BackgroundBox(QWidget*) {
}