summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views/configurecardviewdialog.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/views/configurecardviewdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/views/configurecardviewdialog.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/kaddressbook/views/configurecardviewdialog.cpp b/kaddressbook/views/configurecardviewdialog.cpp
index 366e54c..e0fbd21 100644
--- a/kaddressbook/views/configurecardviewdialog.cpp
+++ b/kaddressbook/views/configurecardviewdialog.cpp
@@ -170,101 +170,105 @@ void CardViewLookNFeelPage::saveSettings( KConfig *config )
if ( cbEnableCustomFonts->isChecked() )
{
config->writeEntry( "TextFont", lTextFont->font() );
config->writeEntry( "HeaderFont", lHeaderFont->font() );
}
// layout
config->writeEntry( "ItemMargin", sbMargin->value() );
config->writeEntry( "ItemSpacing", sbSpacing->value() );
config->writeEntry( "SeparatorWidth", sbSepWidth->value() );
config->writeEntry("DrawBorder", cbDrawBorders->isChecked());
config->writeEntry("DrawSeparators", cbDrawSeps->isChecked());
// behaviour
config->writeEntry("DrawFieldLabels", cbShowFieldLabels->isChecked());
config->writeEntry("ShowEmptyFields", cbShowEmptyFields->isChecked());
}
void CardViewLookNFeelPage::setTextFont()
{
QFont f( lTextFont->font() );
#ifndef KAB_EMBEDDED
if ( KFontDialog::getFont( f, false, this ) == QDialog::Accepted )
updateFontLabel( f, lTextFont );
#else //KAB_EMBEDDED
bool ok;
QFont fout = KFontDialog::getFont( f, ok);
if ( ok )
updateFontLabel( fout, lTextFont );
#endif //KAB_EMBEDDED
}
void CardViewLookNFeelPage::setHeaderFont()
{
QFont f( lHeaderFont->font() );
#ifndef KAB_EMBEDDED
if ( KFontDialog::getFont( f,false, this ) == QDialog::Accepted )
updateFontLabel( f, lHeaderFont );
#else //KAB_EMBEDDED
bool ok;
QFont fout = KFontDialog::getFont( f, ok);
if ( ok )
updateFontLabel( fout, lHeaderFont );
#endif //KAB_EMBEDDED
}
void CardViewLookNFeelPage::enableFonts()
{
vbFonts->setEnabled( cbEnableCustomFonts->isChecked() );
+ if ( cbEnableCustomFonts->isChecked() )
+ vbFonts->setFocus();
}
void CardViewLookNFeelPage::enableColors()
{
lbColors->setEnabled( cbEnableCustomColors->isChecked() );
+ if ( cbEnableCustomColors->isChecked() )
+ lbColors->setFocus();
}
void CardViewLookNFeelPage::initGUI()
{
int spacing = KDialog::spacingHint();
int margin = KDialog::marginHint();
QTabWidget *tabs = new QTabWidget( this );
// Layout
QVBox *loTab = new QVBox( this, "layouttab" );
loTab->setSpacing( spacing );
loTab->setMargin( margin );
QGroupBox *gbGeneral = new QGroupBox( 1, Qt::Horizontal, i18n("General"), loTab );
cbDrawSeps = new QCheckBox( i18n("Draw &separators"), gbGeneral );
QHBox *hbSW = new QHBox( gbGeneral );
QLabel *lSW = new QLabel( i18n("Separator &width:"), hbSW );
sbSepWidth = new QSpinBox( 1, 50, 1, hbSW );
lSW->setBuddy( sbSepWidth);
QHBox *hbPadding = new QHBox( gbGeneral );
QLabel *lSpacing = new QLabel( i18n("&Padding:"), hbPadding );
sbSpacing = new QSpinBox( 0, 100, 1, hbPadding );
lSpacing->setBuddy( sbSpacing );
QGroupBox *gbCards = new QGroupBox( 1, Qt::Horizontal, i18n("Cards"), loTab );
QHBox *hbMargin = new QHBox( gbCards );
QLabel *lMargin = new QLabel( i18n("&Margin:"), hbMargin );
sbMargin = new QSpinBox( 0, 100, 1, hbMargin );
lMargin->setBuddy( sbMargin );
cbDrawBorders = new QCheckBox( i18n("Draw &borders"), gbCards );
loTab->setStretchFactor( new QWidget( loTab ), 1 );
QWhatsThis::add( sbMargin, i18n(
"The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, "
"incrementing the item margin will add space between the focus rectangle and the item data."
) );
QWhatsThis::add( lMargin, QWhatsThis::textFor( sbMargin ) );
QWhatsThis::add( sbSpacing, i18n(
"The Item Spacing decides the distance (in pixels) between the items and anything else: the view "
"borders, other items or column separators."