mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
UI: Update window titles on source name change
This commit is contained in:
@@ -35,6 +35,8 @@ OBSBasicInteraction::OBSBasicInteraction(QWidget *parent, OBSSource source_)
|
||||
source (source_),
|
||||
removedSignal (obs_source_get_signal_handler(source), "remove",
|
||||
OBSBasicInteraction::SourceRemoved, this),
|
||||
renamedSignal (obs_source_get_signal_handler(source), "rename",
|
||||
OBSBasicInteraction::SourceRenamed, this),
|
||||
eventFilter (BuildEventFilter())
|
||||
{
|
||||
int cx = (int)config_get_int(App()->GlobalConfig(), "InteractionWindow",
|
||||
@@ -115,6 +117,15 @@ void OBSBasicInteraction::SourceRemoved(void *data, calldata_t *params)
|
||||
UNUSED_PARAMETER(params);
|
||||
}
|
||||
|
||||
void OBSBasicInteraction::SourceRenamed(void *data, calldata_t *params)
|
||||
{
|
||||
const char *name = calldata_string(params, "new_name");
|
||||
QString title = QTStr("Basic.InteractionWindow").arg(QT_UTF8(name));
|
||||
|
||||
QMetaObject::invokeMethod(static_cast<OBSBasicProperties*>(data),
|
||||
"setWindowTitle", Q_ARG(QString, title));
|
||||
}
|
||||
|
||||
void OBSBasicInteraction::DrawPreview(void *data, uint32_t cx, uint32_t cy)
|
||||
{
|
||||
OBSBasicInteraction *window = static_cast<OBSBasicInteraction*>(data);
|
||||
|
||||
Reference in New Issue
Block a user