mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Renamed StackChartView to BarChartView.
This commit is contained in:
parent
c3254a53bc
commit
b7346c203a
4 changed files with 17 additions and 17 deletions
|
@ -5,7 +5,7 @@ the official desktop application for the Telegram messaging service.
|
|||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "statistics/view/stack_chart_view.h"
|
||||
#include "statistics/view/bar_chart_view.h"
|
||||
|
||||
#include "data/data_statistics_chart.h"
|
||||
#include "statistics/chart_lines_filter_controller.h"
|
||||
|
@ -15,10 +15,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
namespace Statistic {
|
||||
|
||||
StackChartView::StackChartView() = default;
|
||||
StackChartView::~StackChartView() = default;
|
||||
BarChartView::BarChartView() = default;
|
||||
BarChartView::~BarChartView() = default;
|
||||
|
||||
void StackChartView::paint(QPainter &p, const PaintContext &c) {
|
||||
void BarChartView::paint(QPainter &p, const PaintContext &c) {
|
||||
constexpr auto kOffset = float64(2);
|
||||
_lastPaintedXIndices = {
|
||||
float64(std::max(0., c.xIndices.min - kOffset)),
|
||||
|
@ -27,10 +27,10 @@ void StackChartView::paint(QPainter &p, const PaintContext &c) {
|
|||
c.xIndices.max + kOffset)),
|
||||
};
|
||||
|
||||
StackChartView::paintChartAndSelected(p, c);
|
||||
BarChartView::paintChartAndSelected(p, c);
|
||||
}
|
||||
|
||||
void StackChartView::paintChartAndSelected(
|
||||
void BarChartView::paintChartAndSelected(
|
||||
QPainter &p,
|
||||
const PaintContext &c) {
|
||||
const auto &[localStart, localEnd] = _lastPaintedXIndices;
|
||||
|
@ -105,7 +105,7 @@ void StackChartView::paintChartAndSelected(
|
|||
}
|
||||
}
|
||||
|
||||
void StackChartView::paintSelectedXIndex(
|
||||
void BarChartView::paintSelectedXIndex(
|
||||
QPainter &p,
|
||||
const PaintContext &c,
|
||||
int selectedXIndex,
|
||||
|
@ -114,11 +114,11 @@ void StackChartView::paintSelectedXIndex(
|
|||
_lastSelectedXIndex = selectedXIndex;
|
||||
_lastSelectedXProgress = progress;
|
||||
if ((_lastSelectedXIndex >= 0) || (was >= 0)) {
|
||||
StackChartView::paintChartAndSelected(p, c);
|
||||
BarChartView::paintChartAndSelected(p, c);
|
||||
}
|
||||
}
|
||||
|
||||
int StackChartView::findXIndexByPosition(
|
||||
int BarChartView::findXIndexByPosition(
|
||||
const Data::StatisticalChart &chartData,
|
||||
const Limits &xPercentageLimits,
|
||||
const QRect &rect,
|
||||
|
@ -144,7 +144,7 @@ int StackChartView::findXIndexByPosition(
|
|||
return _lastSelectedXIndex = -1;
|
||||
}
|
||||
|
||||
AbstractChartView::HeightLimits StackChartView::heightLimits(
|
||||
AbstractChartView::HeightLimits BarChartView::heightLimits(
|
||||
Data::StatisticalChart &chartData,
|
||||
Limits xIndices) {
|
||||
_cachedHeightLimits = {};
|
|
@ -20,10 +20,10 @@ namespace Statistic {
|
|||
|
||||
struct Limits;
|
||||
|
||||
class StackChartView final : public AbstractChartView {
|
||||
class BarChartView final : public AbstractChartView {
|
||||
public:
|
||||
StackChartView();
|
||||
~StackChartView() override final;
|
||||
BarChartView();
|
||||
~BarChartView() override final;
|
||||
|
||||
void paint(QPainter &p, const PaintContext &c) override;
|
||||
|
|
@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "statistics/statistics_common.h"
|
||||
#include "statistics/view/linear_chart_view.h"
|
||||
#include "statistics/view/stack_chart_view.h"
|
||||
#include "statistics/view/bar_chart_view.h"
|
||||
#include "statistics/view/stack_linear_chart_view.h"
|
||||
|
||||
namespace Statistic {
|
||||
|
@ -20,7 +20,7 @@ std::unique_ptr<AbstractChartView> CreateChartView(ChartViewType type) {
|
|||
return std::make_unique<LinearChartView>(false);
|
||||
} break;
|
||||
case ChartViewType::Stack: {
|
||||
return std::make_unique<StackChartView>();
|
||||
return std::make_unique<BarChartView>();
|
||||
} break;
|
||||
case ChartViewType::DoubleLinear: {
|
||||
return std::make_unique<LinearChartView>(true);
|
||||
|
|
|
@ -185,6 +185,8 @@ PRIVATE
|
|||
statistics/statistics_data_deserialize.h
|
||||
statistics/view/abstract_chart_view.cpp
|
||||
statistics/view/abstract_chart_view.h
|
||||
statistics/view/bar_chart_view.cpp
|
||||
statistics/view/bar_chart_view.h
|
||||
statistics/view/chart_rulers_view.cpp
|
||||
statistics/view/chart_rulers_view.h
|
||||
statistics/view/chart_view_factory.cpp
|
||||
|
@ -193,8 +195,6 @@ PRIVATE
|
|||
statistics/view/linear_chart_view.h
|
||||
statistics/view/stack_chart_common.cpp
|
||||
statistics/view/stack_chart_common.h
|
||||
statistics/view/stack_chart_view.cpp
|
||||
statistics/view/stack_chart_view.h
|
||||
statistics/view/stack_linear_chart_common.cpp
|
||||
statistics/view/stack_linear_chart_common.h
|
||||
statistics/view/stack_linear_chart_view.cpp
|
||||
|
|
Loading…
Add table
Reference in a new issue