Skip to content

Commit

Permalink
DolphinQt: Remove MappingButton bold/italic text indication.
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-woyak committed Jan 18, 2025
1 parent 5ae7e16 commit d14261e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
20 changes: 1 addition & 19 deletions Source/Core/DolphinQt/Config/Mapping/MappingButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ bool MappingButton::IsInput() const
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)
{
if (IsInput())
Expand All @@ -87,9 +87,6 @@ MappingButton::MappingButton(MappingWidget* parent, ControlReference* ref, bool

connect(this, &MappingButton::clicked, this, &MappingButton::Clicked);

if (indicator)
connect(parent, &MappingWidget::Update, this, &MappingButton::UpdateIndicator);

connect(parent, &MappingWidget::ConfigChanged, this, &MappingButton::ConfigChanged);
connect(this, &MappingButton::ConfigChanged, [this] {
setText(RefToDisplayString(m_reference));
Expand Down Expand Up @@ -134,21 +131,6 @@ void MappingButton::Clear()
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()
{
// Focus just makes it more clear which button is currently being mapped.
Expand Down
3 changes: 1 addition & 2 deletions Source/Core/DolphinQt/Config/Mapping/MappingButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MappingButton : public ElidedButton
{
Q_OBJECT
public:
MappingButton(MappingWidget* widget, ControlReference* ref, bool indicator);
MappingButton(MappingWidget* widget, ControlReference* ref);

bool IsInput() const;
ControlReference* GetControlReference();
Expand All @@ -26,7 +26,6 @@ class MappingButton : public ElidedButton

private:
void Clear();
void UpdateIndicator();
void AdvancedPressed();

void Clicked();
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinQt/Config/Mapping/MappingWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ QGroupBox* MappingWidget::CreateControlsBox(const QString& name, ControllerEmu::
void MappingWidget::CreateControl(const ControllerEmu::Control* control, QFormLayout* layout,
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->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

Expand Down

0 comments on commit d14261e

Please sign in to comment.