mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fixed display of arrow on point details widget when no values there.
This commit is contained in:
parent
b7a9aa9a0e
commit
ec8c634e9c
2 changed files with 5 additions and 2 deletions
|
@ -306,7 +306,8 @@ void PointDetailsWidget::setXIndex(int xIndex) {
|
||||||
_lines.push_back(std::move(textLine));
|
_lines.push_back(std::move(textLine));
|
||||||
}
|
}
|
||||||
const auto clickable = _zoomEnabled && hasPositiveValues;
|
const auto clickable = _zoomEnabled && hasPositiveValues;
|
||||||
setAttribute(
|
_hasPositiveValues = hasPositiveValues;
|
||||||
|
QWidget::setAttribute(
|
||||||
Qt::WA_TransparentForMouseEvents,
|
Qt::WA_TransparentForMouseEvents,
|
||||||
!clickable);
|
!clickable);
|
||||||
invalidateCache();
|
invalidateCache();
|
||||||
|
@ -424,7 +425,7 @@ void PointDetailsWidget::paintEvent(QPaintEvent *e) {
|
||||||
line.value.draw(p, valueContext);
|
line.value.draw(p, valueContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_zoomEnabled) {
|
if (_zoomEnabled && _hasPositiveValues) {
|
||||||
const auto s = _arrow.size() / style::DevicePixelRatio();
|
const auto s = _arrow.size() / style::DevicePixelRatio();
|
||||||
const auto x = rect::right(_textRect) - s.width();
|
const auto x = rect::right(_textRect) - s.width();
|
||||||
const auto y = _textRect.y()
|
const auto y = _textRect.y()
|
||||||
|
|
|
@ -65,6 +65,8 @@ private:
|
||||||
float64 alpha = 1.;
|
float64 alpha = 1.;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool _hasPositiveValues = true;
|
||||||
|
|
||||||
int _maxPercentageWidth = 0;
|
int _maxPercentageWidth = 0;
|
||||||
|
|
||||||
QRect _innerRect;
|
QRect _innerRect;
|
||||||
|
|
Loading…
Add table
Reference in a new issue