summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/views/kaddressbooktableview.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp
index 8d2203e..66a3f0b 100644
--- a/kaddressbook/views/kaddressbooktableview.cpp
+++ b/kaddressbook/views/kaddressbooktableview.cpp
@@ -125,2 +125,46 @@ void KAddressBookTableView::readConfig(KConfig *config)
+ // costum colors?
+ if ( config->readBoolEntry( "EnableCustomColors", false ) )
+ {
+ QPalette p( mListView->palette() );
+ QColor c = p.color(QPalette::Normal, QColorGroup::Base );
+ p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "BackgroundColor", &c ) );
+ c = p.color(QPalette::Normal, QColorGroup::Text );
+ p.setColor( QPalette::Normal, QColorGroup::Text, config->readColorEntry( "TextColor", &c ) );
+ 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 );
+ }
+ else
+ {
+ // needed if turned off during a session.
+ mListView->viewport()->setPalette( mListView->palette() );
+ }
+
+ //custom fonts?
+ QFont f( font() );
+ if ( config->readBoolEntry( "EnableCustomFonts", false ) )
+ {
+ // mListView->setFont( config->readFontEntry( "TextFont", &f) );
+ f.setBold( true );
+ // mListView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) );
+ }
+ else
+ {
+ // mListView->setFont( f );
+ f.setBold( true );
+ // mListView->setHeaderFont( f );
+ }
+
+
+
+
// The config could have changed the fields, so we need to reconstruct