瀏覽代碼

UI: Adjust minimum size of source toolbars

Sets a minimum size on the source toolbar itself to prevent shrinking the main window too small for it to be useable in some cases.

Also sets some sane limits on the toolbars with dropdown menus and the image source toolbar filepath
Warchamp7 4 年之前
父節點
當前提交
6e566f9b23

+ 0 - 1
UI/context-bar-controls.cpp

@@ -421,7 +421,6 @@ void GameCaptureToolbar::UpdateWindowVisibility()
 	bool is_window = (mode == "window");
 	bool is_window = (mode == "window");
 	ui->windowLabel->setVisible(is_window);
 	ui->windowLabel->setVisible(is_window);
 	ui->window->setVisible(is_window);
 	ui->window->setVisible(is_window);
-	ui->empty->setVisible(!is_window);
 }
 }
 
 
 void GameCaptureToolbar::on_mode_currentIndexChanged(int idx)
 void GameCaptureToolbar::on_mode_currentIndexChanged(int idx)

+ 4 - 4
UI/forms/OBSBasic.ui

@@ -205,7 +205,7 @@
       </property>
       </property>
       <property name="minimumSize">
       <property name="minimumSize">
        <size>
        <size>
-        <width>0</width>
+        <width>800</width>
         <height>30</height>
         <height>30</height>
        </size>
        </size>
       </property>
       </property>
@@ -293,13 +293,13 @@
             </property>
             </property>
             <property name="minimumSize">
             <property name="minimumSize">
              <size>
              <size>
-              <width>250</width>
+              <width>160</width>
               <height>22</height>
               <height>22</height>
              </size>
              </size>
             </property>
             </property>
             <property name="maximumSize">
             <property name="maximumSize">
              <size>
              <size>
-              <width>250</width>
+              <width>160</width>
               <height>22</height>
               <height>22</height>
              </size>
              </size>
             </property>
             </property>
@@ -1001,7 +1001,7 @@
           <rect>
           <rect>
            <x>0</x>
            <x>0</x>
            <y>0</y>
            <y>0</y>
-           <width>94</width>
+           <width>67</width>
            <height>16</height>
            <height>16</height>
           </rect>
           </rect>
          </property>
          </property>

+ 18 - 3
UI/forms/source-toolbar/device-select-toolbar.ui

@@ -25,7 +25,7 @@
   <property name="windowTitle">
   <property name="windowTitle">
    <string notr="true">Form</string>
    <string notr="true">Form</string>
   </property>
   </property>
-  <layout class="QHBoxLayout" name="horizontalLayout_2">
+  <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,1,0,0">
    <property name="sizeConstraint">
    <property name="sizeConstraint">
     <enum>QLayout::SetNoConstraint</enum>
     <enum>QLayout::SetNoConstraint</enum>
    </property>
    </property>
@@ -44,7 +44,7 @@
    <item>
    <item>
     <widget class="QLabel" name="deviceLabel">
     <widget class="QLabel" name="deviceLabel">
      <property name="sizePolicy">
      <property name="sizePolicy">
-      <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
+      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
        <horstretch>0</horstretch>
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
       </sizepolicy>
@@ -77,6 +77,12 @@
        <height>22</height>
        <height>22</height>
       </size>
       </size>
      </property>
      </property>
+     <property name="maximumSize">
+      <size>
+       <width>600</width>
+       <height>16777215</height>
+      </size>
+     </property>
      <property name="currentText">
      <property name="currentText">
       <string notr="true"/>
       <string notr="true"/>
      </property>
      </property>
@@ -87,6 +93,12 @@
    </item>
    </item>
    <item>
    <item>
     <widget class="QPushButton" name="activateButton">
     <widget class="QPushButton" name="activateButton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="minimumSize">
      <property name="minimumSize">
       <size>
       <size>
        <width>0</width>
        <width>0</width>
