Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change frame color with text color #693

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from
Open
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
10 changes: 8 additions & 2 deletions libmscore/textbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Ms {
#endif

static const qreal subScriptSize = 0.6;
static const qreal subScriptOffset = 0.5; // of x-height
static const qreal subScriptOffset = 0.5; // of x-height
static const qreal superScriptOffset = -.9; // of x-height

//static const qreal tempotextOffset = 0.4; // of x-height // 80% of 50% = 2 spatiums
Expand Down Expand Up @@ -188,9 +188,10 @@ QChar TextCursor::currentCharacter() const

QString TextCursor::currentWord() const
{
static QRegularExpression regex (" .*");
const TextBlock& t = _text->_layout[row()];
QString s = t.text(column(), -1);
return s.remove(QRegularExpression(" .*"));
return s.remove(regex);
}

//---------------------------------------------------------
Expand Down Expand Up @@ -2819,6 +2820,11 @@ bool TextBase::setProperty(Pid pid, const QVariant& v)
genText();
bool rv = true;
switch (pid) {
case Pid::COLOR:
if (color() == frameColor())
setFrameColor(v.value<QColor>());
Element::setProperty(pid, v);
break;
case Pid::SUB_STYLE:
initTid(Tid(v.toInt()));
break;
Expand Down