quick-lounge-applet r252 - in trunk: . data data/ui src



Author: paobac
Date: Tue Feb  3 16:52:30 2009
New Revision: 252
URL: http://svn.gnome.org/viewvc/quick-lounge-applet?rev=252&view=rev

Log:
2009-02-03  Paolo Bacchilega  <paobac svn gnome org>

	* src/quick-lounge.h: 
	* src/quick-lounge.c: 
	* src/quick-box.h: 
	* src/quick-box.c: 
	* src/dlg-properties.c: 
	* data/ui/properties.ui: 
	* data/quick-lounge.schemas.in: 
	
	New feaure: Allow to specify the number of rows explicitly.
	
	Fixes bug #161444 â [PATCH] Alternative way to control the number 
	of rows.
	Patch by Jared Warren.


Modified:
   trunk/ChangeLog
   trunk/data/quick-lounge.schemas.in
   trunk/data/ui/properties.ui
   trunk/src/dlg-properties.c
   trunk/src/quick-box.c
   trunk/src/quick-box.h
   trunk/src/quick-lounge.c
   trunk/src/quick-lounge.h

Modified: trunk/data/quick-lounge.schemas.in
==============================================================================
--- trunk/data/quick-lounge.schemas.in	(original)
+++ trunk/data/quick-lounge.schemas.in	Tue Feb  3 16:52:30 2009
@@ -24,12 +24,12 @@
       </schema>
 
       <schema>
-        <key>/schemas/apps/quick-lounge-applet/prefs/icon_size_follows_panel</key>
+        <key>/schemas/apps/quick-lounge-applet/prefs/rows</key>
         <owner>quick-lounge-applet</owner>
-        <type>bool</type>
-        <default>FALSE</default>
+        <type>int</type>
+        <default>1</default>
         <locale name="C">
-          <short>Whether icons size follows the panel size</short>
+          <short>Number of rows to display</short>
           <long></long>
         </locale>
       </schema>

Modified: trunk/data/ui/properties.ui
==============================================================================
--- trunk/data/ui/properties.ui	(original)
+++ trunk/data/ui/properties.ui	Tue Feb  3 16:52:30 2009
@@ -16,43 +16,22 @@
         <property name="visible">True</property>
         <property name="spacing">8</property>
         <child>
-          <object class="GtkVBox" id="vbox1">
+          <object class="GtkVBox" id="vbox8">
             <property name="visible">True</property>
-            <property name="border_width">6</property>
-            <property name="spacing">10</property>
+            <property name="orientation">vertical</property>
+            <property name="spacing">12</property>
             <child>
-              <object class="GtkVBox" id="vbox6">
+              <object class="GtkFrame" id="frame3">
                 <property name="visible">True</property>
-                <property name="spacing">5</property>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
                 <child>
-                  <object class="GtkLabel" id="label10">
+                  <object class="GtkAlignment" id="alignment9">
                     <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">&lt;b&gt;Launchers&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkHBox" id="hbox10">
-                    <property name="visible">True</property>
-                    <child>
-                      <object class="GtkLabel" id="label9">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">    </property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
+                    <property name="top_padding">6</property>
+                    <property name="left_padding">12</property>
                     <child>
-                      <object class="GtkTable" id="table2">
+                      <object class="GtkTable" id="table5">
                         <property name="visible">True</property>
                         <property name="n_columns">2</property>
                         <property name="column_spacing">12</property>
@@ -75,8 +54,9 @@
                           </object>
                         </child>
                         <child>
-                          <object class="GtkVBox" id="vbox4">
+                          <object class="GtkVBox" id="vbox9">
                             <property name="visible">True</property>
+                            <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
                               <object class="GtkButton" id="p_add_launcher_button">
@@ -84,16 +64,16 @@
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">True</property>
                                 <child>
-                                  <object class="GtkAlignment" id="alignment3">
+                                  <object class="GtkAlignment" id="alignment10">
                                     <property name="visible">True</property>
                                     <property name="xscale">0</property>
                                     <property name="yscale">0</property>
                                     <child>
-                                      <object class="GtkHBox" id="hbox1">
+                                      <object class="GtkHBox" id="hbox19">
                                         <property name="visible">True</property>
                                         <property name="spacing">2</property>
                                         <child>
