mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 15:43:55 +02:00
Removed useless processing for changing drag direction.
This commit is contained in:
parent
c5684e768a
commit
ce3ad95950
1 changed files with 0 additions and 31 deletions
|
@ -83,7 +83,6 @@ public:
|
||||||
|
|
||||||
[[nodiscard]] rpl::producer<Limits> xPercentageLimitsChange() const;
|
[[nodiscard]] rpl::producer<Limits> xPercentageLimitsChange() const;
|
||||||
[[nodiscard]] rpl::producer<> userInteractionFinished() const;
|
[[nodiscard]] rpl::producer<> userInteractionFinished() const;
|
||||||
[[nodiscard]] rpl::producer<> directionChanges() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
not_null<Ui::AbstractButton*> _left;
|
not_null<Ui::AbstractButton*> _left;
|
||||||
|
@ -91,7 +90,6 @@ private:
|
||||||
|
|
||||||
rpl::event_stream<Limits> _xPercentageLimitsChange;
|
rpl::event_stream<Limits> _xPercentageLimitsChange;
|
||||||
rpl::event_stream<> _userInteractionFinished;
|
rpl::event_stream<> _userInteractionFinished;
|
||||||
rpl::event_stream<> _directionChanges;
|
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
int x = 0;
|
int x = 0;
|
||||||
|
@ -140,8 +138,6 @@ ChartWidget::Footer::Footer(not_null<Ui::RpWidget*> parent)
|
||||||
const auto pos = static_cast<QMouseEvent*>(e.get())->pos();
|
const auto pos = static_cast<QMouseEvent*>(e.get())->pos();
|
||||||
switch (e->type()) {
|
switch (e->type()) {
|
||||||
case QEvent::MouseMove: {
|
case QEvent::MouseMove: {
|
||||||
const auto nowDiffXDirection = (pos.x() - _start.x) < 0;
|
|
||||||
const auto wasDiffXDirection = _start.diffX < 0;
|
|
||||||
if (base::IsCtrlPressed()) {
|
if (base::IsCtrlPressed()) {
|
||||||
const auto diff = (pos.x() - _start.x);
|
const auto diff = (pos.x() - _start.x);
|
||||||
_left->move(_left->x() + diff, side->y());
|
_left->move(_left->x() + diff, side->y());
|
||||||
|
@ -158,9 +154,6 @@ ChartWidget::Footer::Footer(not_null<Ui::RpWidget*> parent)
|
||||||
.min = _left->x() / float64(width()),
|
.min = _left->x() / float64(width()),
|
||||||
.max = rect::right(_right) / float64(width()),
|
.max = rect::right(_right) / float64(width()),
|
||||||
});
|
});
|
||||||
if (nowDiffXDirection != wasDiffXDirection) {
|
|
||||||
_directionChanges.fire({});
|
|
||||||
}
|
|
||||||
} break;
|
} break;
|
||||||
case QEvent::MouseButtonPress: {
|
case QEvent::MouseButtonPress: {
|
||||||
_start.x = pos.x();
|
_start.x = pos.x();
|
||||||
|
@ -196,10 +189,6 @@ rpl::producer<> ChartWidget::Footer::userInteractionFinished() const {
|
||||||
return _userInteractionFinished.events();
|
return _userInteractionFinished.events();
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<> ChartWidget::Footer::directionChanges() const {
|
|
||||||
return _directionChanges.events();
|
|
||||||
}
|
|
||||||
|
|
||||||
ChartWidget::ChartAnimationController::ChartAnimationController(
|
ChartWidget::ChartAnimationController::ChartAnimationController(
|
||||||
Fn<void()> &&updateCallback)
|
Fn<void()> &&updateCallback)
|
||||||
: _animation(std::move(updateCallback)) {
|
: _animation(std::move(updateCallback)) {
|
||||||
|
@ -419,26 +408,6 @@ ChartWidget::ChartWidget(not_null<Ui::RpWidget*> parent)
|
||||||
_animationController.start();
|
_animationController.start();
|
||||||
}, _footer->lifetime());
|
}, _footer->lifetime());
|
||||||
|
|
||||||
_footer->directionChanges(
|
|
||||||
) | rpl::start_with_next([=] {
|
|
||||||
// _xPercentage.yAnimationStartedAt = crl::now();
|
|
||||||
// _xPercentage.animValueYAlpha = anim::value(0., 1.);
|
|
||||||
|
|
||||||
// {
|
|
||||||
// const auto startXIndex = _chartData.findStartIndex(
|
|
||||||
// _xPercentage.now.min);
|
|
||||||
// const auto endXIndex = _chartData.findEndIndex(
|
|
||||||
// startXIndex,
|
|
||||||
// _xPercentage.now.max);
|
|
||||||
// addHorizontalLine(
|
|
||||||
// {
|
|
||||||
// float64(FindMinValue(_chartData, startXIndex, endXIndex)),
|
|
||||||
// float64(FindMaxValue(_chartData, startXIndex, endXIndex)),
|
|
||||||
// },
|
|
||||||
// true);
|
|
||||||
// }
|
|
||||||
}, _footer->lifetime());
|
|
||||||
|
|
||||||
_footer->xPercentageLimitsChange(
|
_footer->xPercentageLimitsChange(
|
||||||
) | rpl::start_with_next([=](Limits xPercentageLimits) {
|
) | rpl::start_with_next([=](Limits xPercentageLimits) {
|
||||||
const auto now = crl::now();
|
const auto now = crl::now();
|
||||||
|
|
Loading…
Add table
Reference in a new issue