Browse Source

UI: Replace SourceTreeSubItemCheckBox class with Qt property

gxalpha 2 years ago
parent
commit
60c77aa915

+ 6 - 6
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);
 }
 

+ 4 - 4
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);
 }
 

+ 6 - 6
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);
 }
 

+ 6 - 6
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);
 }
 

+ 6 - 6
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);
 }
 

+ 4 - 4
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);
 }
 

+ 6 - 6
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);
 }
 

+ 2 - 1
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);

+ 0 - 4
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