mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-01 01:45:06 +00:00
70 lines
1.4 KiB
C++
70 lines
1.4 KiB
C++
/*
|
|
This file is part of Telegram Desktop,
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
For license and copyright information please follow this link:
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
*/
|
|
#include "info/bot/earn/info_earn_inner_widget.h"
|
|
|
|
#include "data/data_user.h"
|
|
#include "info/bot/earn/info_earn_widget.h"
|
|
#include "info/info_controller.h"
|
|
|
|
namespace Info::BotEarn {
|
|
namespace {
|
|
} // namespace
|
|
|
|
InnerWidget::InnerWidget(
|
|
QWidget *parent,
|
|
not_null<Controller*> controller,
|
|
not_null<PeerData*> peer)
|
|
: VerticalLayout(parent)
|
|
, _controller(controller)
|
|
, _peer(peer)
|
|
, _show(controller->uiShow()) {
|
|
}
|
|
|
|
void InnerWidget::load() {
|
|
}
|
|
|
|
void InnerWidget::fill() {
|
|
}
|
|
|
|
void InnerWidget::saveState(not_null<Memento*> memento) {
|
|
memento->setState(base::take(_state));
|
|
}
|
|
|
|
void InnerWidget::restoreState(not_null<Memento*> memento) {
|
|
_state = memento->state();
|
|
if (_state) {
|
|
fill();
|
|
} else {
|
|
load();
|
|
}
|
|
Ui::RpWidget::resizeToWidth(width());
|
|
}
|
|
|
|
rpl::producer<Ui::ScrollToRequest> InnerWidget::scrollToRequests() const {
|
|
return _scrollToRequests.events();
|
|
}
|
|
|
|
auto InnerWidget::showRequests() const -> rpl::producer<ShowRequest> {
|
|
return _showRequests.events();
|
|
}
|
|
|
|
void InnerWidget::showFinished() {
|
|
_showFinished.fire({});
|
|
}
|
|
|
|
void InnerWidget::setInnerFocus() {
|
|
_focusRequested.fire({});
|
|
}
|
|
|
|
not_null<PeerData*> InnerWidget::peer() const {
|
|
return _peer;
|
|
}
|
|
|
|
} // namespace Info::BotEarn
|
|
|