-                                          <object class="GtkImage" id="image1">
+                                          <object class="GtkImage" id="image15">
                                             <property name="visible">True</property>
                                             <property name="stock">gtk-new</property>
                                             <property name="icon-size">4</property>
@@ -105,7 +85,7 @@
                                           </packing>
                                         </child>
                                         <child>
-                                          <object class="GtkLabel" id="label1">
+                                          <object class="GtkLabel" id="label21">
                                             <property name="visible">True</property>
                                             <property name="label" translatable="yes">_New Launcher</property>
                                             <property name="use_underline">True</property>
@@ -131,18 +111,18 @@
                               <object class="GtkButton" id="p_add_from_menu_button">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
+                                <property name="receives_default">True</property>
                                 <child>
-                                  <object class="GtkAlignment" id="alignment2">
+                                  <object class="GtkAlignment" id="alignment11">
                                     <property name="visible">True</property>
                                     <property name="xscale">0</property>
                                     <property name="yscale">0</property>
                                     <child>
-                                      <object class="GtkHBox" id="hbox17">
+                                      <object class="GtkHBox" id="hbox20">
                                         <property name="visible">True</property>
                                         <property name="spacing">2</property>
                                         <child>
-                                          <object class="GtkImage" id="image10">
+                                          <object class="GtkImage" id="image16">
                                             <property name="visible">True</property>
                                             <property name="stock">gtk-index</property>
                                             <property name="icon-size">4</property>
@@ -154,7 +134,7 @@
                                           </packing>
                                         </child>
                                         <child>
-                                          <object class="GtkLabel" id="label15">
+                                          <object class="GtkLabel" id="label22">
                                             <property name="visible">True</property>
                                             <property name="label" translatable="yes">Add From M_enu</property>
                                             <property name="use_underline">True</property>
@@ -180,18 +160,18 @@
                               <object class="GtkButton" id="p_add_space_button">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
+                                <property name="receives_default">True</property>
                                 <child>
-                                  <object class="GtkAlignment" id="alignment1">
+                                  <object class="GtkAlignment" id="alignment12">
                                     <property name="visible">True</property>
                                     <property name="xscale">0</property>
                                     <property name="yscale">0</property>
                                     <child>
-                                      <object class="GtkHBox" id="hbox16">
+                                      <object class="GtkHBox" id="hbox21">
                                         <property name="visible">True</property>
                                         <property name="spacing">2</property>
                                         <child>
-                                          <object class="GtkImage" id="image9">
+                                          <object class="GtkImage" id="image17">
                                             <property name="visible">True</property>
                                             <property name="stock">gtk-add</property>
                                             <property name="icon-size">4</property>
@@ -203,7 +183,7 @@
                                           </packing>
                                         </child>
                                         <child>
-                                          <object class="GtkLabel" id="label14">
+                                          <object class="GtkLabel" id="label23">
                                             <property name="visible">True</property>
                                             <property name="label" translatable="yes">Add _Space</property>
                                             <property name="use_underline">True</property>
@@ -231,7 +211,7 @@
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="can_default">True</property>
-                                <property name="receives_default">False</property>
+                                <property name="receives_default">True</property>
                                 <property name="use_stock">True</property>
                               </object>
                               <packing>
@@ -247,7 +227,7 @@
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="can_default">True</property>
-                                <property name="receives_default">False</property>
+                                <property name="receives_default">True</property>
                                 <property name="use_stock">True</property>
                               </object>
                               <packing>
@@ -258,7 +238,7 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkHBox" id="hbox4">
+                              <object class="GtkHBox" id="hbox22">
                                 <property name="visible">True</property>
                                 <property name="spacing">6</property>
                                 <property name="homogeneous">True</property>
@@ -267,9 +247,9 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="can_default">True</property>
-                                    <property name="receives_default">False</property>
+                                    <property name="receives_default">True</property>
                                     <child>
-                                      <object class="GtkImage" id="image4">
+                                      <object class="GtkImage" id="image18">
                                         <property name="visible">True</property>
                                         <property name="stock">gtk-goto-top</property>
                                         <property name="icon-size">4</property>
@@ -285,9 +265,9 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="can_default">True</property>
-                                    <property name="receives_default">False</property>
+                                    <property name="receives_default">True</property>
                                     <child>
