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:
RomanPudashkin 2022-03-31 10:00:40 +02:00 committed by GitHub
commit 2b93e8afca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 32 deletions

View file

@ -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

View file

@ -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");

View file

@ -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()
}

View file

@ -37,6 +37,9 @@ FlatRadioButton {
checkedColor: ui.theme.backgroundPrimaryColor
navigationFocusBorder.drawOutsideParent: false
navigationFocusBorder.anchors.rightMargin: 1 // for separator
RowLayout {
id: contentRow
anchors.fill: parent

View file

@ -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") {

View file

@ -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;