mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-05-19 05:51:16 -04:00
Basic UI: Signal resize of properties view
If the properties view changed in the properties window, the viewport of the properties would not trigger a resize because the size of the window itself does not change. This creates a signal that allows the parent to know whether or not to update a viewport, if any.
This commit is contained in:
@@ -58,6 +58,9 @@ OBSBasicProperties::OBSBasicProperties(QWidget *parent, OBSSource source_)
|
||||
view->setMinimumHeight(150);
|
||||
view->show();
|
||||
|
||||
connect(view, SIGNAL(PropertiesResized()),
|
||||
this, SLOT(OnPropertiesResized()));
|
||||
|
||||
connect(windowHandle(), &QWindow::screenChanged, [this]() {
|
||||
if (resizeTimer)
|
||||
killTimer(resizeTimer);
|
||||
@@ -107,6 +110,13 @@ void OBSBasicProperties::DrawPreview(void *data, uint32_t cx, uint32_t cy)
|
||||
gs_viewport_pop();
|
||||
}
|
||||
|
||||
void OBSBasicProperties::OnPropertiesResized()
|
||||
{
|
||||
if (resizeTimer)
|
||||
killTimer(resizeTimer);
|
||||
resizeTimer = startTimer(100);
|
||||
}
|
||||
|
||||
void OBSBasicProperties::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
if (isVisible()) {
|
||||
|
||||
Reference in New Issue
Block a user