2016-08-17 15:14:08 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2016-08-17 15:14:08 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2016-08-17 15:14:08 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2017-02-03 20:07:26 +00:00
|
|
|
#include "settings/settings_layer.h"
|
2017-09-13 16:57:44 +00:00
|
|
|
#include "ui/wrap/vertical_layout.h"
|
2017-02-03 20:07:26 +00:00
|
|
|
|
2016-08-17 15:14:08 +00:00
|
|
|
namespace Settings {
|
|
|
|
|
|
|
|
class CoverWidget;
|
|
|
|
class BlockWidget;
|
|
|
|
|
2017-02-03 20:07:26 +00:00
|
|
|
class InnerWidget : public LayerInner, private base::Subscriber {
|
2016-08-17 15:14:08 +00:00
|
|
|
public:
|
|
|
|
InnerWidget(QWidget *parent);
|
|
|
|
|
|
|
|
// Count new height for width=newWidth and resize to it.
|
2017-02-03 20:07:26 +00:00
|
|
|
void resizeToWidth(int newWidth, int contentLeft) override {
|
2016-08-22 17:16:21 +00:00
|
|
|
_contentLeft = contentLeft;
|
|
|
|
return TWidget::resizeToWidth(newWidth);
|
|
|
|
}
|
2016-08-17 15:14:08 +00:00
|
|
|
|
2016-08-22 17:16:21 +00:00
|
|
|
protected:
|
|
|
|
int resizeGetHeight(int newWidth) override;
|
2017-09-13 16:57:44 +00:00
|
|
|
void visibleTopBottomUpdated(
|
|
|
|
int visibleTop,
|
|
|
|
int visibleBottom) override;
|
2016-08-22 17:16:21 +00:00
|
|
|
|
2016-08-17 15:14:08 +00:00
|
|
|
private:
|
2017-04-18 17:37:14 +00:00
|
|
|
void fullRebuild();
|
2016-08-19 17:26:31 +00:00
|
|
|
void refreshBlocks();
|
|
|
|
|
2016-12-13 17:07:56 +00:00
|
|
|
object_ptr<CoverWidget> _cover = { nullptr };
|
2017-09-13 16:57:44 +00:00
|
|
|
object_ptr<Ui::VerticalLayout> _blocks;
|
2016-08-17 15:14:08 +00:00
|
|
|
|
2016-08-19 17:26:31 +00:00
|
|
|
UserData *_self = nullptr;
|
|
|
|
|
2016-08-22 17:16:21 +00:00
|
|
|
int _contentLeft = 0;
|
|
|
|
|
2016-08-17 15:14:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Settings
|