mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-02-18 15:04:53 -05:00
UI: Update Edit Transform dialog on scene switch
Closes obsproject/obs-studio#4312
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include "window-basic-transform.hpp"
|
||||
#include "window-basic-main.hpp"
|
||||
|
||||
Q_DECLARE_METATYPE(OBSScene);
|
||||
Q_DECLARE_METATYPE(OBSSceneItem);
|
||||
|
||||
static bool find_sel(obs_scene_t *, obs_sceneitem_t *item, void *param)
|
||||
@@ -351,3 +352,18 @@ void OBSBasicTransform::on_resetButton_clicked()
|
||||
{
|
||||
main->on_actionResetTransform_triggered();
|
||||
}
|
||||
|
||||
template<typename T> static T GetOBSRef(QListWidgetItem *item)
|
||||
{
|
||||
return item->data(static_cast<int>(QtDataRole::OBSRef)).value<T>();
|
||||
}
|
||||
|
||||
void OBSBasicTransform::OnSceneChanged(QListWidgetItem *current,
|
||||
QListWidgetItem *)
|
||||
{
|
||||
if (!current)
|
||||
return;
|
||||
|
||||
obs_scene_t *scene = GetOBSRef<OBSScene>(current);
|
||||
this->SetScene(scene);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user