mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-09-21 03:41:42 +02:00
Draw center when calibrating and remove constant
This adds the center to the calibration menu when it is nonzero. It also refactors CENTER_COLOR to be a function, similar to other colors after an earlier commit.
This commit is contained in:
parent
49e46c8aff
commit
99cf9a57fc
2 changed files with 17 additions and 4 deletions
|
@ -29,7 +29,6 @@
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const QColor CENTER_COLOR = Qt::blue;
|
|
||||||
const QColor C_STICK_GATE_COLOR = Qt::yellow;
|
const QColor C_STICK_GATE_COLOR = Qt::yellow;
|
||||||
const QColor CURSOR_TV_COLOR = 0xaed6f1;
|
const QColor CURSOR_TV_COLOR = 0xaed6f1;
|
||||||
const QColor TILT_GATE_COLOR = 0xa2d9ce;
|
const QColor TILT_GATE_COLOR = 0xa2d9ce;
|
||||||
|
@ -65,6 +64,11 @@ QColor MappingIndicator::GetAdjustedInputColor() const
|
||||||
return Qt::red;
|
return Qt::red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QColor MappingIndicator::GetCenterColor() const
|
||||||
|
{
|
||||||
|
return Qt::blue;
|
||||||
|
}
|
||||||
|
|
||||||
QColor MappingIndicator::GetDeadZoneColor() const
|
QColor MappingIndicator::GetDeadZoneColor() const
|
||||||
{
|
{
|
||||||
return palette().shadow().color();
|
return palette().shadow().color();
|
||||||
|
@ -265,7 +269,7 @@ void MappingIndicator::DrawCursor(ControllerEmu::Cursor& cursor)
|
||||||
if (center.x || center.y)
|
if (center.x || center.y)
|
||||||
{
|
{
|
||||||
p.setPen(Qt::NoPen);
|
p.setPen(Qt::NoPen);
|
||||||
p.setBrush(CENTER_COLOR);
|
p.setBrush(GetCenterColor());
|
||||||
p.drawEllipse(QPointF{center.x, center.y} * scale, INPUT_DOT_RADIUS, INPUT_DOT_RADIUS);
|
p.drawEllipse(QPointF{center.x, center.y} * scale, INPUT_DOT_RADIUS, INPUT_DOT_RADIUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,7 +367,7 @@ void MappingIndicator::DrawReshapableInput(ControllerEmu::ReshapableInput& stick
|
||||||
if (center.x || center.y)
|
if (center.x || center.y)
|
||||||
{
|
{
|
||||||
p.setPen(Qt::NoPen);
|
p.setPen(Qt::NoPen);
|
||||||
p.setBrush(CENTER_COLOR);
|
p.setBrush(GetCenterColor());
|
||||||
p.drawEllipse(QPointF{center.x, center.y} * scale, INPUT_DOT_RADIUS, INPUT_DOT_RADIUS);
|
p.drawEllipse(QPointF{center.x, center.y} * scale, INPUT_DOT_RADIUS, INPUT_DOT_RADIUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -566,7 +570,7 @@ void MappingIndicator::DrawForce(ControllerEmu::Force& force)
|
||||||
if (center.x || center.y)
|
if (center.x || center.y)
|
||||||
{
|
{
|
||||||
p.setPen(Qt::NoPen);
|
p.setPen(Qt::NoPen);
|
||||||
p.setBrush(CENTER_COLOR);
|
p.setBrush(GetCenterColor());
|
||||||
p.drawEllipse(QPointF{center.x, center.y} * scale, INPUT_DOT_RADIUS, INPUT_DOT_RADIUS);
|
p.drawEllipse(QPointF{center.x, center.y} * scale, INPUT_DOT_RADIUS, INPUT_DOT_RADIUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -711,6 +715,14 @@ void MappingIndicator::DrawCalibration(QPainter& p, Common::DVec2 point, Common:
|
||||||
[this](double angle) { return m_calibration_widget->GetCalibrationRadiusAtAngle(angle); },
|
[this](double angle) { return m_calibration_widget->GetCalibrationRadiusAtAngle(angle); },
|
||||||
scale, center));
|
scale, center));
|
||||||
|
|
||||||
|
// Center.
|
||||||
|
if (center.x || center.y)
|
||||||
|
{
|
||||||
|
p.setPen(Qt::NoPen);
|
||||||
|
p.setBrush(GetCenterColor());
|
||||||
|
p.drawEllipse(QPointF{center.x, center.y} * scale, INPUT_DOT_RADIUS, INPUT_DOT_RADIUS);
|
||||||
|
}
|
||||||
|
|
||||||
// Stick position.
|
// Stick position.
|
||||||
p.setPen(Qt::NoPen);
|
p.setPen(Qt::NoPen);
|
||||||
p.setBrush(GetAdjustedInputColor());
|
p.setBrush(GetAdjustedInputColor());
|
||||||
|
|
|
@ -40,6 +40,7 @@ protected:
|
||||||
QBrush GetBBoxBrush() const;
|
QBrush GetBBoxBrush() const;
|
||||||
QColor GetRawInputColor() const;
|
QColor GetRawInputColor() const;
|
||||||
QPen GetInputShapePen() const;
|
QPen GetInputShapePen() const;
|
||||||
|
QColor GetCenterColor() const;
|
||||||
QColor GetAdjustedInputColor() const;
|
QColor GetAdjustedInputColor() const;
|
||||||
QColor GetDeadZoneColor() const;
|
QColor GetDeadZoneColor() const;
|
||||||
QPen GetDeadZonePen() const;
|
QPen GetDeadZonePen() const;
|
||||||
|
|
Loading…
Reference in a new issue