Merge pull request #10988 from cbjeukendrup/select_nothing_on_start
Nothing should be selected on the score when a new score is created, or an existing score opened
This commit is contained in:
commit
2b93e8afca
6 changed files with 13 additions and 32 deletions
|
@ -44,6 +44,7 @@ RadioDelegate {
|
|||
property color checkedColor: ui.theme.accentColor
|
||||
|
||||
property alias navigation: navCtrl
|
||||
property alias navigationFocusBorder: navigationFocusBorder
|
||||
|
||||
ButtonGroup.group: ListView.view && ListView.view instanceof RadioButtonGroup ? ListView.view.radioButtonGroup : null
|
||||
|
||||
|
@ -76,7 +77,10 @@ RadioDelegate {
|
|||
id: backgroundRect
|
||||
anchors.fill: parent
|
||||
|
||||
NavigationFocusBorder { navigationCtrl: navCtrl }
|
||||
NavigationFocusBorder {
|
||||
id: navigationFocusBorder
|
||||
navigationCtrl: navCtrl
|
||||
}
|
||||
|
||||
color: root.checked ? root.checkedColor : root.normalColor
|
||||
opacity: ui.theme.buttonOpacityNormal
|
||||
|
|
|
@ -283,19 +283,6 @@ void MasterNotation::applyOptions(Ms::MasterScore* score, const ScoreCreateOptio
|
|||
|
||||
createMeasures(score, scoreOptions);
|
||||
|
||||
//
|
||||
// select first rest
|
||||
//
|
||||
Measure* m = score->firstMeasure();
|
||||
for (Ms::Segment* s = m->first(); s; s = s->next()) {
|
||||
if (s->segmentType() == Ms::SegmentType::ChordRest) {
|
||||
if (s->element(0)) {
|
||||
score->select(s->element(0), SelectType::SINGLE, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
QString title = score->metaTag("workTitle");
|
||||
QString subtitle = score->metaTag("subtitle");
|
||||
|
|
|
@ -110,13 +110,17 @@ FocusScope {
|
|||
onActiveChanged: {
|
||||
if (fakeNavCtrl.active) {
|
||||
notationView.forceFocusIn()
|
||||
notationView.selectOnNavigationActive()
|
||||
} else {
|
||||
notationView.focus = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NavigationFocusBorder {
|
||||
navigationCtrl: fakeNavCtrl
|
||||
drawOutsideParent: false
|
||||
}
|
||||
|
||||
onActiveFocusRequested: {
|
||||
fakeNavCtrl.requestActive()
|
||||
}
|
||||
|
|
|
@ -37,6 +37,9 @@ FlatRadioButton {
|
|||
|
||||
checkedColor: ui.theme.backgroundPrimaryColor
|
||||
|
||||
navigationFocusBorder.drawOutsideParent: false
|
||||
navigationFocusBorder.anchors.rightMargin: 1 // for separator
|
||||
|
||||
RowLayout {
|
||||
id: contentRow
|
||||
anchors.fill: parent
|
||||
|
|
|
@ -158,21 +158,6 @@ void NotationPaintView::zoomOut()
|
|||
m_inputController->zoomOut();
|
||||
}
|
||||
|
||||
void NotationPaintView::selectOnNavigationActive()
|
||||
{
|
||||
TRACEFUNC;
|
||||
if (!notation()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto interaction = notation()->interaction();
|
||||
if (!interaction->selection()->isNone()) {
|
||||
return;
|
||||
}
|
||||
|
||||
interaction->selectFirstElement(false);
|
||||
}
|
||||
|
||||
bool NotationPaintView::canReceiveAction(const actions::ActionCode& actionCode) const
|
||||
{
|
||||
if (actionCode == "diagnostic-notationview-redraw") {
|
||||
|
|
|
@ -82,8 +82,6 @@ public:
|
|||
Q_INVOKABLE void zoomIn();
|
||||
Q_INVOKABLE void zoomOut();
|
||||
|
||||
Q_INVOKABLE void selectOnNavigationActive();
|
||||
|
||||
Q_INVOKABLE void forceFocusIn();
|
||||
|
||||
qreal width() const override;
|
||||
|
|
Loading…
Reference in a new issue