-                                      <object class="GtkImage" id="image5">
+                                      <object class="GtkImage" id="image19">
                                         <property name="visible">True</property>
                                         <property name="stock">gtk-go-up</property>
                                         <property name="icon-size">4</property>
@@ -303,9 +283,9 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="can_default">True</property>
-                                    <property name="receives_default">False</property>
+                                    <property name="receives_default">True</property>
                                     <child>
-                                      <object class="GtkImage" id="image6">
+                                      <object class="GtkImage" id="image20">
                                         <property name="visible">True</property>
                                         <property name="stock">gtk-go-down</property>
                                         <property name="icon-size">4</property>
@@ -321,9 +301,9 @@
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
                                     <property name="can_default">True</property>
-                                    <property name="receives_default">False</property>
+                                    <property name="receives_default">True</property>
                                     <child>
-                                      <object class="GtkImage" id="image7">
+                                      <object class="GtkImage" id="image21">
                                         <property name="visible">True</property>
                                         <property name="stock">gtk-goto-bottom</property>
                                         <property name="icon-size">4</property>
@@ -351,14 +331,15 @@
                           </packing>
                         </child>
                       </object>
-                      <packing>
-                        <property name="position">1</property>
-                      </packing>
                     </child>
                   </object>
-                  <packing>
-                    <property name="position">1</property>
-                  </packing>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label24">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">&lt;b&gt;Launchers&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </object>
                 </child>
               </object>
               <packing>
@@ -366,83 +347,54 @@
               </packing>
             </child>
             <child>
-              <object class="GtkVBox" id="vbox7">
+              <object class="GtkFrame" id="frame4">
                 <property name="visible">True</property>
-                <property name="spacing">5</property>
-                <child>
-                  <object class="GtkLabel" id="label12">
-                    <property name="visible">True</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">&lt;b&gt;Size&lt;/b&gt;</property>
-                    <property name="use_markup">True</property>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">False</property>
-                    <property name="position">0</property>
-                  </packing>
-                </child>
+                <property name="label_xalign">0</property>
+                <property name="shadow_type">none</property>
                 <child>
-                  <object class="GtkHBox" id="hbox11">
+                  <object class="GtkAlignment" id="alignment13">
                     <property name="visible">True</property>
+                    <property name="top_padding">6</property>
+                    <property name="left_padding">12</property>
                     <child>
-                      <object class="GtkLabel" id="label11">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">    </property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkVBox" id="vbox5">
+                      <object class="GtkVBox" id="vbox10">
                         <property name="visible">True</property>
+                        <property name="orientation">vertical</property>
                         <property name="spacing">5</property>
                         <child>
-                          <object class="GtkTable" id="table3">
+                          <object class="GtkTable" id="table6">
                             <property name="visible">True</property>
                             <property name="n_rows">2</property>
                             <property name="n_columns">2</property>
                             <property name="column_spacing">12</property>
                             <property name="row_spacing">6</property>
                             <child>
-                              <object class="GtkHBox" id="hbox9">
+                              <object class="GtkLabel" id="rows_label">
+                                <property name="visible">True</property>
+                                <property name="xalign">0</property>
+                                <property name="use_underline">True</property>
+                              </object>
+                              <packing>
+                                <property name="top_attach">1</property>
+                                <property name="bottom_attach">2</property>
+                                <property name="x_options">GTK_FILL</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkHBox" id="hbox1">
                                 <property name="visible">True</property>
                                 <child>
-                                  <object class="GtkHBox" id="hbox14">
+                                  <object class="GtkSpinButton" id="p_rows_spinbutton">
                                     <property name="visible">True</property>
-                                    <property name="spacing">6</property>
-                                    <child>
-                                      <object class="GtkSpinButton" id="p_minsize_spinbutton">
-                                        <property name="visible">True</property>
-                                        <property name="can_focus">True</property>
-                                        <property name="progress_fraction">0.059999999999999998</property>
-                                        <property name="adjustment">minsize_adjustment</property>
-                                        <property name="climb_rate">1</property>
-                                        <property name="numeric">True</property>
-                                      </object>
-                                      <packing>
-                                        <property name="position">0</property>
-                                      </packing>
-                                    </child>
-                                    <child>
-                                      <object class="GtkLabel" id="label6">
-                                        <property name="visible">True</property>
-                                        <property name="xalign">0</property>
-                                        <property name="label" translatable="yes">columns</property>
-                                      </object>
-                                      <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">False</property>
-                                        <property name="position">1</property>
-                                      </packing>
-                                    </child>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">&#x25CF;</property>
+                                    <property name="invisible_char_set">True</property>
+                                    <property name="adjustment">rows_adjustment</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="numeric">True</property>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
-                                    <property name="fill">False</property>
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
@@ -450,115 +402,96 @@
                               <packing>
                                 <property name="left_attach">1</property>
                                 <property name="right_attach">2</property>
