Index: ossp-pkg/as/as-gui/as_table.cpp RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_table.cpp,v rcsdiff -q -kk '-r1.22' '-r1.23' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_table.cpp,v' 2>/dev/null --- as_table.cpp 2003/02/14 19:27:03 1.22 +++ as_table.cpp 2003/02/21 10:12:02 1.23 @@ -145,6 +145,16 @@ void TiTable::paintCell(QPainter *pPainter, int nRow, int nCol, const QRect &Recto, bool bSelect, const QColorGroup &Colgroup) { QColorGroup Cgroup(Colgroup); + int nRed, nGreen, nBlue; + + nRed = m_pTiprefs->getNumber(TITRAQ_PREFLIGHTRED, TITRAQ_DEFLIGHTRED); + nGreen = m_pTiprefs->getNumber(TITRAQ_PREFLIGHTGREEN, TITRAQ_DEFLIGHTGREEN); + nBlue = m_pTiprefs->getNumber(TITRAQ_PREFLIGHTBLUE, TITRAQ_DEFLIGHTBLUE); + QColor Bright = QColor(nRed, nGreen, nBlue); + nRed = m_pTiprefs->getNumber(TITRAQ_PREFDARKRED, TITRAQ_DEFDARKRED); + nGreen = m_pTiprefs->getNumber(TITRAQ_PREFDARKGREEN, TITRAQ_DEFDARKGREEN); + nBlue = m_pTiprefs->getNumber(TITRAQ_PREFDARKBLUE, TITRAQ_DEFDARKBLUE); + QColor Dark = QColor(nRed, nGreen, nBlue); // Alternate color for nonmatching sort keys QString Cur = this->text(nRow, this->getSortcol()); @@ -158,24 +168,24 @@ // 3 Store information about which color we chose for the current row if (!Cur.isNull() && !Las.isNull() && Cur == Las) { // Set the base color conditionally if (this->text(nRow - 1, TITRAQ_IDXSTATUS).at(TITRAQ_IDXSTATCOLOR) == QChar(TITRAQ_BRIGHT)) { - Cgroup.setColor(QColorGroup::Base, QColor(248, 248, 240)); // Bright + Cgroup.setColor(QColorGroup::Base, Bright); // Bright if (this->text(nRow, TITRAQ_IDXSTATUS).at(TITRAQ_IDXSTATCOLOR) != QChar(TITRAQ_BRIGHT)) this->setText(nRow, TITRAQ_IDXSTATUS, this->text(nRow, TITRAQ_IDXSTATUS).replace(TITRAQ_IDXSTATCOLOR, sizeof(char), QChar(TITRAQ_BRIGHT))); } else { - Cgroup.setColor(QColorGroup::Base, QColor(224, 224, 216)); // Dark + Cgroup.setColor(QColorGroup::Base, Dark); // Dark if (this->text(nRow, TITRAQ_IDXSTATUS).at(TITRAQ_IDXSTATCOLOR) != QChar(TITRAQ_DARK)) this->setText(nRow, TITRAQ_IDXSTATUS, this->text(nRow, TITRAQ_IDXSTATUS).replace(TITRAQ_IDXSTATCOLOR, sizeof(char), QChar(TITRAQ_DARK))); } } else { if (this->text(nRow - 1, TITRAQ_IDXSTATUS).at(TITRAQ_IDXSTATCOLOR) == QChar(TITRAQ_BRIGHT)) { - Cgroup.setColor(QColorGroup::Base, QColor(224, 224, 216)); // Dark + Cgroup.setColor(QColorGroup::Base, Dark); // Dark if (this->text(nRow, TITRAQ_IDXSTATUS).at(TITRAQ_IDXSTATCOLOR) != QChar(TITRAQ_DARK)) this->setText(nRow, TITRAQ_IDXSTATUS, this->text(nRow, TITRAQ_IDXSTATUS).replace(TITRAQ_IDXSTATCOLOR, sizeof(char), QChar(TITRAQ_DARK))); } else { - Cgroup.setColor(QColorGroup::Base, QColor(248, 248, 240)); // Bright + Cgroup.setColor(QColorGroup::Base, Bright); // Bright if (this->text(nRow, TITRAQ_IDXSTATUS).at(TITRAQ_IDXSTATCOLOR) != QChar(TITRAQ_BRIGHT)) this->setText(nRow, TITRAQ_IDXSTATUS, this->text(nRow, TITRAQ_IDXSTATUS).replace(TITRAQ_IDXSTATCOLOR, sizeof(char), QChar(TITRAQ_BRIGHT))); } Index: ossp-pkg/as/as-gui/as_table.h RCS File: /v/ossp/cvs/ossp-pkg/as/as-gui/as_table.h,v rcsdiff -q -kk '-r1.14' '-r1.15' -u '/v/ossp/cvs/ossp-pkg/as/as-gui/as_table.h,v' 2>/dev/null --- as_table.h 2002/12/20 17:42:10 1.14 +++ as_table.h 2003/02/21 10:12:02 1.15 @@ -34,6 +34,8 @@ #include +#include "as_pref.h" + class TiTable : public QTable { @@ -43,15 +45,17 @@ int m_nSortcol; // To track current sort column int m_bSortdir; // To track current sort direction bool m_bDirt; // To track dirty and clean states + Preferences *m_pTiprefs; // To read current color values public: // Try to match QTable's default constructor with an initializer list - TiTable(QWidget *pParent = 0, const char *szName = 0) : QTable(pParent, szName) + TiTable(Preferences *pPrefs, QWidget *pParent = 0, const char *szName = 0) : QTable(pParent, szName) { this->setSortcol(0); this->setSortdir(true); this->setDirty(false); this->setEdition(); // Reset edition state + m_pTiprefs = pPrefs; horizontalHeader()->installEventFilter(this); };