mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-04 08:25:38 +00:00
Use RpWidget::shownValue instead of QWindow::visibleChanged
This commit is contained in:
@@ -378,11 +378,10 @@ HistoryWidget::HistoryWidget(
|
|||||||
_field->setEnabled(shown);
|
_field->setEnabled(shown);
|
||||||
}, _field->lifetime());
|
}, _field->lifetime());
|
||||||
#endif // Q_OS_MAC
|
#endif // Q_OS_MAC
|
||||||
connect(
|
controller->widget()->shownValue(
|
||||||
controller->widget()->windowHandle(),
|
) | rpl::skip(1) | rpl::start_with_next([=] {
|
||||||
&QWindow::visibleChanged,
|
windowIsVisibleChanged();
|
||||||
this,
|
}, lifetime());
|
||||||
[=] { windowIsVisibleChanged(); });
|
|
||||||
|
|
||||||
initTabbedSelector();
|
initTabbedSelector();
|
||||||
|
|
||||||
|
@@ -358,6 +358,13 @@ MainWindow::MainWindow(not_null<Controller*> controller)
|
|||||||
});
|
});
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
|
shownValue(
|
||||||
|
) | rpl::skip(1) | rpl::start_with_next([=](bool visible) {
|
||||||
|
InvokeQueued(this, [=] {
|
||||||
|
handleVisibleChanged(visible);
|
||||||
|
});
|
||||||
|
}, lifetime());
|
||||||
|
|
||||||
body()->sizeValue(
|
body()->sizeValue(
|
||||||
) | rpl::start_with_next([=](QSize size) {
|
) | rpl::start_with_next([=](QSize size) {
|
||||||
updateControlsGeometry();
|
updateControlsGeometry();
|
||||||
@@ -457,11 +464,6 @@ void MainWindow::init() {
|
|||||||
&QWindow::windowStateChanged,
|
&QWindow::windowStateChanged,
|
||||||
this,
|
this,
|
||||||
[=](Qt::WindowState state) { handleStateChanged(state); });
|
[=](Qt::WindowState state) { handleStateChanged(state); });
|
||||||
connect(
|
|
||||||
windowHandle(),
|
|
||||||
&QWindow::visibleChanged,
|
|
||||||
this,
|
|
||||||
[=](bool visible) { handleVisibleChanged(visible); });
|
|
||||||
|
|
||||||
updatePalette();
|
updatePalette();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user