From 60c77aa9155f9114ca8598ea127246418b47b1a6 Mon Sep 17 00:00:00 2001 From: gxalpha Date: Mon, 11 Sep 2023 13:41:47 +0200 Subject: [PATCH] UI: Replace SourceTreeSubItemCheckBox class with Qt property --- UI/data/themes/Acri.qss | 12 ++++++------ UI/data/themes/Dark.qss | 8 ++++---- UI/data/themes/Grey.qss | 12 ++++++------ UI/data/themes/Light.qss | 12 ++++++------ UI/data/themes/Rachni.qss | 12 ++++++------ UI/data/themes/System.qss | 8 ++++---- UI/data/themes/Yami.qss | 12 ++++++------ UI/source-tree.cpp | 3 ++- UI/source-tree.hpp | 4 ---- 9 files changed, 40 insertions(+), 43 deletions(-) diff --git a/UI/data/themes/Acri.qss b/UI/data/themes/Acri.qss index 0fea20361..a4be95b8c 100644 --- a/UI/data/themes/Acri.qss +++ b/UI/data/themes/Acri.qss @@ -1291,24 +1291,24 @@ OBSHotkeyWidget QPushButton { /* Sources List Group Collapse Checkbox */ -SourceTreeSubItemCheckBox { +QCheckBox[sourceTreeSubItem=true] { background: transparent; outline: none; padding: 0px; } -SourceTreeSubItemCheckBox::indicator { +QCheckBox[sourceTreeSubItem=true]::indicator { width: 12px; height: 12px; } -SourceTreeSubItemCheckBox::indicator:checked, -SourceTreeSubItemCheckBox::indicator:checked:hover { +QCheckBox[sourceTreeSubItem=true]::indicator:checked, +QCheckBox[sourceTreeSubItem=true]::indicator:checked:hover { image: url(theme:Dark/expand.svg); } -SourceTreeSubItemCheckBox::indicator:unchecked, -SourceTreeSubItemCheckBox::indicator:unchecked:hover { +QCheckBox[sourceTreeSubItem=true]::indicator:unchecked, +QCheckBox[sourceTreeSubItem=true]::indicator:unchecked:hover { image: url(theme:Dark/collapse.svg); } diff --git a/UI/data/themes/Dark.qss b/UI/data/themes/Dark.qss index 4e511cc52..a2e262d4e 100644 --- a/UI/data/themes/Dark.qss +++ b/UI/data/themes/Dark.qss @@ -697,21 +697,21 @@ OBSHotkeyLabel[hotkeyPairHover=true] { /* Group Collapse Checkbox */ -SourceTreeSubItemCheckBox { +QCheckBox[sourceTreeSubItem=true] { background: transparent; outline: none; } -SourceTreeSubItemCheckBox::indicator { +QCheckBox[sourceTreeSubItem=true]::indicator { width: 10px; height: 10px; } -SourceTreeSubItemCheckBox::indicator:checked { +QCheckBox[sourceTreeSubItem=true]::indicator:checked { image: url(theme:Dark/expand.svg); } -SourceTreeSubItemCheckBox::indicator:unchecked { +QCheckBox[sourceTreeSubItem=true]::indicator:unchecked { image: url(theme:Dark/collapse.svg); } diff --git a/UI/data/themes/Grey.qss b/UI/data/themes/Grey.qss index 5e458d2f9..b19434bfd 100644 --- a/UI/data/themes/Grey.qss +++ b/UI/data/themes/Grey.qss @@ -1279,24 +1279,24 @@ OBSHotkeyWidget QPushButton { /* Sources List Group Collapse Checkbox */ -SourceTreeSubItemCheckBox { +QCheckBox[sourceTreeSubItem=true] { background: transparent; outline: none; padding: 0px; } -SourceTreeSubItemCheckBox::indicator { +QCheckBox[sourceTreeSubItem=true]::indicator { width: 12px; height: 12px; } -SourceTreeSubItemCheckBox::indicator:checked, -SourceTreeSubItemCheckBox::indicator:checked:hover { +QCheckBox[sourceTreeSubItem=true]::indicator:checked, +QCheckBox[sourceTreeSubItem=true]::indicator:checked:hover { image: url(theme:Dark/expand.svg); } -SourceTreeSubItemCheckBox::indicator:unchecked, -SourceTreeSubItemCheckBox::indicator:unchecked:hover { +QCheckBox[sourceTreeSubItem=true]::indicator:unchecked, +QCheckBox[sourceTreeSubItem=true]::indicator:unchecked:hover { image: url(theme:Dark/collapse.svg); } diff --git a/UI/data/themes/Light.qss b/UI/data/themes/Light.qss index e25812fb7..87795ed52 100644 --- a/UI/data/themes/Light.qss +++ b/UI/data/themes/Light.qss @@ -1279,24 +1279,24 @@ OBSHotkeyWidget QPushButton { /* Sources List Group Collapse Checkbox */ -SourceTreeSubItemCheckBox { +QCheckBox[sourceTreeSubItem=true] { background: transparent; outline: none; padding: 0px; } -SourceTreeSubItemCheckBox::indicator { +QCheckBox[sourceTreeSubItem=true]::indicator { width: 12px; height: 12px; } -SourceTreeSubItemCheckBox::indicator:checked, -SourceTreeSubItemCheckBox::indicator:checked:hover { +QCheckBox[sourceTreeSubItem=true]::indicator:checked, +QCheckBox[sourceTreeSubItem=true]::indicator:checked:hover { image: url(theme:Light/expand.svg); } -SourceTreeSubItemCheckBox::indicator:unchecked, -SourceTreeSubItemCheckBox::indicator:unchecked:hover { +QCheckBox[sourceTreeSubItem=true]::indicator:unchecked, +QCheckBox[sourceTreeSubItem=true]::indicator:unchecked:hover { image: url(theme:Light/collapse.svg); } diff --git a/UI/data/themes/Rachni.qss b/UI/data/themes/Rachni.qss index d7663e649..579737ea9 100644 --- a/UI/data/themes/Rachni.qss +++ b/UI/data/themes/Rachni.qss @@ -1283,24 +1283,24 @@ OBSHotkeyWidget QPushButton { /* Sources List Group Collapse Checkbox */ -SourceTreeSubItemCheckBox { +QCheckBox[sourceTreeSubItem=true] { background: transparent; outline: none; padding: 0px; } -SourceTreeSubItemCheckBox::indicator { +QCheckBox[sourceTreeSubItem=true]::indicator { width: 12px; height: 12px; } -SourceTreeSubItemCheckBox::indicator:checked, -SourceTreeSubItemCheckBox::indicator:checked:hover { +QCheckBox[sourceTreeSubItem=true]::indicator:checked, +QCheckBox[sourceTreeSubItem=true]::indicator:checked:hover { image: url(theme:Dark/expand.svg); } -SourceTreeSubItemCheckBox::indicator:unchecked, -SourceTreeSubItemCheckBox::indicator:unchecked:hover { +QCheckBox[sourceTreeSubItem=true]::indicator:unchecked, +QCheckBox[sourceTreeSubItem=true]::indicator:unchecked:hover { image: url(theme:Dark/collapse.svg); } diff --git a/UI/data/themes/System.qss b/UI/data/themes/System.qss index 69ca1f239..a2476d367 100644 --- a/UI/data/themes/System.qss +++ b/UI/data/themes/System.qss @@ -78,21 +78,21 @@ MuteCheckBox::indicator:unchecked { image: url(:/settings/images/settings/audio.svg); } -SourceTreeSubItemCheckBox { +QCheckBox[sourceTreeSubItem=true] { background: transparent; outline: none; } -SourceTreeSubItemCheckBox::indicator { +QCheckBox[sourceTreeSubItem=true]::indicator { width: 10px; height: 10px; } -SourceTreeSubItemCheckBox::indicator:checked { +QCheckBox[sourceTreeSubItem=true]::indicator:checked { image: url(:/res/images/expand.svg); } -SourceTreeSubItemCheckBox::indicator:unchecked { +QCheckBox[sourceTreeSubItem=true]::indicator:unchecked { image: url(:/res/images/collapse.svg); } diff --git a/UI/data/themes/Yami.qss b/UI/data/themes/Yami.qss index a21e90082..819b507ec 100644 --- a/UI/data/themes/Yami.qss +++ b/UI/data/themes/Yami.qss @@ -1283,24 +1283,24 @@ OBSHotkeyWidget QPushButton { /* Sources List Group Collapse Checkbox */ -SourceTreeSubItemCheckBox { +QCheckBox[sourceTreeSubItem=true] { background: transparent; outline: none; padding: 0px; } -SourceTreeSubItemCheckBox::indicator { +QCheckBox[sourceTreeSubItem=true]::indicator { width: 12px; height: 12px; } -SourceTreeSubItemCheckBox::indicator:checked, -SourceTreeSubItemCheckBox::indicator:checked:hover { +QCheckBox[sourceTreeSubItem=true]::indicator:checked, +QCheckBox[sourceTreeSubItem=true]::indicator:checked:hover { image: url(theme:Dark/expand.svg); } -SourceTreeSubItemCheckBox::indicator:unchecked, -SourceTreeSubItemCheckBox::indicator:unchecked:hover { +QCheckBox[sourceTreeSubItem=true]::indicator:unchecked, +QCheckBox[sourceTreeSubItem=true]::indicator:unchecked:hover { image: url(theme:Dark/collapse.svg); } diff --git a/UI/source-tree.cpp b/UI/source-tree.cpp index 906535a30..66f44da71 100644 --- a/UI/source-tree.cpp +++ b/UI/source-tree.cpp @@ -577,7 +577,8 @@ void SourceTreeItem::Update(bool force) boxLayout->insertItem(0, spacer); } else if (type == Type::Group) { - expand = new SourceTreeSubItemCheckBox(); + expand = new QCheckBox(); + expand->setProperty("sourceTreeSubItem", true); expand->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); expand->setMaximumSize(10, 16); diff --git a/UI/source-tree.hpp b/UI/source-tree.hpp index 0ab3ad80f..c4b419686 100644 --- a/UI/source-tree.hpp +++ b/UI/source-tree.hpp @@ -22,10 +22,6 @@ class LockedCheckBox; class VisibilityCheckBox; class VisibilityItemWidget; -class SourceTreeSubItemCheckBox : public QCheckBox { - Q_OBJECT -}; - class SourceTreeItem : public QFrame { Q_OBJECT