-                                <property name="x_options"></property>
-                                <property name="y_options"></property>
+                                <property name="top_attach">1</property>
+                                <property name="bottom_attach">2</property>
+                                <property name="x_options">GTK_FILL</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <object class="GtkLabel" id="columns_label">
+                                <property name="visible">True</property>
+                                <property name="xalign">0</property>
+                                <property name="label" translatable="yes">_Minimum:</property>
+                                <property name="use_underline">True</property>
+                              </object>
+                              <packing>
+                                <property name="x_options">GTK_FILL</property>
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkHBox" id="hbox8">
+                              <object class="GtkHBox" id="hbox2">
                                 <property name="visible">True</property>
+                                <property name="spacing">12</property>
+                                <child>
+                                  <object class="GtkSpinButton" id="p_minsize_spinbutton">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">&#x25CF;</property>
+                                    <property name="invisible_char_set">True</property>
+                                    <property name="adjustment">minsize_adjustment</property>
+                                    <property name="climb_rate">1</property>
+                                    <property name="numeric">True</property>
+                                  </object>
+                                  <packing>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
                                 <child>
-                                  <object class="GtkHBox" id="hbox15">
+                                  <object class="GtkHBox" id="hbox3">
                                     <property name="visible">True</property>
                                     <property name="spacing">6</property>
                                     <child>
-                                      <object class="GtkSpinButton" id="p_maxsize_spinbutton">
+                                      <object class="GtkLabel" id="label1">
                                         <property name="visible">True</property>
-                                        <property name="can_focus">True</property>
-                                        <property name="adjustment">maxsize_adjustment</property>
-                                        <property name="climb_rate">1</property>
+                                        <property name="label" translatable="yes">Ma_ximum:</property>
+                                        <property name="use_underline">True</property>
                                       </object>
                                       <packing>
                                         <property name="position">0</property>
                                       </packing>
                                     </child>
                                     <child>
-                                      <object class="GtkLabel" id="label8">
+                                      <object class="GtkSpinButton" id="p_maxsize_spinbutton">
                                         <property name="visible">True</property>
-                                        <property name="xalign">0</property>
-                                        <property name="label" translatable="yes">columns</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="invisible_char">&#x25CF;</property>
+                                        <property name="invisible_char_set">True</property>
+                                        <property name="adjustment">maxsize_adjustment</property>
+                                        <property name="climb_rate">1</property>
+                                        <property name="numeric">True</property>
                                       </object>
                                       <packing>
-                                        <property name="expand">False</property>
-                                        <property name="fill">False</property>
                                         <property name="position">1</property>
                                       </packing>
                                     </child>
                                   </object>
                                   <packing>
-                                    <property name="expand">False</property>
-                                    <property name="fill">False</property>
-                                    <property name="position">0</property>
+                                    <property name="position">1</property>
                                   </packing>
                                 </child>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                                 <property name="right_attach">2</property>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
-                                <property name="x_options"></property>
-                                <property name="y_options"></property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label4">
-                                <property name="visible">True</property>
-                                <property name="xalign">0</property>
-                                <property name="label" translatable="yes">_Minimum size:</property>
-                                <property name="use_underline">True</property>
-                                <property name="mnemonic_widget">p_minsize_spinbutton</property>
-                              </object>
-                              <packing>
-                                <property name="x_options">GTK_FILL</property>
-                                <property name="y_options"></property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label7">
-                                <property name="visible">True</property>
-                                <property name="xalign">0</property>
-                                <property name="label" translatable="yes">Ma_ximum size:</property>
-                                <property name="use_underline">True</property>
-                                <property name="mnemonic_widget">p_maxsize_spinbutton</property>
-                              </object>
-                              <packing>
-                                <property name="top_attach">1</property>
-                                <property name="bottom_attach">2</property>
                                 <property name="x_options">GTK_FILL</property>
