Align comboboxes in media settings view.

Also places the the camera preview all the way to the right of all
the settings, not just the camera settings.

Tuleap: #353
Change-Id: I209ec21526f47be8395a2293de040b90426b6091
diff --git a/src/mediasettingsview.cpp b/src/mediasettingsview.cpp
index dc08193..28c9c04 100644
--- a/src/mediasettingsview.cpp
+++ b/src/mediasettingsview.cpp
@@ -46,6 +46,8 @@
 
 struct _MediaSettingsViewPrivate
 {
+    GtkWidget *vbox_main;
+
     /* audio settings */
     GtkWidget *combobox_manager;
     GtkWidget *combobox_ringtone;
@@ -62,7 +64,6 @@
     GtkWidget *combobox_channel;
     GtkWidget *combobox_resolution;
     GtkWidget *combobox_framerate;
-    GtkWidget *hbox_camera;
     GtkWidget *video_widget;
 
     /* this is used to keep track of the state of the preview when the settings
@@ -228,6 +229,7 @@
     gtk_widget_class_set_template_from_resource(GTK_WIDGET_CLASS (klass),
                                                 "/cx/ring/RingGnome/mediasettingsview.ui");
 
+    gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MediaSettingsView, vbox_main);
     gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MediaSettingsView, combobox_manager);
     gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MediaSettingsView, combobox_ringtone);
     gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MediaSettingsView, combobox_output);
@@ -236,7 +238,6 @@
     gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MediaSettingsView, combobox_channel);
     gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MediaSettingsView, combobox_resolution);
     gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MediaSettingsView, combobox_framerate);
-    gtk_widget_class_bind_template_child_private(GTK_WIDGET_CLASS (klass), MediaSettingsView, hbox_camera);
 }
 
 GtkWidget *
@@ -263,7 +264,9 @@
         /* put video widget in */
         priv->video_widget = video_widget_new();
         gtk_widget_show_all(priv->video_widget);
-        gtk_box_pack_start(GTK_BOX(priv->hbox_camera), priv->video_widget, TRUE, TRUE, 0);
+        gtk_box_pack_start(GTK_BOX(priv->vbox_main), priv->video_widget, TRUE, TRUE, 0);
+        // set minimum size for video so it doesn't shrink too much
+        gtk_widget_set_size_request(priv->video_widget, 300, -1);
 
         if (Video::PreviewManager::instance().isPreviewing()) {
             priv->video_started_by_settings = FALSE;
@@ -293,7 +296,7 @@
         }
 
         if (priv->video_widget && IS_VIDEO_WIDGET(priv->video_widget))
-            gtk_container_remove(GTK_CONTAINER(priv->hbox_camera), priv->video_widget);
+            gtk_container_remove(GTK_CONTAINER(priv->vbox_main), priv->video_widget);
         priv->video_widget = NULL;
     }
 
diff --git a/ui/mediasettingsview.ui b/ui/mediasettingsview.ui
index 8e3ac98..9466e7c 100644
--- a/ui/mediasettingsview.ui
+++ b/ui/mediasettingsview.ui
@@ -6,273 +6,242 @@
     <child>
       <object class="GtkBox" id="vbox_main">
         <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="orientation">vertical</property>
+        <property name="orientation">horizontal</property>
         <property name="spacing">10</property>
-        <property name="border_width">10</property>
+        <!-- <property name="homogeneous">True</property> -->
         <!-- start audio selection -->
         <child>
-          <object class="GtkFrame" id="frame_audio_selection">
+          <object class="GtkGrid" id="grid_left">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="label_xalign">0</property>
-            <property name="shadow_type">none</property>
-            <!-- start grid audio selection -->
+            <property name="row_spacing">10</property>
+            <property name="column_spacing">10</property>
+            <property name="border_width">10</property>
+            <!-- start audio selection -->
             <child>
-              <object class="GtkGrid" id="grid_audio_selection">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="margin_left">10</property>
-                <property name="margin_top">10</property>
-                <property name="row_spacing">10</property>
-                <property name="column_spacing">10</property>
-                <child>
-                  <object class="GtkLabel" id="label_manager">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="halign">end</property>
-                    <property name="label" translatable="yes">Audio manager:</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label_ringtone">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="halign">end</property>
-                    <property name="label" translatable="yes">Ringtone device:</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label_output">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="halign">end</property>
-                    <property name="label" translatable="yes">Output device:</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label_input">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="halign">end</property>
-                    <property name="label" translatable="yes">Input device:</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">3</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkComboBox" id="combobox_manager">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="popup-fixed-width">False</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkComboBox" id="combobox_ringtone">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="popup-fixed-width">False</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkComboBox" id="combobox_output">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="popup-fixed-width">False</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkComboBox" id="combobox_input">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="popup-fixed-width">False</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">3</property>
-                  </packing>
-                </child>
-              </object>
-            </child>
-            <!-- end grid audio selection -->
-            <!-- start frame label -->
-            <child type="label">
               <object class="GtkLabel" id="label_audio_selection">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="label" translatable="yes">&lt;b&gt;Audio Settings&lt;/b&gt;</property>
-                <property name="use_markup">True</property>
+                <property name="halign">start</property>
+                <property name="label" translatable="yes">Audio Settings</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
               </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+                <property name="width">2</property>
+              </packing>
             </child>
