MuseScore/mscore/editstyle.h
Maurizio M. Gavioli 8c017d8536 Lyrics: Better dash control
This patch gives better control on lyrics dash management and it is intended to supersede https://github.com/musescore/MuseScore/pull/2213 which did not suit the taste of several forum users; for a discussion, see https://musescore.org/en/node/76021 .

Adds 3 new score style parameters:
- `lyricsDashMinLength` to control the minimum dash length (default: 0.4sp)
- `lyricsDashMaxLength` to control the maximum dash length (default: 0.8sp)
- `lyricsDashForce`: if set to __true__, a dash is always generated between two syllables of a word and, if there is not enough space for the min dash length, more space is added between the syllables to accommodate it; if set to __false__, no extra space is added and the two syllables are joined together (default: true)

The effect of the last parameter is exemplified by the following screen-shots:

Current situation (before this patch); if there is no room for the min dash length, the dash is skipped and some blank is left between syllables:

Patch with `lyricsDashForce = true`; chords are further spaced and a min-length dash is inserted:

Patch with `lyricsDashForce = false`: the second syllable is moved (slightly) to the left to reclaim the blank:
2015-10-03 23:55:33 +02:00

87 lines
2.4 KiB
C++

//=============================================================================
// MusE Score
// Linux Music Score Editor
// $Id: editstyle.h 5403 2012-03-03 00:01:53Z miwarre $
//
// Copyright (C) 2002-2010 Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//=============================================================================
#ifndef __EDITSTYLE_H__
#define __EDITSTYLE_H__
#include "ui_editstyle.h"
#include "globals.h"
#include "libmscore/style.h"
namespace Ms {
class Score;
//---------------------------------------------------------
// StyleWidget
//---------------------------------------------------------
struct StyleWidget {
StyleIdx idx;
QWidget* widget;
};
//---------------------------------------------------------
// EditStyle
//---------------------------------------------------------
class EditStyle : public QDialog, private Ui::EditStyleBase {
Q_OBJECT
Score* cs;
QPushButton* buttonApplyToAllParts;
MStyle lstyle; // local copy of style
QButtonGroup* stemGroups[VOICES];
QVector<StyleWidget> styleWidgets;
void getValues();
void setValues();
void setHeaderText(StyleIdx idx, QTextEdit* te);
void setFooterText(StyleIdx idx, QTextEdit* te);
void apply();
void applyToAllParts();
private slots:
void selectChordDescriptionFile();
void setChordStyle(bool);
void toggleHeaderOddEven(bool);
void toggleFooterOddEven(bool);
void buttonClicked(QAbstractButton*);
void setSwingParams(bool);
void lyricsDashMinLengthValueChanged(double val);
void lyricsDashMaxLengthValueChanged(double val);
void resetStyleValue(int i);
void on_comboFBFont_currentIndexChanged(int index);
public:
static const int PAGE_NOTE = 6;
EditStyle(Score*, QWidget*);
void setPage(int no);
};
} // namespace Ms
#endif