Commit 765454f1 authored by Eric Petit's avatar Eric Petit

modules/gui/beos/PreferencesWindow.* : cleaning

parent d4667ed2
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* PreferencesWindow.cpp: beos interface * PreferencesWindow.cpp: beos interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * 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> * Authors: Eric Petit <titer@videolan.org>
* *
...@@ -503,13 +503,11 @@ BView * PreferencesWindow::BuildConfigView( module_config_t ** pp_item, ...@@ -503,13 +503,11 @@ BView * PreferencesWindow::BuildConfigView( module_config_t ** pp_item,
rect = configView->Bounds(); rect = configView->Bounds();
rect.InsetBy( 10, 10 ); rect.InsetBy( 10, 10 );
rect.bottom = rect.top + TEXT_HEIGHT;
ConfigTextControl * textControl; ConfigTextControl * textControl;
ConfigCheckBox * checkBox; ConfigCheckBox * checkBox;
ConfigMenuField * menuField; ConfigMenuField * menuField;
BPopUpMenu * popUp; BPopUpMenu * popUp;
bool firstItem = true;
bool categoryHit = false; bool categoryHit = false;
do do
{ {
...@@ -519,13 +517,9 @@ BView * PreferencesWindow::BuildConfigView( module_config_t ** pp_item, ...@@ -519,13 +517,9 @@ BView * PreferencesWindow::BuildConfigView( module_config_t ** pp_item,
case CONFIG_ITEM_FILE: case CONFIG_ITEM_FILE:
case CONFIG_ITEM_MODULE: case CONFIG_ITEM_MODULE:
case CONFIG_ITEM_DIRECTORY: case CONFIG_ITEM_DIRECTORY:
if( !firstItem )
rect.OffsetBy( 0, 25 );
else
firstItem = false;
if( (*pp_item)->ppsz_list && (*pp_item)->ppsz_list[0] ) if( (*pp_item)->ppsz_list && (*pp_item)->ppsz_list[0] )
{ {
rect.bottom = rect.top + 20;
popUp = new BPopUpMenu( "" ); popUp = new BPopUpMenu( "" );
menuField = new ConfigMenuField( rect, (*pp_item)->psz_text, menuField = new ConfigMenuField( rect, (*pp_item)->psz_text,
popUp, (*pp_item)->psz_name ); popUp, (*pp_item)->psz_name );
...@@ -536,35 +530,32 @@ BView * PreferencesWindow::BuildConfigView( module_config_t ** pp_item, ...@@ -536,35 +530,32 @@ BView * PreferencesWindow::BuildConfigView( module_config_t ** pp_item,
popUp->AddItem( menuItem ); popUp->AddItem( menuItem );
} }
configView->AddChild( menuField ); configView->AddChild( menuField );
rect.top = rect.bottom + 10;
} }
else else
{ {
rect.bottom = rect.top + 20;
textControl = new ConfigTextControl( rect, (*pp_item)->psz_text, textControl = new ConfigTextControl( rect, (*pp_item)->psz_text,
CONFIG_ITEM_STRING, (*pp_item)->psz_name ); CONFIG_ITEM_STRING, (*pp_item)->psz_name );
configView->AddChild( textControl ); configView->AddChild( textControl );
rect.top = rect.bottom + 10;
} }
break; break;
case CONFIG_ITEM_INTEGER: case CONFIG_ITEM_INTEGER:
if( !firstItem ) rect.bottom = rect.top + 20;
rect.OffsetBy( 0, 25 );
else
firstItem = false;
textControl = new ConfigTextControl( rect, (*pp_item)->psz_text, textControl = new ConfigTextControl( rect, (*pp_item)->psz_text,
CONFIG_ITEM_INTEGER, (*pp_item)->psz_name ); CONFIG_ITEM_INTEGER, (*pp_item)->psz_name );
configView->AddChild( textControl ); configView->AddChild( textControl );
rect.top = rect.bottom + 10;
break; break;
case CONFIG_ITEM_FLOAT: case CONFIG_ITEM_FLOAT:
if( !firstItem ) rect.bottom = rect.top + 20;
rect.OffsetBy( 0, 25 );
else
firstItem = false;
textControl = new ConfigTextControl( rect, (*pp_item)->psz_text, textControl = new ConfigTextControl( rect, (*pp_item)->psz_text,
CONFIG_ITEM_FLOAT, (*pp_item)->psz_name ); CONFIG_ITEM_FLOAT, (*pp_item)->psz_name );
configView->AddChild( textControl ); configView->AddChild( textControl );
rect.top = rect.bottom + 10;
break; break;
case CONFIG_ITEM_BOOL: case CONFIG_ITEM_BOOL:
...@@ -572,14 +563,11 @@ BView * PreferencesWindow::BuildConfigView( module_config_t ** pp_item, ...@@ -572,14 +563,11 @@ BView * PreferencesWindow::BuildConfigView( module_config_t ** pp_item,
/* Don't show this one, the interface doesn't handle it anyway */ /* Don't show this one, the interface doesn't handle it anyway */
break; break;
if( !firstItem ) rect.bottom = rect.top + 20;
rect.OffsetBy( 0,25 );
else
firstItem = false;
checkBox = new ConfigCheckBox( rect, (*pp_item)->psz_text, checkBox = new ConfigCheckBox( rect, (*pp_item)->psz_text,
(*pp_item)->psz_name ); (*pp_item)->psz_name );
configView->AddChild( checkBox ); configView->AddChild( checkBox );
rect.top = rect.bottom + 10;
break; break;
case CONFIG_HINT_CATEGORY: case CONFIG_HINT_CATEGORY:
...@@ -592,8 +580,7 @@ BView * PreferencesWindow::BuildConfigView( module_config_t ** pp_item, ...@@ -592,8 +580,7 @@ BView * PreferencesWindow::BuildConfigView( module_config_t ** pp_item,
(*pp_item)++ ); (*pp_item)++ );
/* Adjust the configView size */ /* Adjust the configView size */
rect.bottom += 10; configView->ResizeTo( configView->Bounds().Width(), rect.top );
configView->ResizeTo( configView->Bounds().Width(), rect.bottom );
return configView; return configView;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* PreferencesWindow.h * PreferencesWindow.h
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * 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> * Authors: Eric Petit <titer@videolan.org>
* *
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#define PREFS_DEFAULTS 'prde' #define PREFS_DEFAULTS 'prde'
#define PREFS_APPLY 'prap' #define PREFS_APPLY 'prap'
#define PREFS_SAVE 'prsa' #define PREFS_SAVE 'prsa'
#define TEXT_HEIGHT 16
class StringItemWithView : public BStringItem class StringItemWithView : public BStringItem
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment