OSDN Git Service

use KitaConfig to set color
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Mon, 29 Dec 2003 02:58:47 +0000 (02:58 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Mon, 29 Dec 2003 02:58:47 +0000 (02:58 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@732 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/part/kitaconfig.cpp
kita/src/part/kitaconfig.h
kita/src/part/kitathreadview.cpp

index cc73c17..51a30b9 100644 (file)
@@ -21,6 +21,8 @@ KitaConfig* KitaConfig::getInstance()
 }
 
 KitaConfig::KitaConfig()
+  : m_threadColor( "black" ), m_threadBackgroundColor( "white" ),
+    m_popupColor( "black" ), m_popupBackgroundColor( "yellow" )
 {
 }
 
index fb1c7b8..7de5c43 100644 (file)
 */
 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
index f4236b1..3411463 100644 (file)
@@ -179,7 +179,14 @@ void KitaThreadView::update( const QString& result )
 
   text += "<html><head>";
   text += "</head>";
-  text += QString("<body style=\"font-size: %1pt; font-family: %2\">").arg( KitaConfig::threadFont().pointSize() ).arg( KitaConfig::font().family() );
+  text += QString("<body style=\"font-size: %1pt; "
+                  "font-family: %2; "
+                  "color: %3; "
+                  "background-color: %4\">")
+                  .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<int>( pointSize() * 0.3 ) );
-    setPaletteBackgroundColor( "yellow" );
     setWordWrap( QTextEdit::NoWrap );
     setResizePolicy( QScrollView::AutoOne );
     setFont( KitaConfig::threadFont() );
+    setPaletteForegroundColor( KitaConfig::popupColor() );
+    setPaletteBackgroundColor( KitaConfig::popupBackgroundColor() );
 }
 
 PopupTextBrowser::~ PopupTextBrowser()