2017-01-20 11:05:52 +01:00
|
|
|
//=============================================================================
|
|
|
|
// MuseScore
|
|
|
|
// Music Composition & Notation
|
|
|
|
//
|
|
|
|
// Copyright (C) 2011 Werner Schweer
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License version 2
|
|
|
|
// as published by the Free Software Foundation and appearing in
|
|
|
|
// the file LICENCE.GPL
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
#include "systemtext.h"
|
|
|
|
|
|
|
|
namespace Ms {
|
|
|
|
|
2018-09-25 13:18:45 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// systemStyle
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2018-08-01 11:46:07 +02:00
|
|
|
static const ElementStyle systemStyle {
|
|
|
|
{ Sid::systemTextPlacement, Pid::PLACEMENT },
|
2019-05-06 20:41:21 +02:00
|
|
|
{ Sid::systemTextMinDistance, Pid::MIN_DISTANCE },
|
2018-08-01 11:46:07 +02:00
|
|
|
};
|
|
|
|
|
2017-01-20 11:05:52 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// SystemText
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2018-10-18 11:53:01 +02:00
|
|
|
SystemText::SystemText(Score* s, Tid tid)
|
|
|
|
: StaffTextBase(s, tid, ElementFlag::SYSTEM | ElementFlag::MOVABLE | ElementFlag::ON_STAFF)
|
2017-01-23 10:54:57 +01:00
|
|
|
{
|
2018-08-01 11:46:07 +02:00
|
|
|
initElementStyle(&systemStyle);
|
2017-01-23 10:54:57 +01:00
|
|
|
}
|
|
|
|
|
2017-01-20 11:05:52 +01:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// propertyDefault
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
2018-03-27 15:36:00 +02:00
|
|
|
QVariant SystemText::propertyDefault(Pid id) const
|
2017-01-20 11:05:52 +01:00
|
|
|
{
|
|
|
|
switch (id) {
|
2018-03-27 15:36:00 +02:00
|
|
|
case Pid::SUB_STYLE:
|
2018-08-01 11:46:07 +02:00
|
|
|
return int(Tid::SYSTEM);
|
2017-01-20 11:05:52 +01:00
|
|
|
default:
|
2017-12-27 11:51:00 +01:00
|
|
|
return TextBase::propertyDefault(id);
|
2017-01-20 11:05:52 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-26 13:14:06 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// layout
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
void SystemText::layout()
|
|
|
|
{
|
2018-10-18 11:53:01 +02:00
|
|
|
TextBase::layout();
|
2019-05-07 06:06:22 +02:00
|
|
|
autoplaceSegmentElement();
|
2018-07-26 13:14:06 +02:00
|
|
|
}
|
|
|
|
|
2018-10-18 11:53:01 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// getPropertyStyle
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
Sid SystemText::getPropertyStyle(Pid pid) const
|
|
|
|
{
|
|
|
|
if (pid == Pid::OFFSET)
|
|
|
|
return placeAbove() ? Sid::systemTextPosAbove : Sid::systemTextPosBelow;
|
|
|
|
return TextBase::getPropertyStyle(pid);
|
|
|
|
}
|
|
|
|
|
2017-01-20 11:05:52 +01:00
|
|
|
} // namespace Ms
|
|
|
|
|