2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Separate form controller from view controller.

This commit is contained in:
John Preston
2018-03-29 23:49:31 +04:00
parent b0a9d26a94
commit a2dabfde56
19 changed files with 668 additions and 302 deletions

View File

@@ -94,7 +94,12 @@ public:
setFocus();
}
base::Observable<void> boxClosing;
rpl::producer<> boxClosing() const {
return _boxClosingStream.events();
}
void notifyBoxClosing() {
_boxClosingStream.fire({});
}
void setDelegate(BoxContentDelegate *newDelegate) {
_delegate = newDelegate;
@@ -201,6 +206,8 @@ private:
object_ptr<QTimer> _draggingScrollTimer = { nullptr };
int _draggingScrollDelta = 0;
rpl::event_stream<> _boxClosingStream;
};
class AbstractBox
@@ -249,7 +256,7 @@ protected:
_content->setInnerFocus();
}
void closeHook() override {
_content->boxClosing.notify(true);
_content->notifyBoxClosing();
}
private: