2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 00:46:08 +00:00

Replaced statistics box with info layer widget.

This commit is contained in:
23rd
2023-10-02 18:36:25 +03:00
committed by John Preston
parent 79442fde97
commit 77d23ad182
8 changed files with 196 additions and 74 deletions

View File

@@ -265,6 +265,7 @@ ChartWidget::Footer::Footer(not_null<Ui::RpWidget*> parent)
if (s.isNull()) {
return;
}
const auto was = xPercentageLimits();
const auto w = float64(st::statisticsChartFooterSideWidth);
_width = s.width() - w;
_widthBetweenSides = s.width() - w * 2.;
@@ -272,6 +273,9 @@ ChartWidget::Footer::Footer(not_null<Ui::RpWidget*> parent)
s - QSize(0, st::statisticsChartLineWidth * 2),
st::boxRadius);
_frame = _mask;
if (_widthBetweenSides && was.max) {
setXPercentageLimits(was);
}
prepareCache(s.height());
}, lifetime());
@@ -361,9 +365,11 @@ ChartWidget::Footer::Footer(not_null<Ui::RpWidget*> parent)
Limits ChartWidget::Footer::xPercentageLimits() const {
return {
.min = _leftSide.min / _widthBetweenSides,
.max = (_rightSide.min - st::statisticsChartFooterSideWidth)
/ _widthBetweenSides,
.min = _widthBetweenSides ? _leftSide.min / _widthBetweenSides : 0.,
.max = _widthBetweenSides
? (_rightSide.min - st::statisticsChartFooterSideWidth)
/ _widthBetweenSides
: 0.,
};
}