2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Improved header style for charts.

This commit is contained in:
23rd
2023-10-02 21:30:42 +03:00
committed by John Preston
parent 77d23ad182
commit 2b282c8d7d
5 changed files with 36 additions and 27 deletions

View File

@@ -861,18 +861,20 @@ int ChartWidget::resizeGetHeight(int newWidth) {
? (_filterButtons->height()
+ st::statisticsFilterButtonsPadding.bottom())
: 0;
const auto resultHeight = st::statisticsChartHeaderHeight
const auto &headerPadding = st::statisticsChartHeaderPadding;
{
_header->moveToLeft(headerPadding.left(), headerPadding.top());
_header->resizeToWidth(newWidth - rect::m::sum::h(headerPadding));
}
const auto headerHeight = rect::m::sum::v(headerPadding)
+ _header->height();
const auto resultHeight = headerHeight
+ st::statisticsChartHeight
+ st::statisticsChartFooterHeight
+ st::statisticsChartFooterSkip
+ filtersTopSkip
+ filtersHeight;
{
_header->setGeometry(
0,
0,
newWidth,
st::statisticsChartHeaderHeight);
_footer->setGeometry(
0,
resultHeight
@@ -886,9 +888,10 @@ int ChartWidget::resizeGetHeight(int newWidth) {
}
_chartArea->setGeometry(
0,
st::statisticsChartHeaderHeight,
headerHeight,
newWidth,
resultHeight
- headerHeight
- st::statisticsChartFooterHeight
- filtersTopSkip
- filtersHeight
@@ -1490,7 +1493,8 @@ void ChartWidget::setZoomedChartData(
Ui::Animations::ShowWidgets({ _zoomedChartWidget.get(), customHeader });
Ui::Animations::HideWidgets({ this });
customHeader->setGeometry(0, 0, width(), st::statisticsChartHeaderHeight);
customHeader->moveToLeft(0, 0);
customHeader->resizeToWidth(width());
zoomOutButton->moveToLeft(0, 0);
}