Add configuration options to set Akregator read and unread text colors

This resolves Bug 1696
pull/21/head
Timothy Pearson 10 years ago
parent 352bfda9b4
commit faf37227f5

@ -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" />

@ -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();

@ -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()

@ -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 );
}

@ -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

@ -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">

@ -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"

@ -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 );

Loading…
Cancel
Save