提交 6262abc2 编写于 作者: J jp9000

UI: Resize main preview on the widget's resize signal

Fixes a bug where the preview's size calculations wouldn't update if the
widget itself was resizes but the window wasn't resized.
上级 d7d5e55d
......@@ -162,12 +162,15 @@ OBSBasic::OBSBasic(QWidget *parent)
ui->scenes->setAttribute(Qt::WA_MacShowFocusRect, false);
ui->sources->setAttribute(Qt::WA_MacShowFocusRect, false);
connect(windowHandle(), &QWindow::screenChanged, [this]() {
auto displayResize = [this]() {
struct obs_video_info ovi;
if (obs_get_video_info(&ovi))
ResizePreview(ovi.base_width, ovi.base_height);
});
};
connect(windowHandle(), &QWindow::screenChanged, displayResize);
connect(ui->preview, &OBSQTDisplay::DisplayResized, displayResize);
installEventFilter(CreateShortcutFilter());
......@@ -2312,16 +2315,6 @@ void OBSBasic::changeEvent(QEvent *event)
UNUSED_PARAMETER(event);
}
void OBSBasic::resizeEvent(QResizeEvent *event)
{
struct obs_video_info ovi;
if (obs_get_video_info(&ovi))
ResizePreview(ovi.base_width, ovi.base_height);
OBSMainWindow::resizeEvent(event);
}
void OBSBasic::on_actionShow_Recordings_triggered()
{
const char *mode = config_get_string(basicConfig, "Output", "Mode");
......
......@@ -301,7 +301,6 @@ public:
protected:
virtual void closeEvent(QCloseEvent *event) override;
virtual void changeEvent(QEvent *event) override;
virtual void resizeEvent(QResizeEvent *event) override;
private slots:
void on_actionShow_Recordings_triggered();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册