浏览代码

Adjust the way properties view UI displays

It didn't really look very nice in most cases and the controls were
always compacted, doing this makes it look a bit better.

Also change it so the properties window shows the properties on the
bottom below the source rather than to the right, seeing as in most
cases the source has a greater width than height, and it feels just a
little bit better to look at (thought that's just my opinion).

Controls still stretch really far sometimes though, I wonder what should
be done about that to be honest.  Maybe prevent it from scrolling to the
right?
jp9000 11 年之前
父节点
当前提交
fbbf274c51
共有 4 个文件被更改,包括 29 次插入15 次删除
  1. 4 4
      obs/forms/OBSBasicProperties.ui
  2. 21 9
      obs/forms/OBSBasicSettings.ui
  3. 2 1
      obs/properties-view.cpp
  4. 2 1
      obs/window-basic-properties.cpp

+ 4 - 4
obs/forms/OBSBasicProperties.ui

@@ -6,8 +6,8 @@
    <rect>
    <rect>
     <x>0</x>
     <x>0</x>
     <y>0</y>
     <y>0</y>
-    <width>1072</width>
-    <height>441</height>
+    <width>664</width>
+    <height>562</height>
    </rect>
    </rect>
   </property>
   </property>
   <property name="windowTitle">
   <property name="windowTitle">
@@ -16,11 +16,11 @@
   <property name="sizeGripEnabled">
   <property name="sizeGripEnabled">
    <bool>true</bool>
    <bool>true</bool>
   </property>
   </property>
-  <layout class="QHBoxLayout" name="horizontalLayout">
+  <layout class="QVBoxLayout" name="verticalLayout">
    <item>
    <item>
     <widget class="OBSQTDisplay" name="preview" native="true">
     <widget class="OBSQTDisplay" name="preview" native="true">
      <property name="sizePolicy">
      <property name="sizePolicy">
-      <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
        <horstretch>0</horstretch>
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
       </sizepolicy>

+ 21 - 9
obs/forms/OBSBasicSettings.ui

@@ -86,7 +86,7 @@
      <item>
      <item>
       <widget class="QStackedWidget" name="settingsPages">
       <widget class="QStackedWidget" name="settingsPages">
        <property name="currentIndex">
        <property name="currentIndex">
-        <number>1</number>
+        <number>2</number>
        </property>
        </property>
        <widget class="QWidget" name="generalPage">
        <widget class="QWidget" name="generalPage">
         <layout class="QFormLayout" name="formLayout_2">
         <layout class="QFormLayout" name="formLayout_2">
@@ -242,6 +242,12 @@
          </property>
          </property>
          <item alignment="Qt::AlignTop">
          <item alignment="Qt::AlignTop">
           <widget class="QWidget" name="widget" native="true">
           <widget class="QWidget" name="widget" native="true">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
            <layout class="QFormLayout" name="formLayout_5">
            <layout class="QFormLayout" name="formLayout_5">
             <item row="0" column="0">
             <item row="0" column="0">
              <widget class="QLabel" name="label_16">
              <widget class="QLabel" name="label_16">
@@ -264,6 +270,12 @@
               <property name="enabled">
               <property name="enabled">
                <bool>false</bool>
                <bool>false</bool>
               </property>
               </property>
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
               <property name="currentIndex">
               <property name="currentIndex">
                <number>0</number>
                <number>0</number>
               </property>
               </property>
@@ -972,12 +984,12 @@
    <slot>setCurrentIndex(int)</slot>
    <slot>setCurrentIndex(int)</slot>
    <hints>
    <hints>
     <hint type="sourcelabel">
     <hint type="sourcelabel">
-     <x>329</x>
-     <y>168</y>
+     <x>252</x>
+     <y>29</y>
     </hint>
     </hint>
     <hint type="destinationlabel">
     <hint type="destinationlabel">
-     <x>577</x>
-     <y>183</y>
+     <x>250</x>
+     <y>39</y>
     </hint>
     </hint>
    </hints>
    </hints>
   </connection>
   </connection>
@@ -988,12 +1000,12 @@
    <slot>setCurrentIndex(int)</slot>
    <slot>setCurrentIndex(int)</slot>
    <hints>
    <hints>
     <hint type="sourcelabel">
     <hint type="sourcelabel">
-     <x>379</x>
-     <y>30</y>
+     <x>250</x>
+     <y>39</y>
     </hint>
     </hint>
     <hint type="destinationlabel">
     <hint type="destinationlabel">
-     <x>294</x>
-     <y>427</y>
+     <x>250</x>
+     <y>39</y>
     </hint>
     </hint>
    </hints>
    </hints>
   </connection>
   </connection>

+ 2 - 1
obs/properties-view.cpp

@@ -24,7 +24,7 @@ void OBSPropertiesView::RefreshProperties()
 
 
 	QSizePolicy mainPolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
 	QSizePolicy mainPolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
 	QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Preferred);
 	QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Preferred);
-	widget->setSizePolicy(policy);
+	//widget->setSizePolicy(policy);
 	layout->setSizeConstraint(QLayout::SetMaximumSize);
 	layout->setSizeConstraint(QLayout::SetMaximumSize);
 	layout->setLabelAlignment(Qt::AlignRight);
 	layout->setLabelAlignment(Qt::AlignRight);
 
 
@@ -35,6 +35,7 @@ void OBSPropertiesView::RefreshProperties()
 		obs_property_next(&property);
 		obs_property_next(&property);
 	}
 	}
 
 
+	setWidgetResizable(true);
 	setWidget(widget);
 	setWidget(widget);
 	setSizePolicy(mainPolicy);
 	setSizePolicy(mainPolicy);
 
 

+ 2 - 1
obs/window-basic-properties.cpp

@@ -48,7 +48,8 @@ OBSBasicProperties::OBSBasicProperties(QWidget *parent, OBSSource source_)
 			source, (PropertiesUpdateCallback)obs_source_update);
 			source, (PropertiesUpdateCallback)obs_source_update);
 
 
 	layout()->addWidget(view);
 	layout()->addWidget(view);
-	layout()->setAlignment(view, Qt::AlignRight);
+	layout()->setAlignment(view, Qt::AlignBottom);
+	view->setMinimumHeight(150);
 	view->show();
 	view->show();
 
 
 	connect(windowHandle(), &QWindow::screenChanged, [this]() {
 	connect(windowHandle(), &QWindow::screenChanged, [this]() {