Use RpWidget::shownValue instead of QWindow::visibleChanged
This commit is contained in:
parent
a22cf8e303
commit
f768e405fa
|
@ -378,11 +378,10 @@ HistoryWidget::HistoryWidget(
|
|||
_field->setEnabled(shown);
|
||||
}, _field->lifetime());
|
||||
#endif // Q_OS_MAC
|
||||
connect(
|
||||
controller->widget()->windowHandle(),
|
||||
&QWindow::visibleChanged,
|
||||
this,
|
||||
[=] { windowIsVisibleChanged(); });
|
||||
controller->widget()->shownValue(
|
||||
) | rpl::skip(1) | rpl::start_with_next([=] {
|
||||
windowIsVisibleChanged();
|
||||
}, lifetime());
|
||||
|
||||
initTabbedSelector();
|
||||
|
||||
|
|
|
@ -358,6 +358,13 @@ MainWindow::MainWindow(not_null<Controller*> controller)
|
|||
});
|
||||
}, lifetime());
|
||||
|
||||
shownValue(
|
||||
) | rpl::skip(1) | rpl::start_with_next([=](bool visible) {
|
||||
InvokeQueued(this, [=] {
|
||||
handleVisibleChanged(visible);
|
||||
});
|
||||
}, lifetime());
|
||||
|
||||
body()->sizeValue(
|
||||
) | rpl::start_with_next([=](QSize size) {
|
||||
updateControlsGeometry();
|
||||
|
@ -457,11 +464,6 @@ void MainWindow::init() {
|
|||
&QWindow::windowStateChanged,
|
||||
this,
|
||||
[=](Qt::WindowState state) { handleStateChanged(state); });
|
||||
connect(
|
||||
windowHandle(),
|
||||
&QWindow::visibleChanged,
|
||||
this,
|
||||
[=](bool visible) { handleVisibleChanged(visible); });
|
||||
|
||||
updatePalette();
|
||||
|
||||
|
|
Loading…
Reference in New Issue