summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-09-09 18:55:32 (UTC)
committer ulf69 <ulf69>2004-09-09 18:55:32 (UTC)
commit72860f2b84ba97de9223238d9fb97edc0804cc68 (patch) (side-by-side diff)
tree0f0ace3690f299260f08a63b4851c422d30cb7be
parent578bb7c0193afcb84bb08a65f17f6abc0375676e (diff)
downloadkdepimpi-72860f2b84ba97de9223238d9fb97edc0804cc68.zip
kdepimpi-72860f2b84ba97de9223238d9fb97edc0804cc68.tar.gz
kdepimpi-72860f2b84ba97de9223238d9fb97edc0804cc68.tar.bz2
sourceforge 1014886: select fonts and colors for tableview
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/views/contactlistview.cpp5
-rw-r--r--kaddressbook/views/contactlistview.h1
-rw-r--r--kaddressbook/views/kaddressbooktableview.cpp29
3 files changed, 26 insertions, 9 deletions
diff --git a/kaddressbook/views/contactlistview.cpp b/kaddressbook/views/contactlistview.cpp
index 9804e28..4cc22ea 100644
--- a/kaddressbook/views/contactlistview.cpp
+++ b/kaddressbook/views/contactlistview.cpp
@@ -252,2 +252,7 @@ ContactListView::ContactListView(KAddressBookTableView *view,
+void ContactListView::setAlternateColor(const QColor &m_AlternateColor)
+{
+ mAlternateColor = m_AlternateColor;
+}
+
void ContactListView::paintEmptyArea( QPainter * p, const QRect & rect )
diff --git a/kaddressbook/views/contactlistview.h b/kaddressbook/views/contactlistview.h
index ae9c994..fad7f38 100644
--- a/kaddressbook/views/contactlistview.h
+++ b/kaddressbook/views/contactlistview.h
@@ -85,2 +85,3 @@ public:
const QColor &alternateColor() const { return mAlternateColor; }
+ void setAlternateColor(const QColor &mAlternateColor);
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
@@ -34,3 +34,3 @@
#include <qlayout.h>
-
+#include <qheader.h>
@@ -144,5 +144,13 @@ void KAddressBookTableView::readConfig(KConfig *config)
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 );
}
@@ -151,3 +159,4 @@ void KAddressBookTableView::readConfig(KConfig *config)
// needed if turned off during a session.
- mListView->viewport()->setPalette( mListView->palette() );
+ //US mListView->viewport()->setPalette( mListView->palette() );
+ mListView->setPalette( mListView->palette() );
}
@@ -158,5 +167,6 @@ void KAddressBookTableView::readConfig(KConfig *config)
{
- // 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 ) );
}
@@ -164,5 +174,6 @@ void KAddressBookTableView::readConfig(KConfig *config)
{
- // mListView->setFont( f );
+ mListView->setFont( f );
f.setBold( true );
- // mListView->setHeaderFont( f );
+ //US mListView->setHeaderFont( f );
+ mListView->header()->setFont( f );
}