|
|
@ -510,13 +510,31 @@ TQColor KNote::bgColor() const
|
|
|
|
|
|
|
|
|
|
|
|
void KNote::setColor( const TQColor& fg, const TQColor& bg )
|
|
|
|
void KNote::setColor( const TQColor& fg, const TQColor& bg )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_journal->setCustomProperty( "KNotes", "FgColor", fg.name() );
|
|
|
|
bool updateJournal = false;
|
|
|
|
m_journal->setCustomProperty( "KNotes", "BgColor", bg.name() );
|
|
|
|
TQString journalFg = m_journal->customProperty( "KNotes", "FgColor" );
|
|
|
|
|
|
|
|
if ( journalFg.isEmpty() || journalFg != fg.name() )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
m_journal->setCustomProperty( "KNotes", "FgColor", fg.name() );
|
|
|
|
|
|
|
|
updateJournal = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
TQString journalbg = m_journal->customProperty( "KNotes", "BgColor" );
|
|
|
|
|
|
|
|
if ( journalbg.isEmpty() || journalbg != bg.name() )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
m_journal->setCustomProperty( "KNotes", "BgColor", bg.name() );
|
|
|
|
|
|
|
|
updateJournal = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_config->setFgColor( fg );
|
|
|
|
m_config->setFgColor( fg );
|
|
|
|
m_config->setBgColor( bg );
|
|
|
|
m_config->setBgColor( bg );
|
|
|
|
|
|
|
|
|
|
|
|
m_journal->updated(); // because setCustomProperty() doesn't call it!!
|
|
|
|
if (updateJournal)
|
|
|
|
emit sigDataChanged(noteId());
|
|
|
|
{
|
|
|
|
|
|
|
|
// Only update the journal if new configuration was really used.
|
|
|
|
|
|
|
|
// This is necessary because setColor() is called also when loading a note from an .ics
|
|
|
|
|
|
|
|
// file and we do not want to inadvertantly update the last modified field each time.
|
|
|
|
|
|
|
|
m_journal->updated(); // because setCustomProperty() doesn't call it!!
|
|
|
|
|
|
|
|
emit sigDataChanged(noteId());
|
|
|
|
|
|
|
|
}
|
|
|
|
m_config->writeConfig();
|
|
|
|
m_config->writeConfig();
|
|
|
|
|
|
|
|
|
|
|
|
TQPalette newpalette = palette();
|
|
|
|
TQPalette newpalette = palette();
|
|
|
|