Fixed display of arrow on point details widget when no values there.

This commit is contained in:
23rd 2023-10-21 11:14:49 +03:00
parent b7a9aa9a0e
commit ec8c634e9c
2 changed files with 5 additions and 2 deletions

View File

@ -306,7 +306,8 @@ void PointDetailsWidget::setXIndex(int xIndex) {
_lines.push_back(std::move(textLine));
}
const auto clickable = _zoomEnabled && hasPositiveValues;
setAttribute(
_hasPositiveValues = hasPositiveValues;
QWidget::setAttribute(
Qt::WA_TransparentForMouseEvents,
!clickable);
invalidateCache();
@ -424,7 +425,7 @@ void PointDetailsWidget::paintEvent(QPaintEvent *e) {
line.value.draw(p, valueContext);
}
if (_zoomEnabled) {
if (_zoomEnabled && _hasPositiveValues) {
const auto s = _arrow.size() / style::DevicePixelRatio();
const auto x = rect::right(_textRect) - s.width();
const auto y = _textRect.y()

View File

@ -65,6 +65,8 @@ private:
float64 alpha = 1.;
};
bool _hasPositiveValues = true;
int _maxPercentageWidth = 0;
QRect _innerRect;