-            <!-- end frame label -->
-          </object>
-        </child>
-        <!-- end audio selection -->
-        <!-- start camera selection -->
-        <child>
-          <object class="GtkFrame" id="frame_camera_selection">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label_xalign">0</property>
-            <property name="shadow_type">none</property>
-            <!-- start hbox for selection and preview -->
             <child>
-              <object class="GtkBox" id="hbox_camera">
+              <object class="GtkLabel" id="label_manager">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="orientation">horizontal</property>
-                <property name="spacing">10</property>
-                <!-- start grid device selection -->
-                <child>
-                  <object class="GtkGrid" id="grid_camera_settings">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="margin_left">10</property>
-                    <property name="margin_top">10</property>
-                    <property name="row_spacing">10</property>
-                    <property name="column_spacing">10</property>
-                    <child>
-                      <object class="GtkLabel" id="label_device">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="halign">end</property>
-                        <property name="label" translatable="yes">Device:</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label_channel">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="halign">end</property>
-                        <property name="label" translatable="yes">Channel:</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label_resolution">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="halign">end</property>
-                        <property name="label" translatable="yes">Resolution:</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">2</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkLabel" id="label_rate">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="halign">end</property>
-                        <property name="label" translatable="yes">Frame rate:</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">3</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkComboBox" id="combobox_device">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="popup-fixed-width">False</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkComboBox" id="combobox_channel">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="popup-fixed-width">False</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">1</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkComboBox" id="combobox_resolution">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="popup-fixed-width">False</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">2</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkComboBox" id="combobox_framerate">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="popup-fixed-width">False</property>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">3</property>
-                      </packing>
-                    </child>
-                  </object>
-                </child>
-                <!-- end grid device selection -->
-                <!-- video widget goes here -->
+                <property name="halign">end</property>
+                <property name="label" translatable="yes">Audio manager:</property>
+                <property name="margin_left">10</property>
               </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+              </packing>
             </child>
-            <!-- end hbox for selection and preview -->
-            <!-- start frame label -->
-            <child type="label">
+            <child>
+              <object class="GtkLabel" id="label_ringtone">
+                <property name="visible">True</property>
+                <property name="halign">end</property>
+                <property name="label" translatable="yes">Ringtone device:</property>
+                <property name="margin_left">10</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label_output">
+                <property name="visible">True</property>
+                <property name="halign">end</property>
+                <property name="label" translatable="yes">Output device:</property>
+                <property name="margin_left">10</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label_input">
+                <property name="visible">True</property>
+                <property name="halign">end</property>
+                <property name="label" translatable="yes">Input device:</property>
+                <property name="margin_left">10</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="combobox_manager">
+                <property name="visible">True</property>
+                <property name="popup-fixed-width">False</property>
+                <property name="margin_left">10</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="combobox_ringtone">
+                <property name="visible">True</property>
+                <property name="popup-fixed-width">False</property>
+                <property name="margin_left">10</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="combobox_output">
+                <property name="visible">True</property>
+                <property name="popup-fixed-width">False</property>
+                <property name="margin_left">10</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="combobox_input">
+                <property name="visible">True</property>
+                <property name="popup-fixed-width">False</property>
+                <property name="margin_left">10</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">4</property>
+              </packing>
+            </child>
+            <!-- end audio selection -->
+            <!-- start camera selection -->
+            <child>
               <object class="GtkLabel" id="label_camera_selection">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="label" translatable="yes">&lt;b&gt;Camera Settings&lt;/b&gt;</property>
-                <property name="use_markup">True</property>
+                <property name="halign">start</property>
+                <property name="label" translatable="yes">Camera Settings</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
               </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">5</property>
+                <property name="width">2</property>
+              </packing>
             </child>
-            <!-- end frame label -->
+            <child>
+              <object class="GtkLabel" id="label_device">
+                <property name="visible">True</property>
+                <property name="halign">end</property>
+                <property name="label" translatable="yes">Device:</property>
+                <property name="margin_left">10</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">6</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label_channel">
+                <property name="visible">True</property>
+                <property name="halign">end</property>
+                <property name="label" translatable="yes">Channel:</property>
+                <property name="margin_left">10</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">7</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label_resolution">
+                <property name="visible">True</property>
+                <property name="halign">end</property>
+                <property name="label" translatable="yes">Resolution:</property>
+                <property name="margin_left">10</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">8</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label_rate">
+                <property name="visible">True</property>
+                <property name="halign">end</property>
+                <property name="label" translatable="yes">Frame rate:</property>
+                <property name="margin_left">10</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">9</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="combobox_device">
+                <property name="visible">True</property>
+                <property name="popup-fixed-width">False</property>
+                <property name="margin_left">10</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">6</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="combobox_channel">
+                <property name="visible">True</property>
+                <property name="popup-fixed-width">False</property>
+                <property name="margin_left">10</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">7</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="combobox_resolution">
+                <property name="visible">True</property>
+                <property name="popup-fixed-width">False</property>
+                <property name="margin_left">10</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">8</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkComboBox" id="combobox_framerate">
+                <property name="visible">True</property>
+                <property name="popup-fixed-width">False</property>
+                <property name="margin_left">10</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">9</property>
+              </packing>
+            </child>
+            <!-- end camera selection -->
           </object>
           <packing>
             <property name="expand">False</property>
-            <property name="fill">True</property>
+            <property name="fill">False</property>
           </packing>
         </child>
-        <!-- end camera selection -->
       </object>
       <packing>
         <property name="expand">False</property>