Skip to content

Commit

Permalink
fix #113556: Note input toolbar not accessible via tab
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Jun 1, 2016
1 parent d1c649d commit 1388540
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions mscore/accessibletoolbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ namespace Ms {

AccessibleToolButton::AccessibleToolButton(QWidget* parent, QAction* defaultQAction ): QToolButton(parent)
{
this->setDefaultAction(defaultQAction);
this->setFocusPolicy(Qt::TabFocus);
setDefaultAction(defaultQAction);
setFocusPolicy(Qt::TabFocus);

this->setAccessibleName(defaultQAction->text());
this->setAccessibleDescription(defaultQAction->toolTip());
setAccessibleName(defaultQAction->text());
setAccessibleDescription(defaultQAction->toolTip());
}


Expand All @@ -27,15 +27,15 @@ void AccessibleToolButton::focusInEvent(QFocusEvent* e)

void AccessibleToolButton::focusOutEvent(QFocusEvent* e)
{
this->setGraphicsEffect(NULL);
setGraphicsEffect(nullptr);
QToolButton::focusInEvent(e);
}

void AccessibleToolButton::keyPressEvent(QKeyEvent *e)
{
//Pressing Enter or Return button triggers the default action
if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
this->animateClick();
animateClick();
return;
}

Expand Down
3 changes: 2 additions & 1 deletion mscore/musescore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ void MuseScore::preferencesChanged()
updateNewWizard();
}

//---------------------------------------------------------
//---------------------------------------------------------
// MuseScore
//---------------------------------------------------------
Expand Down Expand Up @@ -630,7 +631,7 @@ MuseScore::MuseScore()
if (!*s)
entryTools->addSeparator();
else
entryTools->addAction(getAction(s));
entryTools->addWidget(new AccessibleToolButton(entryTools, getAction(s)));
}

static const char* vbsh { "QToolButton:checked, QToolButton:pressed { color: white;}" };
Expand Down

0 comments on commit 1388540

Please sign in to comment.