Diffstat (limited to 'kaddressbook/views/kaddressbooktableview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index 0847b64..ab11e2a 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp @@ -27,17 +27,17 @@ //US#include "configuretableviewdialog.h" #include "contactlistview.h" #include "kabprefs.h" #include "undocmds.h" #include "viewmanager.h" #include <qlayout.h> - +#include <qheader.h> #include "kaddressbooktableview.h" KAddressBookTableView::KAddressBookTableView( KABC::AddressBook *ab, QWidget *parent, const char *name ) : KAddressBookView( ab, parent, name ) { @@ -137,39 +137,50 @@ void KAddressBookTableView::readConfig(KConfig *config) c = p.color(QPalette::Normal, QColorGroup::Button ); p.setColor( QPalette::Normal, QColorGroup::Button, config->readColorEntry( "HeaderColor", &c ) ); c = p.color(QPalette::Normal, QColorGroup::ButtonText ); p.setColor( QPalette::Normal, QColorGroup::ButtonText, config->readColorEntry( "HeaderTextColor", &c ) ); c = p.color(QPalette::Normal, QColorGroup::Highlight ); p.setColor( QPalette::Normal, QColorGroup::Highlight, config->readColorEntry( "HighlightColor", &c ) ); c = p.color(QPalette::Normal, QColorGroup::HighlightedText ); p.setColor( QPalette::Normal, QColorGroup::HighlightedText, config->readColorEntry( "HighlightedTextColor", &c ) ); - c = p.color(QPalette::Normal, QColorGroup::Base ); - p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "AlternatingBackgroundColor", &c ) ); - mListView->viewport()->setPalette( p ); +#ifndef KAB_EMBEDDED + c = KGlobalSettings::alternateBackgroundColor(); +#else //KAB_EMBEDDED + c = QColor(240, 240, 240); +#endif //KAB_EMBEDDED + c = config->readColorEntry ("AlternatingBackgroundColor", &c); + mListView->setAlternateColor(c); + + + //US mListView->viewport()->setPalette( p ); + mListView->setPalette( p ); } else { // needed if turned off during a session. - mListView->viewport()->setPalette( mListView->palette() ); + //US mListView->viewport()->setPalette( mListView->palette() ); + mListView->setPalette( mListView->palette() ); } //custom fonts? QFont f( font() ); if ( config->readBoolEntry( "EnableCustomFonts", false ) ) { - // mListView->setFont( config->readFontEntry( "TextFont", &f) ); + mListView->setFont( config->readFontEntry( "TextFont", &f) ); f.setBold( true ); - // mListView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) ); + //US mListView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) ); + mListView->header()->setFont( config->readFontEntry( "HeaderFont", &f ) ); } else { - // mListView->setFont( f ); + mListView->setFont( f ); f.setBold( true ); - // mListView->setHeaderFont( f ); + //US mListView->setHeaderFont( f ); + mListView->header()->setFont( f ); } // Set the list view options mListView->setAlternateBackgroundEnabled(config->readBoolEntry("ABackground", |