Skip to content

Commit 2f82fa6

Browse files
committed
Add symbol size to text style dialog
1 parent 6c60559 commit 2f82fa6

File tree

2 files changed

+68
-14
lines changed

2 files changed

+68
-14
lines changed

src/notation/view/widgets/editstyle.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,15 @@ EditStyle::EditStyle(QWidget* parent)
11171117
textStyleValueChanged(TextStylePropertyType::MusicalSymbolsScale, textStyleMusicalSymbolsScale->value());
11181118
});
11191119

1120+
// musical symbols size
1121+
WidgetUtils::setWidgetIcon(resetTextStyleMusicalSymbolsSize, IconCode::Code::UNDO);
1122+
connect(resetTextStyleMusicalSymbolsSize, &QToolButton::clicked, this, [=]() {
1123+
resetTextStyle(TextStylePropertyType::MusicalSymbolsSize);
1124+
});
1125+
connect(textStyleMusicalSymbolsSize, &QDoubleSpinBox::valueChanged, this, [=]() {
1126+
textStyleValueChanged(TextStylePropertyType::MusicalSymbolsSize, textStyleMusicalSymbolsSize->value());
1127+
});
1128+
11201129
// line spacing
11211130
WidgetUtils::setWidgetIcon(resetTextStyleLineSpacing, IconCode::Code::UNDO);
11221131
connect(resetTextStyleLineSpacing, &QToolButton::clicked, this, [=]() {
@@ -2751,6 +2760,11 @@ void EditStyle::textStyleChanged(int row)
27512760
resetTextStyleMusicalSymbolsScale->setEnabled(styleValue(a.sid) != defaultStyleValue(a.sid));
27522761
break;
27532762

2763+
case TextStylePropertyType::MusicalSymbolsSize:
2764+
textStyleMusicalSymbolsSize->setValue(styleValue(a.sid).toDouble());
2765+
resetTextStyleMusicalSymbolsSize->setEnabled(styleValue(a.sid) != defaultStyleValue(a.sid));
2766+
break;
2767+
27542768
case TextStylePropertyType::FontStyle:
27552769
textStyleFontStyle->setFontStyle(FontStyle(styleValue(a.sid).toInt()));
27562770
resetTextStyleFontStyle->setEnabled(styleValue(a.sid) != defaultStyleValue(a.sid));

src/notation/view/widgets/editstyle.ui

Lines changed: 54 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12602,10 +12602,10 @@ followed by dashes</string>
1260212602
<string>Edit text style</string>
1260312603
</property>
1260412604
<layout class="QGridLayout" name="_12">
12605-
<item row="12" column="1">
12605+
<item row="13" column="1">
1260612606
<widget class="Awl::ColorLabel" name="textStyleColor"/>
1260712607
</item>
12608-
<item row="13" column="0">
12608+
<item row="14" column="0">
1260912609
<widget class="QLabel" name="label_186">
1261012610
<property name="text">
1261112611
<string>Offset:</string>
@@ -12628,7 +12628,7 @@ followed by dashes</string>
1262812628
</property>
1262912629
</widget>
1263012630
</item>
12631-
<item row="9" column="0">
12631+
<item row="10" column="0">
1263212632
<widget class="QLabel" name="label_209">
1263312633
<property name="text">
1263412634
<string>Style:</string>
@@ -12651,7 +12651,7 @@ followed by dashes</string>
1265112651
<item row="0" column="1">
1265212652
<widget class="QLineEdit" name="styleName"/>
1265312653
</item>
12654-
<item row="13" column="2">
12654+
<item row="14" column="2">
1265512655
<widget class="QToolButton" name="resetTextStyleOffset">
1265612656
<property name="toolTip">
1265712657
<string>Reset to default</string>
@@ -12678,7 +12678,7 @@ followed by dashes</string>
1267812678
</property>
1267912679
</widget>
1268012680
</item>
12681-
<item row="12" column="0">
12681+
<item row="13" column="0">
1268212682
<widget class="QLabel" name="textStyleColorLabel">
1268312683
<property name="text">
1268412684
<string>Color:</string>
@@ -12688,7 +12688,7 @@ followed by dashes</string>
1268812688
</property>
1268912689
</widget>
1269012690
</item>
12691-
<item row="15" column="0" colspan="3">
12691+
<item row="16" column="0" colspan="3">
1269212692
<widget class="QGroupBox" name="groupBox_text_style">
1269312693
<property name="title">
1269412694
<string/>
@@ -12945,6 +12945,46 @@ followed by dashes</string>
1294512945
</item>
1294612946
</layout>
1294712947
</item>
12948+
<item row="9" column="0" colspan="3">
12949+
<layout class="QHBoxLayout" name="horizontalLayout_14">
12950+
<item>
12951+
<widget class="QLabel" name="label_14713">
12952+
<property name="text">
12953+
<string>Musical symbols size:</string>
12954+
</property>
12955+
<property name="buddy">
12956+
<cstring>textStyleMusicalSymbolsSize</cstring>
12957+
</property>
12958+
</widget>
12959+
</item>
12960+
<item>
12961+
<widget class="QDoubleSpinBox" name="textStyleMusicalSymbolsSize">
12962+
<property name="keyboardTracking">
12963+
<bool>false</bool>
12964+
</property>
12965+
<property name="suffix">
12966+
<string>pt</string>
12967+
</property>
12968+
<property name="minimum">
12969+
<double>1.000000000000000</double>
12970+
</property>
12971+
</widget>
12972+
</item>
12973+
<item>
12974+
<widget class="QToolButton" name="resetTextStyleMusicalSymbolsSize">
12975+
<property name="toolTip">
12976+
<string>Reset to default</string>
12977+
</property>
12978+
<property name="accessibleName">
12979+
<string>Reset 'Musical symbols size' value</string>
12980+
</property>
12981+
<property name="text">
12982+
<string notr="true"/>
12983+
</property>
12984+
</widget>
12985+
</item>
12986+
</layout>
12987+
</item>
1294812988
<item row="2" column="2">
1294912989
<widget class="QToolButton" name="resetTextStyleFontSize">
1295012990
<property name="toolTip">
@@ -12971,7 +13011,7 @@ followed by dashes</string>
1297113011
</property>
1297213012
</widget>
1297313013
</item>
12974-
<item row="10" column="2">
13014+
<item row="11" column="2">
1297513015
<widget class="QToolButton" name="resetTextStyleAlign">
1297613016
<property name="toolTip">
1297713017
<string>Reset to default</string>
@@ -13023,7 +13063,7 @@ followed by dashes</string>
1302313063
</property>
1302413064
</widget>
1302513065
</item>
13026-
<item row="12" column="2">
13066+
<item row="13" column="2">
1302713067
<widget class="QToolButton" name="resetTextStyleColor">
1302813068
<property name="toolTip">
1302913069
<string>Reset to default</string>
@@ -13036,7 +13076,7 @@ followed by dashes</string>
1303613076
</property>
1303713077
</widget>
1303813078
</item>
13039-
<item row="9" column="2">
13079+
<item row="10" column="2">
1304013080
<widget class="QToolButton" name="resetTextStyleFontStyle">
1304113081
<property name="toolTip">
1304213082
<string>Reset to default</string>
@@ -13049,7 +13089,7 @@ followed by dashes</string>
1304913089
</property>
1305013090
</widget>
1305113091
</item>
13052-
<item row="13" column="1">
13092+
<item row="14" column="1">
1305313093
<widget class="mu::notation::OffsetSelect" name="textStyleOffset" native="true">
1305413094
<property name="focusPolicy">
1305513095
<enum>Qt::FocusPolicy::StrongFocus</enum>
@@ -13079,7 +13119,7 @@ followed by dashes</string>
1307913119
</property>
1308013120
</widget>
1308113121
</item>
13082-
<item row="10" column="0">
13122+
<item row="11" column="0">
1308313123
<widget class="QLabel" name="label_210">
1308413124
<property name="text">
1308513125
<string>Align:</string>
@@ -13089,10 +13129,10 @@ followed by dashes</string>
1308913129
</property>
1309013130
</widget>
1309113131
</item>
13092-
<item row="10" column="1">
13132+
<item row="11" column="1">
1309313133
<widget class="mu::notation::AlignSelect" name="textStyleAlign" native="true"/>
1309413134
</item>
13095-
<item row="9" column="1">
13135+
<item row="10" column="1">
1309613136
<widget class="mu::notation::FontStyleSelect" name="textStyleFontStyle" native="true"/>
1309713137
</item>
1309813138
<item row="7" column="2">
@@ -13141,7 +13181,7 @@ followed by dashes</string>
1314113181
</property>
1314213182
</widget>
1314313183
</item>
13144-
<item row="11" column="1">
13184+
<item row="12" column="1">
1314513185
<widget class="mu::notation::TextPositionSelect" name="textPositionSelect" native="true"/>
1314613186
</item>
1314713187
</layout>

0 commit comments

Comments
 (0)