Skip to content

Commit

Permalink
Fix buttons without state not being translated (issue #2705)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Jul 14, 2022
1 parent c6cce32 commit d417a68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/src/viewer/viewer-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ void ViewerWindow::configureButtons()
// From state:
ButtonState *state = it.second.current = &(it.second.states.first()); // Consider using [].
const ButtonState &defaultState = ViewerWindowButtons::DefaultStates.value(it.second.type);
button->setText(QString(state->text.isEmpty() ? defaultState.text : state->text).replace("&", "&&"));
button->setToolTip(state->toolTip.isEmpty() ? defaultState.toolTip : state->toolTip);
button->setText(QObject::tr((state->text.isEmpty() ? defaultState.text : state->text).toStdString().c_str()).replace("&", "&&"));
button->setToolTip(QObject::tr((state->toolTip.isEmpty() ? defaultState.toolTip : state->toolTip).toStdString().c_str()));

// Initialise state 0 functions. This should be eliminated if possible.
switch (it.second.type) {
Expand Down

0 comments on commit d417a68

Please sign in to comment.