mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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:
|
For license and copyright information please follow this link:
|
||||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
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 "data/data_statistics_chart.h"
|
||||||
#include "statistics/chart_lines_filter_controller.h"
|
#include "statistics/chart_lines_filter_controller.h"
|
||||||
|
@ -15,10 +15,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
namespace Statistic {
|
namespace Statistic {
|
||||||
|
|
||||||
StackChartView::StackChartView() = default;
|
BarChartView::BarChartView() = default;
|
||||||
StackChartView::~StackChartView() = 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);
|
constexpr auto kOffset = float64(2);
|
||||||
_lastPaintedXIndices = {
|
_lastPaintedXIndices = {
|
||||||
float64(std::max(0., c.xIndices.min - kOffset)),
|
float64(std::max(0., c.xIndices.min - kOffset)),
|
||||||
|
@ -27,10 +27,10 @@ void StackChartView::paint(QPainter &p, const PaintContext &c) {
|
||||||
c.xIndices.max + kOffset)),
|
c.xIndices.max + kOffset)),
|
||||||
};
|
};
|
||||||
|
|
||||||
StackChartView::paintChartAndSelected(p, c);
|
BarChartView::paintChartAndSelected(p, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StackChartView::paintChartAndSelected(
|
void BarChartView::paintChartAndSelected(
|
||||||
QPainter &p,
|
QPainter &p,
|
||||||
const PaintContext &c) {
|
const PaintContext &c) {
|
||||||
const auto &[localStart, localEnd] = _lastPaintedXIndices;
|
const auto &[localStart, localEnd] = _lastPaintedXIndices;
|
||||||
|
@ -105,7 +105,7 @@ void StackChartView::paintChartAndSelected(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void StackChartView::paintSelectedXIndex(
|
void BarChartView::paintSelectedXIndex(
|
||||||
QPainter &p,
|
QPainter &p,
|
||||||
const PaintContext &c,
|
const PaintContext &c,
|
||||||
int selectedXIndex,
|
int selectedXIndex,
|
||||||
|
@ -114,11 +114,11 @@ void StackChartView::paintSelectedXIndex(
|
||||||
_lastSelectedXIndex = selectedXIndex;
|
_lastSelectedXIndex = selectedXIndex;
|
||||||
_lastSelectedXProgress = progress;
|
_lastSelectedXProgress = progress;
|
||||||
if ((_lastSelectedXIndex >= 0) || (was >= 0)) {
|
if ((_lastSelectedXIndex >= 0) || (was >= 0)) {
|
||||||
StackChartView::paintChartAndSelected(p, c);
|
BarChartView::paintChartAndSelected(p, c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int StackChartView::findXIndexByPosition(
|
int BarChartView::findXIndexByPosition(
|
||||||
const Data::StatisticalChart &chartData,
|
const Data::StatisticalChart &chartData,
|
||||||
const Limits &xPercentageLimits,
|
const Limits &xPercentageLimits,
|
||||||
const QRect &rect,
|
const QRect &rect,
|
||||||
|
@ -144,7 +144,7 @@ int StackChartView::findXIndexByPosition(
|
||||||
return _lastSelectedXIndex = -1;
|
return _lastSelectedXIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractChartView::HeightLimits StackChartView::heightLimits(
|
AbstractChartView::HeightLimits BarChartView::heightLimits(
|
||||||
Data::StatisticalChart &chartData,
|
Data::StatisticalChart &chartData,
|
||||||
Limits xIndices) {
|
Limits xIndices) {
|
||||||
_cachedHeightLimits = {};
|
_cachedHeightLimits = {};
|
|
@ -20,10 +20,10 @@ namespace Statistic {
|
||||||
|
|
||||||
struct Limits;
|
struct Limits;
|
||||||
|
|
||||||
class StackChartView final : public AbstractChartView {
|
class BarChartView final : public AbstractChartView {
|
||||||
public:
|
public:
|
||||||
StackChartView();
|
BarChartView();
|
||||||
~StackChartView() override final;
|
~BarChartView() override final;
|
||||||
|
|
||||||
void paint(QPainter &p, const PaintContext &c) override;
|
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/statistics_common.h"
|
||||||
#include "statistics/view/linear_chart_view.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"
|
#include "statistics/view/stack_linear_chart_view.h"
|
||||||
|
|
||||||
namespace Statistic {
|
namespace Statistic {
|
||||||
|
@ -20,7 +20,7 @@ std::unique_ptr<AbstractChartView> CreateChartView(ChartViewType type) {
|
||||||
return std::make_unique<LinearChartView>(false);
|
return std::make_unique<LinearChartView>(false);
|
||||||
} break;
|
} break;
|
||||||
case ChartViewType::Stack: {
|
case ChartViewType::Stack: {
|
||||||
return std::make_unique<StackChartView>();
|
return std::make_unique<BarChartView>();
|
||||||
} break;
|
} break;
|
||||||
case ChartViewType::DoubleLinear: {
|
case ChartViewType::DoubleLinear: {
|
||||||
return std::make_unique<LinearChartView>(true);
|
return std::make_unique<LinearChartView>(true);
|
||||||
|
|
|
@ -185,6 +185,8 @@ PRIVATE
|
||||||
statistics/statistics_data_deserialize.h
|
statistics/statistics_data_deserialize.h
|
||||||
statistics/view/abstract_chart_view.cpp
|
statistics/view/abstract_chart_view.cpp
|
||||||
statistics/view/abstract_chart_view.h
|
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.cpp
|
||||||
statistics/view/chart_rulers_view.h
|
statistics/view/chart_rulers_view.h
|
||||||
statistics/view/chart_view_factory.cpp
|
statistics/view/chart_view_factory.cpp
|
||||||
|
@ -193,8 +195,6 @@ PRIVATE
|
||||||
statistics/view/linear_chart_view.h
|
statistics/view/linear_chart_view.h
|
||||||
statistics/view/stack_chart_common.cpp
|
statistics/view/stack_chart_common.cpp
|
||||||
statistics/view/stack_chart_common.h
|
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.cpp
|
||||||
statistics/view/stack_linear_chart_common.h
|
statistics/view/stack_linear_chart_common.h
|
||||||
statistics/view/stack_linear_chart_view.cpp
|
statistics/view/stack_linear_chart_view.cpp
|
||||||
|
|
Loading…
Add table
Reference in a new issue