- QLinearGradient gradient(0, 0, width(), 0);
- QColor rulerColor = QApplication::palette().windowText().color();
- rulerColor.setAlphaF(_hover);
+ QLinearGradient gradient(boundingRect().topLeft(), boundingRect().topRight());
+ QColor _rulerColor = QApplication::palette().windowText().color();
+ _rulerColor.setAlphaF(_hover);