Browse Source

UI: Add toolButton styling property for buttons

Allows making QPushButtons use the QToolButton styling.
Current usage is for transitions dock buttons.

May be unneeded after #6756 but doesn't hurt to have
Warchamp7 3 years ago
parent
commit
8a3abf1de7
5 changed files with 57 additions and 1 deletions
  1. 15 0
      UI/data/themes/Acri.qss
  2. 15 0
      UI/data/themes/Dark.qss
  3. 15 0
      UI/data/themes/Rachni.qss
  4. 3 1
      UI/data/themes/Yami.qss
  5. 9 0
      UI/forms/OBSBasic.ui

+ 15 - 0
UI/data/themes/Acri.qss

@@ -341,12 +341,27 @@ QToolBar {
 	margin-top: 4px;
 }
 
+QPushButton[toolButton="true"],
+QToolButton {
+	background: transparent;
+	border: none;
+    padding: 4px 6px;
+    margin: 0px 2px;
+}
+
+QPushButton[toolButton="true"]:last-child,
+QToolButton:last-child {
+    margin-right: 0px;
+}
+
+QPushButton[toolButton="true"]:hover,
 QToolButton:hover {
 	background-color: rgb(42,58,117);
 	border: 1px solid rgb(35,49,102);
 	border-radius: none;
 }
 
+QPushButton[toolButton="true"]:pressed,
 QToolButton:pressed {
 	background-color: rgb(22,31,65);
 	border-radius: none;

+ 15 - 0
UI/data/themes/Dark.qss

@@ -249,11 +249,26 @@ QToolBar {
     border: none;
 }
 
+QPushButton[toolButton="true"],
+QToolButton {
+	background: transparent;
+	border: none;
+    padding: 1px;
+    margin: 1px;
+}
+
+QPushButton[toolButton="true"]:last-child,
+QToolButton:last-child {
+    margin-right: 0px;
+}
+
+QPushButton[toolButton="true"]:hover,
 QToolButton:hover {
     background-color: rgb(122,121,122); /* light */
     border-radius: none;
 }
 
+QPushButton[toolButton="true"]:pressed,
 QToolButton:pressed {
     background-color: palette(base);
     border-radius: none;

+ 15 - 0
UI/data/themes/Rachni.qss

@@ -479,11 +479,26 @@ QToolBar {
 	border: none;
 }
 
+QPushButton[toolButton="true"],
+QToolButton {
+	background: transparent;
+	border: none;
+    padding: 1px;
+    margin: 1px;
+}
+
+QPushButton[toolButton="true"]:last-child,
+QToolButton:last-child {
+    margin-right: 0px;
+}
+
+QPushButton[toolButton="true"]:hover,
 QToolButton:hover {
 	background-color: rgba(240, 98, 146, 0.5); /* Pink (Secondary) */
 	border-radius: 2px;
 }
 
+QPushButton[toolButton="true"]:pressed,
 QToolButton:pressed {
 	background-color: rgb(240, 98, 146); /* Pink (Secondary) */
 	border-radius: 2px;

+ 3 - 1
UI/data/themes/Yami.qss

@@ -413,13 +413,15 @@ QToolBar {
     margin: 4px 0px;
 }
 
+QPushButton[toolButton="true"],
 QToolButton {
-    background-color: rgb(60,64,75);
+    background-color: rgb(160,64,75);
     padding: 4px 6px;
     margin: 0px 2px;
     border-radius: 2px;
 }
 
+QPushButton[toolButton="true"]:last-child,
 QToolButton:last-child {
     margin-right: 0px;
 }

+ 9 - 0
UI/forms/OBSBasic.ui

@@ -1289,6 +1289,9 @@
             <property name="themeID" stdset="0">
              <string notr="true">addIconSmall</string>
             </property>
+            <property name="toolButton" stdset="0">
+             <bool>true</bool>
+            </property>
            </widget>
           </item>
           <item>
@@ -1318,6 +1321,9 @@
             <property name="themeID" stdset="0">
              <string notr="true">removeIconSmall</string>
             </property>
+            <property name="toolButton" stdset="0">
+             <bool>true</bool>
+            </property>
            </widget>
           </item>
           <item>
@@ -1347,6 +1353,9 @@
             <property name="themeID" stdset="0">
              <string notr="true">menuIconSmall</string>
             </property>
+            <property name="toolButton" stdset="0">
+             <string notr="true">true</string>
+            </property>
            </widget>
           </item>
          </layout>