Browse Source

UI: Replace toolButton property with style class

Warchamp7 1 year ago
parent
commit
7b052cba45

+ 3 - 12
UI/forms/OBSBasic.ui

@@ -1415,10 +1415,7 @@
              <bool>false</bool>
             </property>
             <property name="class" stdset="0">
-             <string notr="true">icon-plus</string>
-            </property>
-            <property name="toolButton" stdset="0">
-             <bool>true</bool>
+             <string notr="true">btn-tool icon-plus</string>
             </property>
            </widget>
           </item>
@@ -1447,10 +1444,7 @@
              <bool>false</bool>
             </property>
             <property name="class" stdset="0">
-             <string notr="true">icon-trash</string>
-            </property>
-            <property name="toolButton" stdset="0">
-             <bool>true</bool>
+             <string notr="true">btn-tool icon-trash</string>
             </property>
            </widget>
           </item>
@@ -1479,10 +1473,7 @@
              <bool>false</bool>
             </property>
             <property name="class" stdset="0">
-             <string notr="true">icon-dots-vert</string>
-            </property>
-            <property name="toolButton" stdset="0">
-             <string notr="true">true</string>
+             <string notr="true">btn-tool icon-dots-vert</string>
             </property>
            </widget>
           </item>

+ 8 - 32
UI/forms/OBSBasicFilters.ui

@@ -126,10 +126,7 @@
                 <bool>true</bool>
                </property>
                <property name="class" stdset="0">
-                <string>icon-plus</string>
-               </property>
-               <property name="toolButton" stdset="0">
-                <bool>true</bool>
+                <string notr="true">btn-tool icon-plus</string>
                </property>
               </widget>
              </item>
@@ -158,10 +155,7 @@
                 <bool>true</bool>
                </property>
                <property name="class" stdset="0">
-                <string>icon-trash</string>
-               </property>
-               <property name="toolButton" stdset="0">
-                <bool>true</bool>
+                <string notr="true">btn-tool icon-trash</string>
                </property>
               </widget>
              </item>
@@ -190,10 +184,7 @@
                 <bool>true</bool>
                </property>
                <property name="class" stdset="0">
-                <string>icon-up</string>
-               </property>
-               <property name="toolButton" stdset="0">
-                <bool>true</bool>
+                <string notr="true">btn-tool icon-up</string>
                </property>
               </widget>
              </item>
@@ -222,10 +213,7 @@
                 <bool>true</bool>
                </property>
                <property name="class" stdset="0">
-                <string>icon-down</string>
-               </property>
-               <property name="toolButton" stdset="0">
-                <bool>true</bool>
+                <string notr="true">btn-tool icon-down</string>
                </property>
               </widget>
              </item>
@@ -360,10 +348,7 @@
                 <bool>true</bool>
                </property>
                <property name="class" stdset="0">
-                <string>icon-plus</string>
-               </property>
-               <property name="toolButton" stdset="0">
-                <bool>true</bool>
+                <string notr="true">btn-tool icon-plus</string>
                </property>
               </widget>
              </item>
@@ -392,10 +377,7 @@
                 <bool>true</bool>
                </property>
                <property name="class" stdset="0">
-                <string>icon-trash</string>
-               </property>
-               <property name="toolButton" stdset="0">
-                <bool>true</bool>
+                <string notr="true">btn-tool icon-trash</string>
                </property>
               </widget>
              </item>
@@ -424,10 +406,7 @@
                 <bool>true</bool>
                </property>
                <property name="class" stdset="0">
-                <string>icon-up</string>
-               </property>
-               <property name="toolButton" stdset="0">
-                <bool>true</bool>
+                <string notr="true">btn-tool icon-up</string>
                </property>
               </widget>
              </item>
@@ -456,10 +435,7 @@
                 <bool>true</bool>
                </property>
                <property name="class" stdset="0">
-                <string>icon-down</string>
-               </property>
-               <property name="toolButton" stdset="0">
-                <bool>true</bool>
+                <string notr="true">btn-tool icon-down</string>
                </property>
               </widget>
              </item>

+ 2 - 8
UI/frontend-plugins/frontend-tools/forms/auto-scene-switcher.ui

@@ -77,10 +77,7 @@
         <bool>true</bool>
        </property>
        <property name="class" stdset="0">
-        <string notr="true">icon-plus</string>
-       </property>
-       <property name="toolButton" stdset="0">
-        <bool>true</bool>
+        <string notr="true">btn-tool icon-plus</string>
        </property>
       </widget>
      </item>
@@ -96,10 +93,7 @@
         <bool>true</bool>
        </property>
        <property name="class" stdset="0">
-        <string notr="true">icon-trash</string>
-       </property>
-       <property name="toolButton" stdset="0">
-        <bool>true</bool>
+        <string notr="true">btn-tool icon-trash</string>
        </property>
       </widget>
      </item>

+ 3 - 12
UI/frontend-plugins/frontend-tools/forms/scripts.ui

@@ -84,10 +84,7 @@
               <bool>true</bool>
              </property>
              <property name="class" stdset="0">
-              <string notr="true">icon-plus</string>
-             </property>
-             <property name="toolButton" stdset="0">
-              <bool>true</bool>
+              <string notr="true">btn-tool icon-plus</string>
              </property>
             </widget>
            </item>
@@ -118,10 +115,7 @@
               <bool>true</bool>
              </property>
              <property name="class" stdset="0">
-              <string notr="true">icon-trash</string>
-             </property>
-             <property name="toolButton" stdset="0">
-              <bool>true</bool>
+              <string notr="true">btn-tool icon-trash</string>
              </property>
             </widget>
            </item>
@@ -152,10 +146,7 @@
               <bool>true</bool>
              </property>
              <property name="class" stdset="0">
-              <string notr="true">icon-refresh</string>
-             </property>
-             <property name="toolButton" stdset="0">
-              <bool>true</bool>
+              <string notr="true">btn-tool icon-refresh</string>
              </property>
             </widget>
            </item>

+ 1 - 2
shared/properties-view/properties-view.cpp

@@ -691,9 +691,8 @@ QWidget *OBSPropertiesView::AddList(obs_property_t *prop, bool &warning)
 static void NewButton(QLayout *layout, WidgetInfo *info, const char *themeIcon, void (WidgetInfo::*method)())
 {
 	QPushButton *button = new QPushButton();
-	button->setProperty("class", themeIcon);
+	button->setProperty("class", "btn-tool " + QString(themeIcon));
 	button->setFlat(true);
-	button->setProperty("toolButton", true);
 
 	QObject::connect(button, &QPushButton::clicked, info, method);