Skip to content

Commit

Permalink
fix #277697: Remove some redundant operations on updating styles and …
Browse files Browse the repository at this point in the history
…icons
  • Loading branch information
dmitrio95 committed Nov 7, 2018
1 parent 5ccc53a commit 62d05e1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
3 changes: 1 addition & 2 deletions mscore/musescore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ void MuseScore::preferencesChanged(bool fromWorkspace)
_statusBar->setVisible(preferences.getBool(PREF_UI_APP_SHOWSTATUSBAR));

MuseScore::updateUiStyleAndTheme();
updateIcons();

QString fgWallpaper = preferences.getString(PREF_UI_CANVAS_FG_WALLPAPER);
for (int i = 0; i < tab1->count(); ++i) {
Expand Down Expand Up @@ -6965,8 +6966,6 @@ int main(int argc, char* av[])
else
noSeq = true;

genIcons();

// Do not create sequencer and audio drivers if run with '-s'
if (!noSeq) {
seq = new Seq();
Expand Down
9 changes: 0 additions & 9 deletions mscore/prefsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1115,15 +1115,6 @@ void PreferenceDialog::apply()
MScore::defaultStyleForPartsHasChanged();
}

genIcons();

mscore->setIconSize(QSize(preferences.getInt(PREF_UI_THEME_ICONWIDTH) * guiScaling, preferences.getInt(PREF_UI_THEME_ICONHEIGHT) * guiScaling));
QString style = QString("*, QSpinBox { font: %1pt \"%2\" } ")
.arg(QString::number(preferences.getInt(PREF_UI_THEME_FONTSIZE)), preferences.getString(PREF_UI_THEME_FONTFAMILY))
+ qApp->styleSheet();
qApp->setStyleSheet(style);
mscore->updateIcons();

emit preferencesChanged();
preferences.save();
mscore->startAutoSave();
Expand Down
5 changes: 3 additions & 2 deletions mscore/workspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,13 @@ void MuseScore::changeWorkspace(Workspace* p, bool first)

void MuseScore::updateIcons()
{
mscore->setIconSize(QSize(preferences.getInt(PREF_UI_THEME_ICONWIDTH) * guiScaling, preferences.getInt(PREF_UI_THEME_ICONHEIGHT) * guiScaling));
setIconSize(QSize(preferences.getInt(PREF_UI_THEME_ICONWIDTH) * guiScaling, preferences.getInt(PREF_UI_THEME_ICONHEIGHT) * guiScaling));
for (QAction* a : fileTools->actions()) {
QWidget* widget = fileTools->widgetForAction(a);
QString className = widget->metaObject()->className();
if (className != "Ms::AccessibleToolButton" || className != "QToolBarSeparator")
if (className != "Ms::AccessibleToolButton" && className != "QToolBarSeparator")
widget->setFixedHeight(preferences.getInt(PREF_UI_THEME_ICONHEIGHT) + 8); // hack
// apparently needed for viewModeCombo, see MuseScore::populateFileOperations
}
}

Expand Down

0 comments on commit 62d05e1

Please sign in to comment.