summaryrefslogtreecommitdiffstats
path: root/akregator
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-10-05 18:37:59 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-10-05 18:37:59 -0500
commitfaf37227f5194237dbda5973c21d05de3633ea03 (patch)
tree2fe295ab340901ac71d610e233ef651a7c3404d3 /akregator
parent352bfda9b44902c28c0f8cb7beaa9decd39fb6d6 (diff)
downloadtdepim-faf37227f5194237dbda5973c21d05de3633ea03.tar.gz
tdepim-faf37227f5194237dbda5973c21d05de3633ea03.zip
Add configuration options to set Akregator read and unread text colors
This resolves Bug 1696
Diffstat (limited to 'akregator')
-rw-r--r--akregator/src/akregator.kcfg6
-rw-r--r--akregator/src/akregator_part.cpp2
-rw-r--r--akregator/src/akregator_view.cpp9
-rw-r--r--akregator/src/articlelistview.cpp9
-rw-r--r--akregator/src/configdialog.cpp4
-rw-r--r--akregator/src/settings_appearance.ui32
-rw-r--r--akregator/src/trayicon.cpp9
-rw-r--r--akregator/src/treenodeitem.cpp4
8 files changed, 64 insertions, 11 deletions
diff --git a/akregator/src/akregator.kcfg b/akregator/src/akregator.kcfg
index 40283878b..d5ec78915 100644
--- a/akregator/src/akregator.kcfg
+++ b/akregator/src/akregator.kcfg
@@ -40,6 +40,12 @@
<entry key="Fixed Font" type="String" />
<entry key="Serif Font" type="String" />
<entry key="Sans Serif Font" type="String" />
+ <entry key="UnreadTextColor" type="Color">
+ <default>0,0,255</default>
+ </entry>
+ <entry key="ReadTextColor" type="Color">
+ <default>255,0,0</default>
+ </entry>
</group>
<group name="HTML Settings" >
<entry key="Fonts" type="StringList" />
diff --git a/akregator/src/akregator_part.cpp b/akregator/src/akregator_part.cpp
index b483765b8..d7ca0d442 100644
--- a/akregator/src/akregator_part.cpp
+++ b/akregator/src/akregator_part.cpp
@@ -108,6 +108,8 @@ void BrowserExtension::saveSettings()
class Part::ApplyFiltersInterceptor : public ArticleInterceptor
{
public:
+ virtual ~ApplyFiltersInterceptor() {}
+
virtual void processArticle(Article& article)
{
Filters::ArticleFilterList list = Kernel::self()->articleFilterList();
diff --git a/akregator/src/akregator_view.cpp b/akregator/src/akregator_view.cpp
index fa8691750..a65adf39f 100644
--- a/akregator/src/akregator_view.cpp
+++ b/akregator/src/akregator_view.cpp
@@ -109,6 +109,7 @@ class View::EditNodePropertiesVisitor : public TreeNodeVisitor
{
public:
EditNodePropertiesVisitor(View* view) : m_view(view) {}
+ virtual ~EditNodePropertiesVisitor() {}
virtual bool visitTagNode(TagNode* node)
{
@@ -142,6 +143,7 @@ class View::DeleteNodeVisitor : public TreeNodeVisitor
{
public:
DeleteNodeVisitor(View* view) : m_view(view) {}
+ virtual ~DeleteNodeVisitor() {}
virtual bool visitTagNode(TagNode* node)
{
@@ -379,6 +381,13 @@ void View::slotSettingsChanged()
// if tagging is hidden, show only feed list
m_listTabWidget->setViewMode(Settings::showTaggingGUI() ? ListTabWidget::verticalTabs : ListTabWidget::single);
+ // In case text colors changed, repaint to apply changes immediately
+ if (m_articleList->isShown()) {
+ m_articleList->repaintContents();
+ }
+ if (m_feedListView->isShown()) {
+ m_feedListView->repaintContents();
+ }
}
void View::slotOnShutdown()
diff --git a/akregator/src/articlelistview.cpp b/akregator/src/articlelistview.cpp
index 96a2a050c..2324096be 100644
--- a/akregator/src/articlelistview.cpp
+++ b/akregator/src/articlelistview.cpp
@@ -178,14 +178,13 @@ void ArticleListView::ArticleItem::paintCell ( TQPainter * p, const TQColorGroup
TDEListViewItem::paintCell( p, cg, column, width, align );
else
{
- // if article status is unread or new, we change the color: FIXME: make colors configurable
TQColorGroup cg2(cg);
-
+
if (article().status() == Article::Unread)
- cg2.setColor(TQColorGroup::Text, TQt::blue);
+ cg2.setColor(TQColorGroup::Text, Settings::unreadTextColor());
else // New
- cg2.setColor(TQColorGroup::Text, TQt::red);
-
+ cg2.setColor(TQColorGroup::Text, Settings::readTextColor());
+
TDEListViewItem::paintCell( p, cg2, column, width, align );
}
diff --git a/akregator/src/configdialog.cpp b/akregator/src/configdialog.cpp
index 5a280e1cc..cf6eae4c2 100644
--- a/akregator/src/configdialog.cpp
+++ b/akregator/src/configdialog.cpp
@@ -59,7 +59,7 @@ void ConfigDialog::updateSettings()
Settings::setArchiveBackend(m_settingsAdvanced->selectedFactory());
TDEConfigDialog::updateSettings();
}
-
+
void ConfigDialog::updateWidgets()
{
m_settingsAdvanced->selectFactory(Settings::archiveBackend());
@@ -69,7 +69,7 @@ void ConfigDialog::updateWidgets()
m_settingsAppearance->lbl_MediumFontSize->setDisabled(m_config->isImmutable("MediumFontSize"));
TDEConfigDialog::updateWidgets();
}
-
+
ConfigDialog::~ConfigDialog() {}
} // namespace Akregator
diff --git a/akregator/src/settings_appearance.ui b/akregator/src/settings_appearance.ui
index 78a23de85..08be6c450 100644
--- a/akregator/src/settings_appearance.ui
+++ b/akregator/src/settings_appearance.ui
@@ -177,6 +177,38 @@
<cstring>kcfg_SansSerifFont</cstring>
</property>
</widget>
+ <widget class="TQLabel" row="4" column="0" rowspan="1" colspan="1">
+ <property name="name">
+ <cstring>lbl_ReadTextColor</cstring>
+ </property>
+ <property name="text">
+ <string>Read message color:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="4" column="1">
+ <property name="name">
+ <cstring>kcfg_ReadTextColor</cstring>
+ </property>
+ <property name="defaultColor">
+ <number>TQt::red</number>
+ </property>
+ </widget>
+ <widget class="TQLabel" row="5" column="0" rowspan="1" colspan="1">
+ <property name="name">
+ <cstring>lbl_UnreadTextColor</cstring>
+ </property>
+ <property name="text">
+ <string>Unread message color:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="5" column="1">
+ <property name="name">
+ <cstring>kcfg_UnreadTextColor</cstring>
+ </property>
+ <property name="defaultColor">
+ <number>TQt::blue</number>
+ </property>
+ </widget>
</grid>
</widget>
<widget class="TQCheckBox">
diff --git a/akregator/src/trayicon.cpp b/akregator/src/trayicon.cpp
index 240e2d5b5..9cab8b3bf 100644
--- a/akregator/src/trayicon.cpp
+++ b/akregator/src/trayicon.cpp
@@ -182,7 +182,7 @@ void TrayIcon::setUnread(int unread, bool force)
pix.fill(TQt::white);
TQPainter p(&pix);
p.setFont(f);
- p.setPen(TQt::blue);
+ p.setPen(Settings::unreadTextColor());
p.drawText(pix.rect(), TQt::AlignCenter, uStr);
pix.setMask(pix.createHeuristicMask());
@@ -206,10 +206,13 @@ void TrayIcon::viewButtonClicked()
void TrayIcon::settingsChanged()
{
- if ( Settings::showTrayIcon() )
+ if ( Settings::showTrayIcon() ) {
show();
- else
+ setUnread(m_unread, true);
+ }
+ else {
hide();
+ }
}
}
#include "trayicon.moc"
diff --git a/akregator/src/treenodeitem.cpp b/akregator/src/treenodeitem.cpp
index 4e60ea9af..eaf52cd2c 100644
--- a/akregator/src/treenodeitem.cpp
+++ b/akregator/src/treenodeitem.cpp
@@ -22,6 +22,8 @@
without including the source code for TQt in the source distribution.
*/
+#include "akregatorconfig.h"
+
#include "treenode.h"
#include "treenodeitem.h"
#include "folderitem.h"
@@ -151,7 +153,7 @@ void TreeNodeItem::paintCell( TQPainter * p, const TQColorGroup & cg,
p->drawText( x, 0, width-m-x, height(), align | AlignVCenter, oldText, -1, &br );
if ( !isSelected() )
- p->setPen( TQt::blue ); // TODO: configurable
+ p->setPen( Settings::unreadTextColor() );
p->drawText( br.right(), 0, width-m-br.right(), height(),
align | AlignVCenter, txt );