From: ikemo Date: Mon, 29 Dec 2003 02:58:47 +0000 (+0000) Subject: use KitaConfig to set color X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=361ad6ed5671153c2e217a27760183a49fd8d376;p=kita%2Fkita.git use KitaConfig to set color git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@732 56b19765-1e22-0410-a548-a0f45d66c51a --- diff --git a/kita/src/part/kitaconfig.cpp b/kita/src/part/kitaconfig.cpp index cc73c17..51a30b9 100644 --- a/kita/src/part/kitaconfig.cpp +++ b/kita/src/part/kitaconfig.cpp @@ -21,6 +21,8 @@ KitaConfig* KitaConfig::getInstance() } KitaConfig::KitaConfig() + : m_threadColor( "black" ), m_threadBackgroundColor( "white" ), + m_popupColor( "black" ), m_popupBackgroundColor( "yellow" ) { } diff --git a/kita/src/part/kitaconfig.h b/kita/src/part/kitaconfig.h index fb1c7b8..7de5c43 100644 --- a/kita/src/part/kitaconfig.h +++ b/kita/src/part/kitaconfig.h @@ -20,6 +20,10 @@ */ class KitaConfig{ static KitaConfig* instance; + QColor m_threadColor; + QColor m_threadBackgroundColor; + QColor m_popupColor; + QColor m_popupBackgroundColor; QFont m_font; QFont m_threadFont; QString m_boardListURL; @@ -36,6 +40,14 @@ public: static QString& boardListURL() { return getInstance()->m_boardListURL; } static KCompletion* nameCompletion() { return &(getInstance()->m_nameCompletion); } static void addNameCompletionItem( QString& item ) { getInstance()->m_nameCompletion.addItem( item ); } + static QColor& threadColor() { return getInstance()->m_threadColor; } + static void setThreadColor( QColor color ) { getInstance()->m_threadColor = color; } + static QColor& threadBackgroundColor() { return getInstance()->m_threadBackgroundColor; } + static void setThreadBackgroundColor( QColor color ) { getInstance()->m_threadBackgroundColor = color; } + static QColor& popupColor() { return getInstance()->m_popupColor; } + static void setPopupColor( QColor color ) { getInstance()->m_popupColor = color; } + static QColor& popupBackgroundColor() { return getInstance()->m_popupBackgroundColor; } + static void setPopupBackgroundColor( QColor color ) { getInstance()->m_popupBackgroundColor = color; } }; #endif diff --git a/kita/src/part/kitathreadview.cpp b/kita/src/part/kitathreadview.cpp index f4236b1..3411463 100644 --- a/kita/src/part/kitathreadview.cpp +++ b/kita/src/part/kitathreadview.cpp @@ -179,7 +179,14 @@ void KitaThreadView::update( const QString& result ) text += ""; text += ""; - text += QString("").arg( KitaConfig::threadFont().pointSize() ).arg( KitaConfig::font().family() ); + text += QString("") + .arg( KitaConfig::threadFont().pointSize() ) + .arg( KitaConfig::font().family() ) + .arg( KitaConfig::threadColor().name() ) + .arg( KitaConfig::threadBackgroundColor().name() ); for( QStringList::iterator it = lines.begin(); it != lines.end(); ++it ) { QString line = (*it); @@ -519,10 +526,11 @@ PopupTextBrowser::PopupTextBrowser( QFrame* frame ) : QTextBrowser( frame ) { zoomOut( static_cast( pointSize() * 0.3 ) ); - setPaletteBackgroundColor( "yellow" ); setWordWrap( QTextEdit::NoWrap ); setResizePolicy( QScrollView::AutoOne ); setFont( KitaConfig::threadFont() ); + setPaletteForegroundColor( KitaConfig::popupColor() ); + setPaletteBackgroundColor( KitaConfig::popupBackgroundColor() ); } PopupTextBrowser::~ PopupTextBrowser()