-                                <property name="y_options"></property>
                               </packing>
                             </child>
                           </object>
                           <packing>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkCheckButton" id="p_icon_size_checkbutton">
-                            <property name="label" translatable="yes">Always use one row</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_underline">True</property>
-                            <property name="draw_indicator">True</property>
-                          </object>
-                          <packing>
                             <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">1</property>
+                            <property name="position">0</property>
                           </packing>
                         </child>
                       </object>
-                      <packing>
-                        <property name="position">1</property>
-                      </packing>
                     </child>
                   </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="position">1</property>
-                  </packing>
+                </child>
+                <child type="label">
+                  <object class="GtkLabel" id="label29">
+                    <property name="visible">True</property>
+                    <property name="label" translatable="yes">&lt;b&gt;Size&lt;/b&gt;</property>
+                    <property name="use_markup">True</property>
+                  </object>
                 </child>
               </object>
               <packing>
@@ -632,4 +565,12 @@
     <property name="page_increment">10</property>
     <property name="page_size">10</property>
   </object>
+  <object class="GtkAdjustment" id="rows_adjustment">
+    <property name="value">1</property>
+    <property name="lower">1</property>
+    <property name="upper">11</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">1</property>
+    <property name="page_size">1</property>
+  </object>
 </interface>

Modified: trunk/src/dlg-properties.c
==============================================================================
--- trunk/src/dlg-properties.c	(original)
+++ trunk/src/dlg-properties.c	Tue Feb  3 16:52:30 2009
@@ -92,7 +92,7 @@
 
 	GtkWidget     *p_minsize_spinbutton;
 	GtkWidget     *p_maxsize_spinbutton;
-	GtkWidget     *p_icon_size_checkbutton;
+	GtkWidget     *p_rows_spinbutton;
 	GtkWidget     *p_apps_scrolledwindow;
 	GtkAdjustment *p_apps_vadjustment;
 
@@ -663,7 +663,7 @@
 {
 	gboolean needs_update;
 	
-	needs_update =quick_lounge_set_min_visible_cols (data->quick_lounge, gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (data->p_minsize_spinbutton)));	 
+	needs_update = quick_lounge_set_min_visible_cols (data->quick_lounge, gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (data->p_minsize_spinbutton)));	 
 	gtk_spin_button_set_value (GTK_SPIN_BUTTON (data->p_minsize_spinbutton), quick_box_get_min_visible_cols (data->quick_box));
 	if (needs_update)
 		gtk_spin_button_set_value (GTK_SPIN_BUTTON (data->p_maxsize_spinbutton), quick_box_get_max_visible_cols(data->quick_box));
@@ -681,10 +681,10 @@
 
 
 static void
-icon_size_toggled_cb (GtkWidget  *widget,
-		      DialogData *data)
+rows_value_changed_cb (GtkWidget  *widget,
+		       DialogData *data)
 {
-	quick_lounge_set_icon_size_follows_panel (data->quick_lounge, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (data->p_icon_size_checkbutton)));
+	quick_lounge_set_rows (data->quick_lounge, gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (data->p_rows_spinbutton)));
 }
 
 
@@ -1024,7 +1024,8 @@
 	GtkWidget        *btn_close;
 	GtkWidget        *btn_help;
 	GtkTreeSelection *selection;
-
+	char             *rows_label;
+	
 	data = g_new0 (DialogData, 1);
 
 	data->quick_lounge = quick_lounge;
@@ -1051,9 +1052,9 @@
 
 	data->p_minsize_spinbutton = GET_WIDGET ("p_minsize_spinbutton");
 	data->p_maxsize_spinbutton = GET_WIDGET ("p_maxsize_spinbutton");
-	data->p_icon_size_checkbutton = GET_WIDGET ("p_icon_size_checkbutton");
-	data->p_apps_scrolledwindow = GET_WIDGET ("p_apps_scrolledwindow");
+	data->p_rows_spinbutton = GET_WIDGET ("p_rows_spinbutton");
 
+	data->p_apps_scrolledwindow = GET_WIDGET ("p_apps_scrolledwindow");
 	data->p_apps_vadjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (data->p_apps_scrolledwindow));
 
 	btn_close = GET_WIDGET ("p_close_button");
