mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-04 15:19:09 +00:00
Qt/MappingButton: Don't show ticks
This commit is contained in:
parent
2a3c075330
commit
386accd2c8
1 changed files with 7 additions and 5 deletions
|
@ -34,9 +34,11 @@
|
||||||
constexpr int SLIDER_TICK_COUNT = 100;
|
constexpr int SLIDER_TICK_COUNT = 100;
|
||||||
constexpr int VERTICAL_PADDING = 2;
|
constexpr int VERTICAL_PADDING = 2;
|
||||||
|
|
||||||
static QString EscapeAmpersand(QString&& string)
|
// Escape ampersands and remove ticks
|
||||||
|
static QString ToDisplayString(QString&& string)
|
||||||
{
|
{
|
||||||
return string.replace(QStringLiteral("&"), QStringLiteral("&&"));
|
return string.replace(QStringLiteral("&"), QStringLiteral("&&"))
|
||||||
|
.replace(QStringLiteral("`"), QStringLiteral(""));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MappingButton::IsInput() const
|
bool MappingButton::IsInput() const
|
||||||
|
@ -45,7 +47,7 @@ bool MappingButton::IsInput() const
|
||||||
}
|
}
|
||||||
|
|
||||||
MappingButton::MappingButton(MappingWidget* widget, ControlReference* ref, bool indicator)
|
MappingButton::MappingButton(MappingWidget* widget, ControlReference* ref, bool indicator)
|
||||||
: ElidedButton(EscapeAmpersand(QString::fromStdString(ref->GetExpression()))), m_parent(widget),
|
: ElidedButton(ToDisplayString(QString::fromStdString(ref->GetExpression()))), m_parent(widget),
|
||||||
m_reference(ref)
|
m_reference(ref)
|
||||||
{
|
{
|
||||||
// Force all mapping buttons to use stay at a minimal height
|
// Force all mapping buttons to use stay at a minimal height
|
||||||
|
@ -196,7 +198,7 @@ void MappingButton::Detect()
|
||||||
|
|
||||||
void MappingButton::OnButtonTimeout()
|
void MappingButton::OnButtonTimeout()
|
||||||
{
|
{
|
||||||
setText(EscapeAmpersand(QString::fromStdString(m_reference->GetExpression())));
|
setText(ToDisplayString(QString::fromStdString(m_reference->GetExpression())));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MappingButton::Clear()
|
void MappingButton::Clear()
|
||||||
|
@ -212,7 +214,7 @@ void MappingButton::Update()
|
||||||
const auto lock = ControllerEmu::EmulatedController::GetStateLock();
|
const auto lock = ControllerEmu::EmulatedController::GetStateLock();
|
||||||
m_reference->UpdateReference(g_controller_interface,
|
m_reference->UpdateReference(g_controller_interface,
|
||||||
m_parent->GetController()->GetDefaultDevice());
|
m_parent->GetController()->GetDefaultDevice());
|
||||||
setText(EscapeAmpersand(QString::fromStdString(m_reference->GetExpression())));
|
setText(ToDisplayString(QString::fromStdString(m_reference->GetExpression())));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MappingButton::mouseReleaseEvent(QMouseEvent* event)
|
void MappingButton::mouseReleaseEvent(QMouseEvent* event)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue