Refresh multiview names without recreating stream tiles
This commit is contained in:
1 parent
3ff5ca7009
commit
5286388ada
2 files changed
+15
-4
No files matched your search
@@ -58,8 +58,8 @@ void StreamGridWindow::createTile(Tile& tile) {
|
||||
tile.widget = new QWidget(this);
|
||||
tile.widget->setObjectName(QStringLiteral("streamPreview_%1").arg(tile.source));
|
||||
auto* layout = new QVBoxLayout(tile.widget); layout->setContentsMargins(3, 3, 3, 3); layout->setSpacing(2);
|
||||
auto* name = new QLabel(tile.name, tile.widget); name->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
|
||||
name->setToolTip(tile.name); layout->addWidget(name);
|
||||
tile.title = new QLabel(tile.name, tile.widget); tile.title->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
|
||||
tile.title->setToolTip(tile.name); layout->addWidget(tile.title);
|
||||
tile.status = new QLabel(text("Connecting…"), tile.widget); layout->addWidget(tile.status);
|
||||
#ifdef HAVE_STREAM_CAPTURE
|
||||
auto* preview = new QVideoWidget(tile.widget); preview->setAspectRatioMode(Qt::KeepAspectRatio);
|
||||
@@ -177,7 +177,17 @@ void StreamGridWindow::onSources(const uint8_t* data, int length) {
|
||||
continue;
|
||||
}
|
||||
tile.removeAt = -1;
|
||||
if (tile.epoch == source->epoch && tile.self == source->self) continue;
|
||||
if (tile.epoch == source->epoch && tile.self == source->self) {
|
||||
if (tile.name != source->name) {
|
||||
const QString previous = tile.name; tile.name = source->name;
|
||||
if (tile.self) { tile.title->setText(tile.name); tile.title->setToolTip(tile.name); }
|
||||
else tile.player->setSourceName(tile.name);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_STREAM, "desktop multiview source renamed group=%llx source=%llx epoch=%llx self=%d old=%s new=%s",
|
||||
(unsigned long long)m_group, (unsigned long long)tile.source, (unsigned long long)tile.epoch,
|
||||
tile.self, qPrintable(previous), qPrintable(tile.name));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (m_focused == tile.source) restoreGrid();
|
||||
delete tile.widget;
|
||||
tile = Tile{source->id, source->epoch, source->name, source->self}; createTile(tile);
|
||||
|
||||
Reference in new issue
Block a user