@@ -1075,11 +1076,24 @@
 	gtk_widget_set_sensitive (data->btn_top, TRUE);
 	gtk_widget_set_sensitive (data->btn_bottom, TRUE);
 
+	switch (quick_box_get_orient (data->quick_box)) {
+	case PANEL_APPLET_ORIENT_LEFT:
+	case PANEL_APPLET_ORIENT_RIGHT:
+		rows_label = _("C_olumns:");
+		break;
+	case PANEL_APPLET_ORIENT_UP:
+	case PANEL_APPLET_ORIENT_DOWN:
+	default:
+		rows_label = _("R_ows:");
+		break;
+	}
+	gtk_label_set_text_with_mnemonic (GTK_LABEL (GET_WIDGET ("rows_label")), rows_label);
+
 	/**/
 
 	gtk_spin_button_set_value (GTK_SPIN_BUTTON (data->p_minsize_spinbutton), quick_box_get_min_visible_cols (data->quick_box));
 	gtk_spin_button_set_value (GTK_SPIN_BUTTON (data->p_maxsize_spinbutton), quick_box_get_max_visible_cols (data->quick_box));
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (data->p_icon_size_checkbutton), quick_box_get_icon_size_follows_panel (data->quick_box));
+	gtk_spin_button_set_value (GTK_SPIN_BUTTON (data->p_rows_spinbutton), quick_box_get_rows (data->quick_box));
 
 	/* Set the signals handlers. */
 	
@@ -1147,11 +1161,11 @@
                           "value_changed",
                           G_CALLBACK (max_size_value_changed_cb),
 			  data);
-	g_signal_connect (G_OBJECT (data->p_icon_size_checkbutton),
-			  "toggled",
-                          G_CALLBACK (icon_size_toggled_cb),
+	g_signal_connect (G_OBJECT (data->p_rows_spinbutton),
+			  "value_changed",
+			  G_CALLBACK (rows_value_changed_cb),
 			  data);
-
+	
 	/* Drag & Drop */
 
 	gtk_drag_source_set (data->tree_view,

Modified: trunk/src/quick-box.c
==============================================================================
--- trunk/src/quick-box.c	(original)
+++ trunk/src/quick-box.c	Tue Feb  3 16:52:30 2009
@@ -59,7 +59,6 @@
 
 	PanelAppletOrient  orient;
 	int                size;
-	gboolean           icon_size_follows_panel;
 
 	int                rows;
 	int                columns;
@@ -550,7 +549,7 @@
 
 	g_return_val_if_fail (quick_box->priv->rows > 0, 0);
 
-	if (quick_box->priv->icon_size_follows_panel || (quick_box->priv->rows == 1))
+	if (quick_box->priv->rows == 1)
 		return quick_box->priv->size;
 
 	child_size = (quick_box->priv->size - (quick_box->priv->rows - 1) * ICON_SPACING) / quick_box->priv->rows;
@@ -1391,29 +1390,28 @@
 	GtkBox          *box = GTK_BOX (quick_box);
 	QuickBoxPrivate *priv = quick_box->priv;
 
-	box->spacing     = ICON_SPACING;
+	box->spacing = ICON_SPACING;
 	box->homogeneous = FALSE;
 	gtk_container_set_resize_mode (GTK_CONTAINER (quick_box),
 				       GTK_RESIZE_QUEUE);
 
 	priv = quick_box->priv = g_new0 (QuickBoxPrivate, 1);
-	priv->size                    = ICON_SIZE_PANEL;
-	priv->icon_size_follows_panel = FALSE;
-	priv->orient                  = PANEL_APPLET_ORIENT_DOWN;
-	priv->drag_pos                = -1;
-	priv->drag_pos_begin          = -1;
-	priv->rows                    = 1;
-	priv->min_visible_cols        = DEFAULT_MIN_VISIBLE_COLS;
-	priv->max_visible_cols        = DEFAULT_MAX_VISIBLE_COLS;
-	priv->col_size                = NULL;
-	priv->buttons_on_col          = NULL;
+	priv->size = ICON_SIZE_PANEL;
+	priv->orient = PANEL_APPLET_ORIENT_DOWN;
+	priv->drag_pos = -1;
+	priv->drag_pos_begin = -1;
+	priv->rows = 1;
+	priv->min_visible_cols = DEFAULT_MIN_VISIBLE_COLS;
+	priv->max_visible_cols = DEFAULT_MAX_VISIBLE_COLS;
+	priv->col_size = NULL;
+	priv->buttons_on_col = NULL;
 
 	priv->populate_menu_func = NULL;
 	priv->populate_menu_data = NULL;
 
-	priv->arrow_up    = create_arrow_button (quick_box, GTK_ARROW_UP);
-	priv->arrow_down  = create_arrow_button (quick_box, GTK_ARROW_DOWN);
-	priv->arrow_left  = create_arrow_button (quick_box, GTK_ARROW_LEFT);
+	priv->arrow_up = create_arrow_button (quick_box, GTK_ARROW_UP);
+	priv->arrow_down = create_arrow_button (quick_box, GTK_ARROW_DOWN);
+	priv->arrow_left = create_arrow_button (quick_box, GTK_ARROW_LEFT);
 	priv->arrow_right = create_arrow_button (quick_box, GTK_ARROW_RIGHT);
 }
 
@@ -1811,17 +1809,11 @@
 	g_return_if_fail (QUICK_IS_BOX (quick_box));
 
 	quick_box->priv->size = size;
-	if (quick_box->priv->icon_size_follows_panel)
-		quick_box->priv->rows = 1;
-	else
-		quick_box->priv->rows = MAX (1, size / ICON_SIZE_PANEL);
-
+	
 	child_size = get_child_size (quick_box);
-
 	gtk_container_foreach (GTK_CONTAINER (quick_box),
 			       (GtkCallback) set_button_size_cb,
 			       GINT_TO_POINTER (child_size));
-
 	gtk_widget_queue_resize (GTK_WIDGET (quick_box));
 }
 
