- QLinearGradient gradient(0, 0, width(), 0);
- gradient.setColorAt(0.25, Qt::transparent);
- gradient.setColorAt(0.5, QColor(0, 0, 0, _hover * 200));
- gradient.setColorAt(0.75, Qt::transparent);
+ QLinearGradient gradient(boundingRect().topLeft(), boundingRect().topRight());
+ QColor _rulerColor = QApplication::palette().windowText().color();
+ _rulerColor.setAlphaF(_hover);
+ gradient.setColorAt(0, Qt::transparent);
+ gradient.setColorAt(0.4, _rulerColor);
+ gradient.setColorAt(0.6, _rulerColor);
+ gradient.setColorAt(1, Qt::transparent);