Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions global/settings/types/preferencekeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
#define PREF_UI_SCORE_VOICE2_COLOR "ui/score/voice2/color"
#define PREF_UI_SCORE_VOICE3_COLOR "ui/score/voice3/color"
#define PREF_UI_SCORE_VOICE4_COLOR "ui/score/voice4/color"
#define PREF_UI_SCORE_CURSOR_COLOR "ui/score/playbackCursor/color"
#define PREF_UI_THEME_ICONHEIGHT "ui/theme/iconHeight"
#define PREF_UI_THEME_ICONWIDTH "ui/theme/iconWidth"
#define PREF_UI_THEME_FONTFAMILY "ui/theme/fontFamily"
Expand Down
1 change: 1 addition & 0 deletions libmscore/mscore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ qreal MScore::horizontalPageGapEven = 1.0;
qreal MScore::horizontalPageGapOdd = 50.0;

QColor MScore::selectColor[VOICES];
QColor MScore::cursorColor;
QColor MScore::defaultColor;
QColor MScore::layoutBreakColor;
QColor MScore::frameMarginColor;
Expand Down
1 change: 1 addition & 0 deletions libmscore/mscore.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ class MScore {
static void setVerticalOrientation(bool val) { _verticalOrientation = val; }

static QColor selectColor[VOICES];
static QColor cursorColor;
static QColor defaultColor;
static QColor dropColor;
static QColor layoutBreakColor;
Expand Down
1 change: 1 addition & 0 deletions mscore/musescore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ void updateExternalValuesFromPreferences() {
MScore::selectColor[1] = preferences.getColor(PREF_UI_SCORE_VOICE2_COLOR);
MScore::selectColor[2] = preferences.getColor(PREF_UI_SCORE_VOICE3_COLOR);
MScore::selectColor[3] = preferences.getColor(PREF_UI_SCORE_VOICE4_COLOR);
MScore::cursorColor = preferences.getColor(PREF_UI_SCORE_CURSOR_COLOR);

MScore::setHRaster(preferences.getInt(PREF_UI_APP_RASTER_HORIZONTAL));
MScore::setVRaster(preferences.getInt(PREF_UI_APP_RASTER_VERTICAL));
Expand Down
2 changes: 2 additions & 0 deletions mscore/preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ void Preferences::init(bool storeInMemoryOnly)
{PREF_UI_SCORE_VOICE2_COLOR, new ColorPreference(QColor("#007F00"))},
{PREF_UI_SCORE_VOICE3_COLOR, new ColorPreference(QColor("#C53F00"))},
{PREF_UI_SCORE_VOICE4_COLOR, new ColorPreference(QColor("#C31989"))},
{PREF_UI_SCORE_CURSOR_COLOR, new ColorPreference(QColor("#0065BF"))},
{PREF_UI_THEME_ICONWIDTH, new IntPreference(28, false)},
{PREF_UI_THEME_ICONHEIGHT, new IntPreference(24, false)},
{PREF_UI_THEME_FONTFAMILY, new StringPreference(QApplication::font().family(), false) },
Expand Down Expand Up @@ -496,6 +497,7 @@ QMap<QString, QVariant> Preferences::getDefaultLocalPreferences() {
PREF_UI_SCORE_VOICE2_COLOR,
PREF_UI_SCORE_VOICE3_COLOR,
PREF_UI_SCORE_VOICE4_COLOR,
PREF_UI_SCORE_CURSOR_COLOR,
PREF_UI_THEME_ICONWIDTH,
PREF_UI_THEME_ICONHEIGHT,
PREF_UI_THEME_FONTFAMILY,
Expand Down
16 changes: 9 additions & 7 deletions mscore/scoreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ ScoreView::ScoreView(QWidget* parent)
editData.element = 0;

lasso = new Lasso(_score);
_foto = 0;// new Lasso(_score);
_foto = 0; // new Lasso(_score);

_cursor = new PositionCursor(this);
_cursor->setType(CursorType::POS);
Expand Down Expand Up @@ -583,9 +583,10 @@ void ScoreView::moveCursor(const Fraction& tick)
if (s == 0)
return;

QColor c(MScore::selectColor[0]);
c.setAlpha(50);
_cursor->setColor(c);
_cursorColor = QColor(MScore::cursorColor);
if(_cursorColor.alpha() > maxCursorAlpha)
_cursorColor.setAlpha(50);
_cursor->setColor(_cursorColor);
_cursor->setTick(tick);

System* system = measure->system();
Expand Down Expand Up @@ -640,9 +641,10 @@ void ScoreView::moveCursor()
int voice = track % VOICES;
int staffIdx = track / VOICES;

QColor c(MScore::selectColor[voice]);
c.setAlpha(50);
_cursor->setColor(c);
_cursorColor = QColor(MScore::cursorColor);
if(_cursorColor.alpha() > maxCursorAlpha)
_cursorColor.setAlpha(50);
_cursor->setColor(_cursorColor);
_cursor->setTick(segment->tick());

System* system = segment->measure()->system();
Expand Down
2 changes: 2 additions & 0 deletions mscore/scoreview.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ class ScoreView : public QWidget, public MuseScoreView {

//--input state:
PositionCursor* _cursor;
QColor _cursorColor;
const int maxCursorAlpha = 220;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better name: MAX_CURSOR_ALPHA, to immediately see that it is a constant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@igorkorsukov I chose lower-case because the other constant in the same file is like that. Should I change both?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only this one is better. Others are best fixed with a separate pull request.

ShadowNote* shadowNote;

// Realtime state: Note: always set allowRealtimeRests to desired value before starting a timer.
Expand Down