@@ -1873,21 +1865,23 @@
 
 
 void
-quick_box_set_icon_size_follows_panel (QuickBox *quick_box,
-				       gboolean  value)
+quick_box_set_rows (QuickBox *quick_box,
+		    int       value)
+
 {
 	g_return_if_fail (QUICK_IS_BOX (quick_box));
 
-	quick_box->priv->icon_size_follows_panel = value;
+	quick_box->priv->rows = value;
 	quick_box_set_size (quick_box, quick_box->priv->size);
 }
 
 
 int
-quick_box_get_icon_size_follows_panel (QuickBox *quick_box)
+quick_box_get_rows (QuickBox *quick_box)
 {
-	g_return_val_if_fail (QUICK_IS_BOX (quick_box), FALSE);
-	return quick_box->priv->icon_size_follows_panel;
+	g_return_val_if_fail (QUICK_IS_BOX (quick_box), 0);
+
+	return quick_box->priv->rows;
 }
 
 

Modified: trunk/src/quick-box.h
==============================================================================
--- trunk/src/quick-box.h	(original)
+++ trunk/src/quick-box.h	Tue Feb  3 16:52:30 2009
@@ -75,10 +75,10 @@
 
 int                 quick_box_get_max_visible_cols (QuickBox          *qbox);
 
-void                quick_box_set_icon_size_follows_panel (QuickBox    *qbox,
-							   gboolean     value);
+void		    quick_box_set_rows		   (QuickBox	      *qbox,
+						    int 	       rows);
 
-int                 quick_box_get_icon_size_follows_panel (QuickBox    *qbox);
+int                 quick_box_get_rows             (QuickBox          *qbox);
 
 const int *         quick_box_get_size_hint_list   (QuickBox          *qbox,
 						    int               *n_elements);

Modified: trunk/src/quick-lounge.c
==============================================================================
--- trunk/src/quick-lounge.c	(original)
+++ trunk/src/quick-lounge.c	Tue Feb  3 16:52:30 2009
@@ -41,16 +41,17 @@
 #define APPLET_FACTORY_IID "OAFIID:GNOME_QuickLoungeApplet_Factory"
 #define APPLET_UI          "GNOME_QuickLoungeApplet.xml"
 
-#define PREFS_LOCATION                 "location"
-#define PREFS_ORDER                    "order"
-#define PREFS_MIN_VISIBLE_COLS         "min_size"
-#define PREFS_MAX_VISIBLE_COLS         "max_size"
-#define PREFS_ICON_SIZE_FOLLOWS_PANEL  "icon_size_follows_panel"
+#define PREFS_LOCATION         "location"
+#define PREFS_ORDER            "order"
+#define PREFS_MIN_VISIBLE_COLS "min_size"
+#define PREFS_MAX_VISIBLE_COLS "max_size"
+#define PREFS_ROWS             "rows"
 
 #define BASE_DIR ".gnome2/quick-lounge"
 
 #define DEFAULT_MIN_VISIBLE_COLS 4
 #define DEFAULT_MAX_SIZE         20
+#define DEFAULT_ROWS             1
 
 #define ERROR_FORMAT "<span size=\"large\" weight=\"bold\">%s</span>\n\n%s"
 
@@ -1223,16 +1224,17 @@
 
 
 void
-quick_lounge_set_icon_size_follows_panel (QuickLounge *quick_lounge,
-					  gboolean     value)
+quick_lounge_set_rows (QuickLounge *quick_lounge,
+		       int          value)
 {
 	GError *error = NULL;
 
-	quick_box_set_icon_size_follows_panel (quick_lounge->quick_box, value);
-	panel_applet_gconf_set_bool (PANEL_APPLET (quick_lounge->applet),
-				     PREFS_ICON_SIZE_FOLLOWS_PANEL,
-				     value,
-				     &error);
+	quick_box_set_rows (quick_lounge->quick_box, value);
+	panel_applet_gconf_set_int (PANEL_APPLET (quick_lounge->applet),
+				    PREFS_ROWS,
+				    value,
+				    &error);
+
 	if (error != NULL)
 		_gtk_error_dialog_from_gerror_run (NULL, &error);
 }
@@ -1319,8 +1321,7 @@
 	QuickLounge *quick_lounge;
 	GError      *error = NULL;
 	char        *uri;
-	int          min_cols, max_size;
-	gboolean     icon_size_follows_panel;
+	int          min_cols, max_size, rows;
 
 	gtk_window_set_default_icon_name ("quick-lounge-applet");
 
@@ -1351,10 +1352,10 @@
 		max_size = DEFAULT_MAX_SIZE;
 	}
 
-	icon_size_follows_panel = panel_applet_gconf_get_bool (applet, PREFS_ICON_SIZE_FOLLOWS_PANEL, &error);
-	if (error != NULL) {
+	rows = panel_applet_gconf_get_int (applet, PREFS_ROWS, &error);
+	if ((error != NULL) || (rows <= 0)) {
 		g_clear_error (&error);
-		icon_size_follows_panel = FALSE;
+		rows = DEFAULT_ROWS;
 	}
 
 	/**/
@@ -1362,7 +1363,8 @@
 	quick_lounge->quick_box = QUICK_BOX (quick_box_new (quick_lounge->orientation, quick_lounge->size, quick_lounge->icon_theme));
 	quick_box_set_min_visible_cols (quick_lounge->quick_box, min_cols);
 	quick_box_set_max_visible_cols (quick_lounge->quick_box, max_size);
-	quick_box_set_icon_size_follows_panel (quick_lounge->quick_box, icon_size_follows_panel);
+	quick_box_set_rows (quick_lounge->quick_box, rows);
+
 
 	g_object_set_data (G_OBJECT (quick_lounge->quick_box),
 			   "quick_lounge",

Modified: trunk/src/quick-lounge.h
==============================================================================
--- trunk/src/quick-lounge.h	(original)
+++ trunk/src/quick-lounge.h	Tue Feb  3 16:52:30 2009
@@ -33,7 +33,6 @@
 	GtkWidget         *applet;
 	GtkWidget         *prop_dialog;
 	QuickBox          *quick_box;
-
 	gboolean           loading;
 	char              *location;
 	int                size;
@@ -50,8 +49,8 @@
 						    int           cols);
 gboolean  quick_lounge_set_max_size                (QuickLounge  *quick_lounge, 
 						    int           value);
-void      quick_lounge_set_icon_size_follows_panel (QuickLounge  *quick_lounge, 
-						    gboolean      value);
+void	  quick_lounge_set_rows			   (QuickLounge  *quick_lounge,
+						    int		  value);
 void      quick_lounge_new_launcher                (QuickLounge  *quick_lounge,
 						    int           pos);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]