mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added dummy class for stack chart view.
This commit is contained in:
parent
11b932707c
commit
b55d2008c0
5 changed files with 124 additions and 0 deletions
|
@ -1300,6 +1300,8 @@ PRIVATE
|
||||||
statistics/view/chart_view_factory.h
|
statistics/view/chart_view_factory.h
|
||||||
statistics/view/linear_chart_view.cpp
|
statistics/view/linear_chart_view.cpp
|
||||||
statistics/view/linear_chart_view.h
|
statistics/view/linear_chart_view.h
|
||||||
|
statistics/view/stack_chart_view.cpp
|
||||||
|
statistics/view/stack_chart_view.h
|
||||||
storage/details/storage_file_utilities.cpp
|
storage/details/storage_file_utilities.cpp
|
||||||
storage/details/storage_file_utilities.h
|
storage/details/storage_file_utilities.h
|
||||||
storage/details/storage_settings_scheme.cpp
|
storage/details/storage_settings_scheme.cpp
|
||||||
|
|
|
@ -16,6 +16,7 @@ struct Limits final {
|
||||||
|
|
||||||
enum class ChartViewType {
|
enum class ChartViewType {
|
||||||
Linear,
|
Linear,
|
||||||
|
Stack,
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Statistic
|
} // namespace Statistic
|
||||||
|
|
|
@ -9,6 +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"
|
||||||
|
|
||||||
namespace Statistic {
|
namespace Statistic {
|
||||||
|
|
||||||
|
@ -17,6 +18,9 @@ std::unique_ptr<AbstractChartView> CreateChartView(ChartViewType type) {
|
||||||
case ChartViewType::Linear: {
|
case ChartViewType::Linear: {
|
||||||
return std::make_unique<LinearChartView>();
|
return std::make_unique<LinearChartView>();
|
||||||
} break;
|
} break;
|
||||||
|
case ChartViewType::Stack: {
|
||||||
|
return std::make_unique<StackChartView>();
|
||||||
|
} break;
|
||||||
default: Unexpected("Type in Statistic::CreateChartView.");
|
default: Unexpected("Type in Statistic::CreateChartView.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
61
Telegram/SourceFiles/statistics/view/stack_chart_view.cpp
Normal file
61
Telegram/SourceFiles/statistics/view/stack_chart_view.cpp
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
/*
|
||||||
|
This file is part of Telegram Desktop,
|
||||||
|
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"
|
||||||
|
|
||||||
|
namespace Statistic {
|
||||||
|
namespace {
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
StackChartView::StackChartView() = default;
|
||||||
|
|
||||||
|
StackChartView::~StackChartView() = default;
|
||||||
|
|
||||||
|
void StackChartView::paint(
|
||||||
|
QPainter &p,
|
||||||
|
const Data::StatisticalChart &chartData,
|
||||||
|
const Limits &xIndices,
|
||||||
|
const Limits &xPercentageLimits,
|
||||||
|
const Limits &heightLimits,
|
||||||
|
const QRect &rect,
|
||||||
|
bool footer) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void StackChartView::paintSelectedXIndex(
|
||||||
|
QPainter &p,
|
||||||
|
const Data::StatisticalChart &chartData,
|
||||||
|
const Limits &xPercentageLimits,
|
||||||
|
const Limits &heightLimits,
|
||||||
|
const QRect &rect,
|
||||||
|
int selectedXIndex) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void StackChartView::setEnabled(int id, bool enabled, crl::time now) {
|
||||||
|
}
|
||||||
|
|
||||||
|
bool StackChartView::isFinished() const {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool StackChartView::isEnabled(int id) const {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
float64 StackChartView::alpha(int id) const {
|
||||||
|
return 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
AbstractChartView::HeightLimits StackChartView::heightLimits(
|
||||||
|
Data::StatisticalChart &chartData,
|
||||||
|
Limits xIndices) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
void StackChartView::tick(crl::time now) {
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Statistic
|
56
Telegram/SourceFiles/statistics/view/stack_chart_view.h
Normal file
56
Telegram/SourceFiles/statistics/view/stack_chart_view.h
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
/*
|
||||||
|
This file is part of Telegram Desktop,
|
||||||
|
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
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "statistics/statistics_common.h"
|
||||||
|
#include "statistics/view/abstract_chart_view.h"
|
||||||
|
|
||||||
|
namespace Data {
|
||||||
|
struct StatisticalChart;
|
||||||
|
} // namespace Data
|
||||||
|
|
||||||
|
namespace Statistic {
|
||||||
|
|
||||||
|
struct Limits;
|
||||||
|
|
||||||
|
class StackChartView final : public AbstractChartView {
|
||||||
|
public:
|
||||||
|
StackChartView();
|
||||||
|
~StackChartView() override final;
|
||||||
|
|
||||||
|
void paint(
|
||||||
|
QPainter &p,
|
||||||
|
const Data::StatisticalChart &chartData,
|
||||||
|
const Limits &xIndices,
|
||||||
|
const Limits &xPercentageLimits,
|
||||||
|
const Limits &heightLimits,
|
||||||
|
const QRect &rect,
|
||||||
|
bool footer) override;
|
||||||
|
|
||||||
|
void paintSelectedXIndex(
|
||||||
|
QPainter &p,
|
||||||
|
const Data::StatisticalChart &chartData,
|
||||||
|
const Limits &xPercentageLimits,
|
||||||
|
const Limits &heightLimits,
|
||||||
|
const QRect &rect,
|
||||||
|
int selectedXIndex) override;
|
||||||
|
|
||||||
|
void setEnabled(int id, bool enabled, crl::time now) override;
|
||||||
|
[[nodiscard]] bool isEnabled(int id) const override;
|
||||||
|
[[nodiscard]] bool isFinished() const override;
|
||||||
|
[[nodiscard]] float64 alpha(int id) const override;
|
||||||
|
|
||||||
|
[[nodiscard]] HeightLimits heightLimits(
|
||||||
|
Data::StatisticalChart &chartData,
|
||||||
|
Limits xIndices) override;
|
||||||
|
|
||||||
|
void tick(crl::time now) override;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Statistic
|
Loading…
Add table
Reference in a new issue