Fix calendar colors

.. broke in last commit
This commit is contained in:
Mark Liversedge
2014-06-06 16:26:27 +01:00
parent e5ee0c75a8
commit 14137b668d
3 changed files with 6 additions and 3 deletions

View File

@@ -202,7 +202,7 @@ GcLabel::paintEvent(QPaintEvent *)
if (filtered && !selected && !underMouse()) painter.setPen(GColor(CCALCURRENT));
else {
if (GCColor::isFlat()) {
if (isChrome && GCColor::isFlat()) {
if (GCColor::luminance(GColor(CCHROME)) < 127)
painter.setPen(QColor(Qt::white));

View File

@@ -43,9 +43,11 @@ class GcLabel : public QLabel
int xoff, yoff;
bool bg, selected, filtered; // bg = highlighted, selected = user selected too
bool highlighted; // highlighed uses highlighter color overlay when painting
QColor bgColor;
bool isChrome;
public:
GcLabel(const QString & text, QWidget * parent = 0) : QLabel(text, parent), xoff(0), yoff(0), bg(false), selected(false), filtered(false), highlighted(false), bgColor(Qt::lightGray) {}
GcLabel(const QString & text, QWidget * parent = 0) : QLabel(text, parent), xoff(0), yoff(0), bg(false), selected(false), filtered(false), highlighted(false), bgColor(Qt::lightGray), isChrome(false) {}
~GcLabel(){}
signals:
@@ -54,6 +56,7 @@ signals:
public slots:
void setYOff(int x) { yoff = x; }
void setXOff(int x) { xoff = x; }
void setChrome(bool x) { isChrome = x; }
void setBg(bool x) { bg = x; }
bool getBg() { return bg; }
void setBgColor(QColor bg) { bgColor = bg; }
@@ -67,7 +70,6 @@ protected:
emit clicked();
}
void paintEvent(QPaintEvent *);
QColor bgColor;
};
class GcMiniCalendar : public QWidget

View File

@@ -283,6 +283,7 @@ GcSplitterHandle::init(QString title, Qt::Orientation orientation,
titleLabel = new GcLabel(title, this);
titleLabel->setXOff(0);
titleLabel->setChrome(true);
QFont font;
#ifdef Q_OS_MAC