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
fix #298126: added the ability to rotate and offset instrument names #5868
Conversation
e846a59
to
d2daf3e
Compare
libmscore/part.h
Outdated
@@ -55,6 +55,9 @@ enum class PreferSharpFlat : char { | |||
class Part final : public ScoreElement { | |||
QString _partName; ///< used in tracklist (mixer) | |||
InstrumentList _instruments; | |||
int _instrumentNameRotation { 0 }; | |||
int _instrumentNameOffsetX { 0 }; | |||
int _instrumentNameOffsetY { 0 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Offsets are best replaced with a single variable of type QPoint
libmscore/textbase.h
Outdated
@@ -243,11 +243,17 @@ class TextBase : public Element { | |||
int hexState { -1 }; | |||
bool _primed { 0 }; | |||
|
|||
QRectF _basebbox; // used to rotate and offset the text | |||
int _offsetX { 0 }, _offsetY { 0 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Offsets are best replaced with a single variable of type QPoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great, I'll take care of it later today :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@igorkorsukov I used QPointF instead of QPoint because e.readPoint() returns a QPointF.
I would like to hear your opinion on the following matter. Should I change the arguments of setOffsets/setInstrumentNameOffset from 2 ints(x and y) to a QPointF? I like how it is very simple to just pass 2 numbers and be done with it, but I can't help but think that passing a QPointF is cleaner.
mscore/editstaff.ui
Outdated
<number>-90</number> | ||
</property> | ||
<property name="maximum"> | ||
<number>90</number> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't +/-180 make sense too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and a tooltip about what turns clockwise and what counter clock wise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't +/-180 make sense too?
The letters would be upside down, wouldn't they?
and a tooltip about what turns clockwise and what counterclockwise
Sounds good. I should probably add tooltips for the offsets too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, 180° is upside down. Not sure it is of much use, but why restrict.
d2daf3e
to
dcb3e1d
Compare
mscore/editstaff.ui
Outdated
<item row="2" column="0"> | ||
<widget class="QLabel" name="rotationLabel"> | ||
<property name="toolTip"> | ||
<string>Negative values rotate counterclowise, positive values clockwise (-180...180).</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo "counterclowise". Also not sure whether we want to show the limits, but if, then with a "°" sign
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that displaying the limits will help. And you are right about the sign, I'll add units in all of them.
mscore/editstaff.ui
Outdated
<item row="2" column="1"> | ||
<widget class="QSpinBox" name="rotationInput"> | ||
<property name="toolTip"> | ||
<string>Negative values rotate counterclowise, positive values clockwise (-180...180).</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dito
mscore/editstaff.ui
Outdated
<item row="3" column="1"> | ||
<widget class="QSpinBox" name="spinBoxOffsetX"> | ||
<property name="toolTip"> | ||
<string>Negative values move left, positive values move right (-200, 200).</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about whether to show the limits, but if, then with the unit ("sp"?)
mscore/editstaff.ui
Outdated
<item row="4" column="1"> | ||
<widget class="QSpinBox" name="spinBoxOffsetY"> | ||
<property name="toolTip"> | ||
<string>Negative values move upwards, positive values move downwards (-200, 200).</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dito
mscore/editstaff.ui
Outdated
<item row="3" column="0"> | ||
<widget class="QLabel" name="labelOffsetX"> | ||
<property name="toolTip"> | ||
<string>Negative values move left, positive values move right (-200, 200).</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about whether to show the limits, but if, then with the unit ("sp"?)
mscore/editstaff.ui
Outdated
<item row="4" column="0"> | ||
<widget class="QLabel" name="labelOffsetY"> | ||
<property name="toolTip"> | ||
<string>Negative values move upwards, positive values move downwards (-200, 200).</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about whether to show the limits, but if, then with the unit ("sp"?)
mscore/editstaff.ui
Outdated
<width>760</width> | ||
<height>600</height> | ||
<width>797</width> | ||
<height>757</height> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we avoid this change? Just not commit this chunk?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jojo-Schmitz
I was forced to increase the height (not sure when the width changed) because there wasn't enough space for the spinboxes. The thing is that as I've said in the Telegram chat, I have 2 conflicting pull requests with UI changes. No matter which one gets merged first I'll be forced to make changes in the UI.
mscore/editstaff.ui
Outdated
<x>248</x> | ||
<y>254</y> | ||
<x>650</x> | ||
<y>677</y> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted.
mscore/editstaff.ui
Outdated
<x>316</x> | ||
<y>260</y> | ||
<x>718</x> | ||
<y>677</y> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dito
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted.
dcb3e1d
to
92293cc
Compare
<item row="3" column="1"> | ||
<widget class="QSpinBox" name="spinBoxOffsetX"> | ||
<property name="toolTip"> | ||
<string>Negative values move left, positive values move right (-200sp, 200sp).</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rebase needed |
Rebase still necessary. |
Archived due to long inactivity. Could be re-opened later |
Resolves: https://musescore.org/en/node/298126
Added the ability to rotate and offset in the TextBase class and added the relevant UI in the EditStaff menu.