@@ -103,9 +115,12 @@
      <property name="orientation">
      <property name="orientation">
       <enum>Qt::Horizontal</enum>
       <enum>Qt::Horizontal</enum>
      </property>
      </property>
+     <property name="sizeType">
+      <enum>QSizePolicy::Expanding</enum>
+     </property>
      <property name="sizeHint" stdset="0">
      <property name="sizeHint" stdset="0">
       <size>
       <size>
-       <width>40</width>
+       <width>0</width>
        <height>20</height>
        <height>20</height>
       </size>
       </size>
      </property>
      </property>

+ 31 - 10
UI/forms/source-toolbar/game-capture-toolbar.ui

@@ -25,7 +25,7 @@
   <property name="windowTitle">
   <property name="windowTitle">
    <string notr="true">Form</string>
    <string notr="true">Form</string>
   </property>
   </property>
-  <layout class="QHBoxLayout" name="horizontalLayout">
+  <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,4,0,5,0">
    <property name="leftMargin">
    <property name="leftMargin">
     <number>0</number>
     <number>0</number>
    </property>
    </property>
@@ -62,12 +62,24 @@
    </item>
    </item>
    <item>
    <item>
     <widget class="QComboBox" name="mode">
     <widget class="QComboBox" name="mode">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="minimumSize">
      <property name="minimumSize">
       <size>
       <size>
-       <width>0</width>
+       <width>150</width>
        <height>22</height>
        <height>22</height>
       </size>
       </size>
      </property>
      </property>
+     <property name="maximumSize">
+      <size>
+       <width>400</width>
+       <height>16777215</height>
+      </size>
+     </property>
      <property name="currentText">
      <property name="currentText">
       <string notr="true"/>
       <string notr="true"/>
      </property>
      </property>
@@ -105,10 +117,16 @@
      </property>
      </property>
      <property name="minimumSize">
      <property name="minimumSize">
       <size>
       <size>
-       <width>0</width>
+       <width>150</width>
        <height>22</height>
        <height>22</height>
       </size>
       </size>
      </property>
      </property>
+     <property name="maximumSize">
+      <size>
+       <width>600</width>
+       <height>16777215</height>
+      </size>
+     </property>
      <property name="currentText">
      <property name="currentText">
       <string notr="true"/>
       <string notr="true"/>
      </property>
      </property>
@@ -118,14 +136,17 @@
     </widget>
     </widget>
    </item>
    </item>
    <item>
    <item>
-    <widget class="QFrame" name="empty">
-     <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
-       <horstretch>0</horstretch>
-       <verstretch>0</verstretch>
-      </sizepolicy>
+    <spacer name="empty">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
      </property>
      </property>
-    </widget>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
    </item>
    </item>
   </layout>
   </layout>
  </widget>
  </widget>

+ 20 - 1
UI/forms/source-toolbar/image-source-toolbar.ui

@@ -25,7 +25,7 @@
   <property name="windowTitle">
   <property name="windowTitle">
    <string notr="true">Form</string>
    <string notr="true">Form</string>
   </property>
   </property>
-  <layout class="QHBoxLayout" name="horizontalLayout">
+  <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0,0">
    <property name="leftMargin">
    <property name="leftMargin">
     <number>0</number>
     <number>0</number>
    </property>
    </property>
@@ -68,6 +68,12 @@
        <height>22</height>
        <height>22</height>
       </size>
       </size>
      </property>
      </property>
+     <property name="maximumSize">
+      <size>
+       <width>400</width>
+       <height>16777215</height>
+      </size>
+     </property>
      <property name="text">
      <property name="text">
       <string notr="true"/>
       <string notr="true"/>
      </property>
      </property>
@@ -95,6 +101,19 @@
      </property>
      </property>
     </widget>
     </widget>
    </item>
    </item>
+   <item>
+    <spacer name="horizontalSpacer">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>0</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
   </layout>
   </layout>
  </widget>
  </widget>
  <resources/>
  <resources/>