From 99d7d134a7c8376c8755278e57b2cd696d575e5e Mon Sep 17 00:00:00 2001 From: Warchamp7 Date: Tue, 15 Apr 2025 15:32:55 -0400 Subject: [PATCH] frontend: Clip source names when dock too small --- frontend/components/SourceTreeItem.cpp | 4 ++-- frontend/data/themes/Yami.obt | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/components/SourceTreeItem.cpp b/frontend/components/SourceTreeItem.cpp index 8d652d605..46c94e42f 100644 --- a/frontend/components/SourceTreeItem.cpp +++ b/frontend/components/SourceTreeItem.cpp @@ -58,6 +58,7 @@ SourceTreeItem::SourceTreeItem(SourceTree *tree_, OBSSceneItem sceneitem_) : tre QPixmap pixmap = icon.pixmap(QSize(16, 16)); iconLabel = new QLabel(); + iconLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); iconLabel->setPixmap(pixmap); iconLabel->setEnabled(sourceVisible); iconLabel->setStyleSheet("background: none"); @@ -77,8 +78,7 @@ SourceTreeItem::SourceTreeItem(SourceTree *tree_, OBSSceneItem sceneitem_) : tre lock->setAccessibleDescription(QTStr("Basic.Main.Sources.LockDescription").arg(name)); label = new OBSSourceLabel(source); - label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); - label->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); + label->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred); label->setAttribute(Qt::WA_TranslucentBackground); label->setEnabled(sourceVisible); diff --git a/frontend/data/themes/Yami.obt b/frontend/data/themes/Yami.obt index 695191baf..0190ac528 100644 --- a/frontend/data/themes/Yami.obt +++ b/frontend/data/themes/Yami.obt @@ -543,6 +543,11 @@ SourceTreeItem { color: var(--text); } +SourceTreeItem .checkbox-icon { + margin-right: 0; + margin-left: var(--spacing_large); +} + QMenu::item:selected, QListView::item:selected, QListWidget::item:selected {