Project

General

Profile

columnhandleitem.diff

admin, 08/31/2008 06:09 PM

View differences:

src/qtui/columnhandleitem.cpp
36 36
    _moving(false),
37 37
    _minXPos(0),
38 38
    _maxXPos(0),
39
    _timeLine(150)
39
    _timeLine(350),
40
    _rulerColor(QApplication::palette().windowText().color())
40 41
{
41 42
  setAcceptsHoverEvents(true);
42 43
  setZValue(10);
44
  // Over 350 ms, the default update interval (40) only gives us nine frame, it looks a bit blocky.  20ms = 18frames, much smoother
45
  _timeLine.setUpdateInterval(20);
43 46
  setCursor(QCursor(Qt::OpenHandCursor));
44 47

  
45 48
  connect(&_timeLine, SIGNAL(valueChanged(qreal)), this, SLOT(hoverChanged(qreal)));
......
122 125
  Q_UNUSED(widget);
123 126

  
124 127
  QLinearGradient gradient(boundingRect().topLeft(), boundingRect().topRight());
125
  QColor rulerColor = QApplication::palette().windowText().color();
126
  rulerColor.setAlphaF(_hover);
128
  _rulerColor.setAlphaF(_hover);
127 129
  gradient.setColorAt(0, Qt::transparent);
128
  gradient.setColorAt(0.4, rulerColor);
129
  gradient.setColorAt(0.6, rulerColor);
130
  gradient.setColorAt(0.4, _rulerColor);
131
  gradient.setColorAt(0.6, _rulerColor);
130 132
  gradient.setColorAt(1, Qt::transparent);
131 133
  painter->fillRect(boundingRect(), gradient);
132 134
}
src/qtui/columnhandleitem.h
24 24
#include <QObject>
25 25
#include <QGraphicsItem>
26 26
#include <QGraphicsScene>
27
#include <QColor>
27 28
#include <QTimeLine>
28 29

  
29 30
class ColumnHandleItem : public QObject, public QGraphicsItem {
......
57 58
    void hoverChanged(qreal value);
58 59

  
59 60
  private:
61
    QColor _rulerColor;
60 62
    qreal _width;
61 63
    qreal _hover;
62 64
    bool _moving;