ToastFreeware
/
toast
/
confclerk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a4ed73e
)
First try to improve the colors (ticket #13).
author
Philipp Spitzer
<philipp@spitzer.priv.at>
Wed, 13 Jul 2011 21:18:58 +0000
(21:18 +0000)
committer
Philipp Spitzer
<philipp@spitzer.priv.at>
Wed, 13 Jul 2011 21:18:58 +0000
(21:18 +0000)
src/mvc/delegate.cpp
patch
|
blob
|
history
diff --git
a/src/mvc/delegate.cpp
b/src/mvc/delegate.cpp
index 9d4c8dfc346510cd438d204c8bb89b0a9238417f..a733b5e343e67d15f26f919df290073fb970d3be 100644
(file)
--- a/
src/mvc/delegate.cpp
+++ b/
src/mvc/delegate.cpp
@@
-55,14
+55,15
@@
void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, cons
return;
painter->save();
return;
painter->save();
- QColor bkgrColor =
Qt::cyan
;
+ QColor bkgrColor =
option.palette.color(QPalette::Background)
;
//QColor bkgrColor = QColor(0xAA,0xAA,0xAA);
QColor conflictColor = Qt::yellow;
//QColor bkgrColor = QColor(0xAA,0xAA,0xAA);
QColor conflictColor = Qt::yellow;
- QPen borderPen(bkgrColor.darker());
+ QColor textColor = option.palette.color(QPalette::Text);
+ QPen borderPen(textColor);
if(hasParent(index))
{
if(hasParent(index))
{
- // entry hori
s
ontal layout:
+ // entry hori
z
ontal layout:
// * spacer (aka y position of image)
// * image
// * rest is text, which is 1 line of title with big letters and 2 lines of Presenter and Track
// * spacer (aka y position of image)
// * image
// * rest is text, which is 1 line of title with big letters and 2 lines of Presenter and Track
@@
-95,11
+96,8
@@
void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, cons
bkgrColor = conflictColor;
QLinearGradient itemGradient(option.rect.topLeft(), option.rect.bottomLeft());
bkgrColor = conflictColor;
QLinearGradient itemGradient(option.rect.topLeft(), option.rect.bottomLeft());
- itemGradient.setColorAt(0.0, Qt::white);
- itemGradient.setColorAt(0.25, bkgrColor);
- itemGradient.setColorAt(0.5, bkgrColor);
- itemGradient.setColorAt(0.75, bkgrColor);
- itemGradient.setColorAt(1.0, Qt::white);
+ itemGradient.setColorAt(0.0, bkgrColor);
+ itemGradient.setColorAt(1.0, bkgrColor);
if(isLast(index))
{
if(isLast(index))
{
@@
-203,9
+201,9
@@
void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, cons
int spacer = (fmSmall.boundingRect("999").width() < SPACER) ? SPACER : fmSmall.boundingRect("999").width();
QLinearGradient titleGradient(option.rect.topLeft(), option.rect.topRight());
int spacer = (fmSmall.boundingRect("999").width() < SPACER) ? SPACER : fmSmall.boundingRect("999").width();
QLinearGradient titleGradient(option.rect.topLeft(), option.rect.topRight());
- //titleGradient.setColorAt(0.0, Qt::white);
+ bkgrColor = option.palette.color(QPalette::Highlight);
+ textColor = option.palette.color(QPalette::HighlightedText);
titleGradient.setColorAt(0.0, bkgrColor);
titleGradient.setColorAt(0.0, bkgrColor);
- titleGradient.setColorAt(0.5, Qt::white);
titleGradient.setColorAt(1.0, bkgrColor);
QPainterPath titlePath;
titleGradient.setColorAt(1.0, bkgrColor);
QPainterPath titlePath;
@@
-236,7
+234,9
@@
void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, cons
painter->setPen(borderPen);
painter->drawPath(titlePath);
painter->setPen(borderPen);
painter->drawPath(titlePath);
- // draw icons
+ // draw icons
+ borderPen.setColor(textColor);
+ painter->setPen(borderPen);
painter->setFont(fontSmall);
QImage *image = mControls[FavouriteControlOn]->image();
QPoint drawPoint =
painter->setFont(fontSmall);
QImage *image = mControls[FavouriteControlOn]->image();
QPoint drawPoint =