mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-31 10:01:26 +02:00
DolphinQt: Remove MappingButton bold/italic text indication.
This commit is contained in:
parent
d8cf835f07
commit
ae72a781d4
@ -72,7 +72,7 @@ bool MappingButton::IsInput() const
|
|||||||
return m_reference->IsInput();
|
return m_reference->IsInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
MappingButton::MappingButton(MappingWidget* parent, ControlReference* ref, bool indicator)
|
MappingButton::MappingButton(MappingWidget* parent, ControlReference* ref)
|
||||||
: ElidedButton(RefToDisplayString(ref)), m_mapping_window(parent->GetParent()), m_reference(ref)
|
: ElidedButton(RefToDisplayString(ref)), m_mapping_window(parent->GetParent()), m_reference(ref)
|
||||||
{
|
{
|
||||||
if (IsInput())
|
if (IsInput())
|
||||||
@ -87,9 +87,6 @@ MappingButton::MappingButton(MappingWidget* parent, ControlReference* ref, bool
|
|||||||
|
|
||||||
connect(this, &MappingButton::clicked, this, &MappingButton::Clicked);
|
connect(this, &MappingButton::clicked, this, &MappingButton::Clicked);
|
||||||
|
|
||||||
if (indicator)
|
|
||||||
connect(parent, &MappingWidget::Update, this, &MappingButton::UpdateIndicator);
|
|
||||||
|
|
||||||
connect(parent, &MappingWidget::ConfigChanged, this, &MappingButton::ConfigChanged);
|
connect(parent, &MappingWidget::ConfigChanged, this, &MappingButton::ConfigChanged);
|
||||||
connect(this, &MappingButton::ConfigChanged, [this] {
|
connect(this, &MappingButton::ConfigChanged, [this] {
|
||||||
setText(RefToDisplayString(m_reference));
|
setText(RefToDisplayString(m_reference));
|
||||||
@ -134,21 +131,6 @@ void MappingButton::Clear()
|
|||||||
m_mapping_window->UnQueueInputDetection(this);
|
m_mapping_window->UnQueueInputDetection(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MappingButton::UpdateIndicator()
|
|
||||||
{
|
|
||||||
QFont f = m_mapping_window->font();
|
|
||||||
|
|
||||||
if (isActiveWindow() && m_reference->IsInput() && m_reference->GetState<bool>() && !m_is_mapping)
|
|
||||||
f.setBold(true);
|
|
||||||
|
|
||||||
// If the expression has failed to parse, show it in italic.
|
|
||||||
// Some expressions still work even the failed to parse so don't prevent the GetState() above.
|
|
||||||
if (m_reference->GetParseStatus() == ciface::ExpressionParser::ParseStatus::SyntaxError)
|
|
||||||
f.setItalic(true);
|
|
||||||
|
|
||||||
setFont(f);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MappingButton::StartMapping()
|
void MappingButton::StartMapping()
|
||||||
{
|
{
|
||||||
// Focus just makes it more clear which button is currently being mapped.
|
// Focus just makes it more clear which button is currently being mapped.
|
||||||
|
@ -15,7 +15,7 @@ class MappingButton : public ElidedButton
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
MappingButton(MappingWidget* widget, ControlReference* ref, bool indicator);
|
MappingButton(MappingWidget* widget, ControlReference* ref);
|
||||||
|
|
||||||
bool IsInput() const;
|
bool IsInput() const;
|
||||||
ControlReference* GetControlReference();
|
ControlReference* GetControlReference();
|
||||||
@ -26,7 +26,6 @@ signals:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void Clear();
|
void Clear();
|
||||||
void UpdateIndicator();
|
|
||||||
void AdvancedPressed();
|
void AdvancedPressed();
|
||||||
|
|
||||||
void Clicked();
|
void Clicked();
|
||||||
|
@ -313,7 +313,7 @@ QGroupBox* MappingWidget::CreateControlsBox(const QString& name, ControllerEmu::
|
|||||||
void MappingWidget::CreateControl(const ControllerEmu::Control* control, QFormLayout* layout,
|
void MappingWidget::CreateControl(const ControllerEmu::Control* control, QFormLayout* layout,
|
||||||
bool indicator)
|
bool indicator)
|
||||||
{
|
{
|
||||||
auto* const button = new MappingButton(this, control->control_ref.get(), indicator);
|
auto* const button = new MappingButton(this, control->control_ref.get());
|
||||||
button->setMinimumWidth(100);
|
button->setMinimumWidth(100);
|
||||||
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user