]> git.sesse.net Git - vlc/commitdiff
modules/gui/beos/PreferencesWindow.* : cleaning
authorEric Petit <titer@videolan.org>
Tue, 20 May 2003 11:44:18 +0000 (11:44 +0000)
committerEric Petit <titer@videolan.org>
Tue, 20 May 2003 11:44:18 +0000 (11:44 +0000)
modules/gui/beos/PreferencesWindow.cpp
modules/gui/beos/PreferencesWindow.h

index 743642d7c7aed49f66b3edccb5fdda1f78a1bc91..eee860fd520bd8ea96136d70957bcbfbda4be4e0 100644 (file)
@@ -2,7 +2,7 @@
  * PreferencesWindow.cpp: beos interface
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: PreferencesWindow.cpp,v 1.22 2003/05/17 18:30:41 titer Exp $
+ * $Id: PreferencesWindow.cpp,v 1.23 2003/05/20 11:44:18 titer Exp $
  *
  * Authors: Eric Petit <titer@videolan.org>
  *
@@ -503,13 +503,11 @@ BView * PreferencesWindow::BuildConfigView( module_config_t ** pp_item,
 
     rect = configView->Bounds();
     rect.InsetBy( 10, 10 );
-    rect.bottom = rect.top + TEXT_HEIGHT;
     ConfigTextControl * textControl;
     ConfigCheckBox * checkBox;
     ConfigMenuField * menuField;
     BPopUpMenu * popUp;
 
-    bool firstItem = true;
     bool categoryHit = false;
     do
     {
@@ -519,13 +517,9 @@ BView * PreferencesWindow::BuildConfigView( module_config_t ** pp_item,
             case CONFIG_ITEM_FILE:
             case CONFIG_ITEM_MODULE:
             case CONFIG_ITEM_DIRECTORY:
-                if( !firstItem )
-                    rect.OffsetBy( 0, 25 );
-                else
-                    firstItem = false;
-
                 if( (*pp_item)->ppsz_list && (*pp_item)->ppsz_list[0] )
                 {
+                    rect.bottom = rect.top + 20;
                     popUp = new BPopUpMenu( "" );
                     menuField = new ConfigMenuField( rect, (*pp_item)->psz_text,
                                                      popUp, (*pp_item)->psz_name );
@@ -536,35 +530,32 @@ BView * PreferencesWindow::BuildConfigView( module_config_t ** pp_item,
                         popUp->AddItem( menuItem );
                     }
                     configView->AddChild( menuField );
+                    rect.top = rect.bottom + 10;
                 }
                 else
                 {
+                    rect.bottom = rect.top + 20;
                     textControl = new ConfigTextControl( rect, (*pp_item)->psz_text,
                                                          CONFIG_ITEM_STRING, (*pp_item)->psz_name );
                     configView->AddChild( textControl );
+                    rect.top = rect.bottom + 10;
                 }
                 break;
 
             case CONFIG_ITEM_INTEGER:
-                if( !firstItem )
-                    rect.OffsetBy( 0, 25 );
-                else
-                    firstItem = false;
-
+                rect.bottom = rect.top + 20;
                 textControl = new ConfigTextControl( rect, (*pp_item)->psz_text,
                                                      CONFIG_ITEM_INTEGER, (*pp_item)->psz_name );
                 configView->AddChild( textControl );
+                rect.top = rect.bottom + 10;
                 break;
 
             case CONFIG_ITEM_FLOAT:
-                if( !firstItem )
-                    rect.OffsetBy( 0, 25 );
-                else
-                    firstItem = false;
-
+                rect.bottom = rect.top + 20;
                 textControl = new ConfigTextControl( rect, (*pp_item)->psz_text,
                                                      CONFIG_ITEM_FLOAT, (*pp_item)->psz_name );
                 configView->AddChild( textControl );
+                rect.top = rect.bottom + 10;
                 break;
 
             case CONFIG_ITEM_BOOL:
@@ -572,14 +563,11 @@ BView * PreferencesWindow::BuildConfigView( module_config_t ** pp_item,
                     /* Don't show this one, the interface doesn't handle it anyway */
                     break;
 
-                if( !firstItem )
-                    rect.OffsetBy( 0,25 );
-                else
-                   firstItem = false;
-
+                rect.bottom = rect.top + 20;
                 checkBox = new ConfigCheckBox( rect, (*pp_item)->psz_text,
                                                (*pp_item)->psz_name );
                 configView->AddChild( checkBox );
+                rect.top = rect.bottom + 10;
                 break;
 
             case CONFIG_HINT_CATEGORY:
@@ -592,8 +580,7 @@ BView * PreferencesWindow::BuildConfigView( module_config_t ** pp_item,
              (*pp_item)++ );
 
     /* Adjust the configView size */
-    rect.bottom += 10;
-    configView->ResizeTo( configView->Bounds().Width(), rect.bottom );
+    configView->ResizeTo( configView->Bounds().Width(), rect.top );
 
     return configView;
 }
index b138832a2af930aef6dcb5ceed71a84c9cf637d0..77ef18f2f7c473d9c6a316f469afe9cf6da48177 100644 (file)
@@ -2,7 +2,7 @@
  * PreferencesWindow.h
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: PreferencesWindow.h,v 1.15 2003/05/17 18:30:41 titer Exp $
+ * $Id: PreferencesWindow.h,v 1.16 2003/05/20 11:44:18 titer Exp $
  *
  * Authors: Eric Petit <titer@videolan.org>
  *
@@ -32,7 +32,6 @@
 #define PREFS_DEFAULTS       'prde'
 #define PREFS_APPLY          'prap'
 #define PREFS_SAVE           'prsa'
-#define TEXT_HEIGHT 16
 
 class StringItemWithView : public BStringItem
 {