author | ulf69 <ulf69> | 2004-09-09 18:55:32 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-09-09 18:55:32 (UTC) |
commit | 72860f2b84ba97de9223238d9fb97edc0804cc68 (patch) (unidiff) | |
tree | 0f0ace3690f299260f08a63b4851c422d30cb7be /kaddressbook | |
parent | 578bb7c0193afcb84bb08a65f17f6abc0375676e (diff) | |
download | kdepimpi-72860f2b84ba97de9223238d9fb97edc0804cc68.zip kdepimpi-72860f2b84ba97de9223238d9fb97edc0804cc68.tar.gz kdepimpi-72860f2b84ba97de9223238d9fb97edc0804cc68.tar.bz2 |
sourceforge 1014886: select fonts and colors for tableview
-rw-r--r-- | kaddressbook/views/contactlistview.cpp | 5 | ||||
-rw-r--r-- | kaddressbook/views/contactlistview.h | 1 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 29 |
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 | |||
@@ -250,6 +250,11 @@ ContactListView::ContactListView(KAddressBookTableView *view, | |||
250 | new DynamicTip( this ); | 250 | new DynamicTip( this ); |
251 | } | 251 | } |
252 | 252 | ||
253 | void ContactListView::setAlternateColor(const QColor &m_AlternateColor) | ||
254 | { | ||
255 | mAlternateColor = m_AlternateColor; | ||
256 | } | ||
257 | |||
253 | void ContactListView::paintEmptyArea( QPainter * p, const QRect & rect ) | 258 | void ContactListView::paintEmptyArea( QPainter * p, const QRect & rect ) |
254 | { | 259 | { |
255 | QBrush b = palette().brush(QPalette::Active, QColorGroup::Base); | 260 | QBrush b = palette().brush(QPalette::Active, QColorGroup::Base); |
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 | |||
@@ -83,6 +83,7 @@ public: | |||
83 | void setSingleLineEnabled(bool enabled) { mSingleLine = enabled; } | 83 | void setSingleLineEnabled(bool enabled) { mSingleLine = enabled; } |
84 | 84 | ||
85 | const QColor &alternateColor() const { return mAlternateColor; } | 85 | const QColor &alternateColor() const { return mAlternateColor; } |
86 | void setAlternateColor(const QColor &mAlternateColor); | ||
86 | 87 | ||
87 | /** Sets the background pixmap to <i>filename</i>. If the | 88 | /** Sets the background pixmap to <i>filename</i>. If the |
88 | * QString is empty (QString::isEmpty()), then the background | 89 | * QString is empty (QString::isEmpty()), then the background |
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 | |||
@@ -32,7 +32,7 @@ | |||
32 | #include "viewmanager.h" | 32 | #include "viewmanager.h" |
33 | 33 | ||
34 | #include <qlayout.h> | 34 | #include <qlayout.h> |
35 | 35 | #include <qheader.h> | |
36 | 36 | ||
37 | #include "kaddressbooktableview.h" | 37 | #include "kaddressbooktableview.h" |
38 | 38 | ||
@@ -142,29 +142,40 @@ void KAddressBookTableView::readConfig(KConfig *config) | |||
142 | p.setColor( QPalette::Normal, QColorGroup::Highlight, config->readColorEntry( "HighlightColor", &c ) ); | 142 | p.setColor( QPalette::Normal, QColorGroup::Highlight, config->readColorEntry( "HighlightColor", &c ) ); |
143 | c = p.color(QPalette::Normal, QColorGroup::HighlightedText ); | 143 | c = p.color(QPalette::Normal, QColorGroup::HighlightedText ); |
144 | p.setColor( QPalette::Normal, QColorGroup::HighlightedText, config->readColorEntry( "HighlightedTextColor", &c ) ); | 144 | p.setColor( QPalette::Normal, QColorGroup::HighlightedText, config->readColorEntry( "HighlightedTextColor", &c ) ); |
145 | c = p.color(QPalette::Normal, QColorGroup::Base ); | 145 | #ifndef KAB_EMBEDDED |
146 | p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "AlternatingBackgroundColor", &c ) ); | 146 | c = KGlobalSettings::alternateBackgroundColor(); |
147 | mListView->viewport()->setPalette( p ); | 147 | #else //KAB_EMBEDDED |
148 | c = QColor(240, 240, 240); | ||
149 | #endif //KAB_EMBEDDED | ||
150 | c = config->readColorEntry ("AlternatingBackgroundColor", &c); | ||
151 | mListView->setAlternateColor(c); | ||
152 | |||
153 | |||
154 | //US mListView->viewport()->setPalette( p ); | ||
155 | mListView->setPalette( p ); | ||
148 | } | 156 | } |
149 | else | 157 | else |
150 | { | 158 | { |
151 | // needed if turned off during a session. | 159 | // needed if turned off during a session. |
152 | mListView->viewport()->setPalette( mListView->palette() ); | 160 | //US mListView->viewport()->setPalette( mListView->palette() ); |
161 | mListView->setPalette( mListView->palette() ); | ||
153 | } | 162 | } |
154 | 163 | ||
155 | //custom fonts? | 164 | //custom fonts? |
156 | QFont f( font() ); | 165 | QFont f( font() ); |
157 | if ( config->readBoolEntry( "EnableCustomFonts", false ) ) | 166 | if ( config->readBoolEntry( "EnableCustomFonts", false ) ) |
158 | { | 167 | { |
159 | // mListView->setFont( config->readFontEntry( "TextFont", &f) ); | 168 | mListView->setFont( config->readFontEntry( "TextFont", &f) ); |
160 | f.setBold( true ); | 169 | f.setBold( true ); |
161 | // mListView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) ); | 170 | //US mListView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) ); |
171 | mListView->header()->setFont( config->readFontEntry( "HeaderFont", &f ) ); | ||
162 | } | 172 | } |
163 | else | 173 | else |
164 | { | 174 | { |
165 | // mListView->setFont( f ); | 175 | mListView->setFont( f ); |
166 | f.setBold( true ); | 176 | f.setBold( true ); |
167 | // mListView->setHeaderFont( f ); | 177 | //US mListView->setHeaderFont( f ); |
178 | mListView->header()->setFont( f ); | ||
168 | } | 179 | } |
169 | 180 | ||
170 | 181 | ||