Skip to content

Commit

Permalink
Fix #32966 - TAB: hide fingerings
Browse files Browse the repository at this point in the history
Simple and cheap fix which simply hides `Fingering` elements in TAB's. No change to the linking / copying stuff: elements are still there, but generate no visible output in TAB. See issue http://musescore.org/en/node/32966 for details and discussion.

Should an option for hiding / showing these elements be added in the future, as discussed in the forum issue, the change would be trivial.

This does not affect lute-specific RH fingerings recently added, as luckily they are not real `Fingering`s, but `Articulation`s.
  • Loading branch information
mgavioli committed Feb 18, 2015
1 parent 399ea1d commit 507aa6c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions libmscore/fingering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include "fingering.h"
#include "score.h"
#include "staff.h"
#include "undo.h"
#include "xml.h"

Expand Down Expand Up @@ -53,6 +54,29 @@ void Fingering::read(XmlReader& e)
}
}

//---------------------------------------------------------
// layout
//---------------------------------------------------------

void Fingering::layout()
{
if (staff() && staff()->isTabStaff()) // in TAB staves
setbbox(QRectF()); // fingerings have no area
else
Text::layout();
}

//---------------------------------------------------------
// draw
//---------------------------------------------------------

void Fingering::draw(QPainter* painter) const
{
if (staff() && staff()->isTabStaff()) // hide fingering in TAB staves
return;
Text::draw(painter);
}

//---------------------------------------------------------
// reset
//---------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions libmscore/fingering.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class Fingering : public Text {

Note* note() const { return (Note*)parent(); }

virtual void draw(QPainter*) const override;
virtual void layout() override;
virtual void write(Xml&) const override;
virtual void read(XmlReader&) override;
virtual void reset() override;
Expand Down

0 comments on commit 507aa6c

Please sign in to comment.