From f284eafbe4274cb97ec25f375544b924ae04ac09 Mon Sep 17 00:00:00 2001 From: zautrix Date: Fri, 28 Oct 2005 08:57:25 +0000 Subject: cimmit --- (limited to 'kaddressbook/addresseeeditorwidget.cpp') diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp index 310d628..9814cd5 100644 --- a/kaddressbook/addresseeeditorwidget.cpp +++ b/kaddressbook/addresseeeditorwidget.cpp @@ -154,7 +154,14 @@ void AddresseeEditorWidget::setupTab1() QWidget *tab1 = new QWidget( mTabWidget ); //US QGridLayout *layout = new QGridLayout( tab1, 11, 7 ); - QGridLayout *layout = new QGridLayout( tab1, 7, 1 ); + bool horLayout = false; + int maxCol = 1; + if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) { + horLayout = true; + maxCol = 3; + } + QGridLayout *layout = new QGridLayout( tab1, 8-maxCol, maxCol ); + layout->setMargin( KDialogBase::marginHintSmall() ); layout->setSpacing( KDialogBase::spacingHintSmall() ); @@ -206,14 +213,25 @@ void AddresseeEditorWidget::setupTab1() //label->setBuddy( mOrgEdit ); connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), SLOT( textChanged( const QString& ) ) ); - layout->addWidget( button, 2, 0 ); - layout->addWidget( mOrgEdit, 2, 1 ); + if ( horLayout ) { + layout->addWidget( button, 1, 2 ); + layout->addWidget( mOrgEdit, 1, 3 ); + + } else { + layout->addWidget( button, 2, 0 ); + layout->addWidget( mOrgEdit, 2, 1 ); + } // File as (formatted name) - label = new QLabel( i18n( "Formatted name:" ), tab1 ); + label = new QLabel( i18n( "Format.n.:" ), tab1 ); mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); - layout->addWidget( label, 3, 0 ); - layout->addWidget( mFormattedNameLabel, 3, 1 ); + if ( horLayout ) { + layout->addWidget( label, 0,2 ); + layout->addWidget( mFormattedNameLabel, 0, 3 ); + } else { + layout->addWidget( label, 3, 0 ); + layout->addWidget( mFormattedNameLabel, 3, 1 ); + } /* LR // Left hand separator. This separator doesn't go all the way // across so the dialog still flows from top to bottom @@ -240,7 +258,7 @@ void AddresseeEditorWidget::setupTab1() #else iii = 8; #endif - layout->addMultiCellWidget( mPhoneEditWidget, 4, iii, 0, 1 ); + layout->addMultiCellWidget( mPhoneEditWidget, 4, iii, 0, maxCol ); ++iii; /* LR bar = new KSeparator( KSeparator::HLine, tab1 ); @@ -321,7 +339,7 @@ void AddresseeEditorWidget::setupTab1() connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); //US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); - layout->addMultiCellWidget( categoryBox, iii, iii, 0, 1 ); + layout->addMultiCellWidget( categoryBox, iii, iii, 0, maxCol ); // Build the layout and add to the tab widget layout->activate(); // required -- cgit v0.9.0.2