Set maximum flick velocity to 1500 for all views in the project

This commit is contained in:
Eism 2022-02-01 19:01:40 +02:00
parent 6443e0175e
commit b7fdaccb45
40 changed files with 161 additions and 136 deletions

View file

@ -57,7 +57,7 @@ Rectangle {
}
}
Flickable {
StyledFlickable {
id: flickable
anchors.fill: parent
@ -74,9 +74,6 @@ Rectangle {
rightMargin: root.sideMargin
bottomMargin: root.sideMargin
clip: true
boundsBehavior: Flickable.StopAtBounds
ScrollBar.vertical: StyledScrollBar { id: scrollBar }
Item {

View file

@ -34,7 +34,7 @@ BaseSection {
property alias model: view.model
ListView {
StyledListView {
id: view
width: parent.width
@ -42,7 +42,6 @@ BaseSection {
spacing: 4
interactive: false
boundsBehavior: Flickable.StopAtBounds
delegate: RowLayout {
width: ListView.view.width

View file

@ -34,7 +34,7 @@ BaseSection {
property alias model: view.model
ListView {
StyledListView {
id: view
width: parent.width
@ -42,7 +42,6 @@ BaseSection {
spacing: 4
interactive: false
boundsBehavior: Flickable.StopAtBounds
delegate: RowLayout {
width: ListView.view.width

View file

@ -99,7 +99,7 @@ Item {
}
}
Flickable {
StyledFlickable {
id: flickable
anchors.top: parent.top
@ -115,9 +115,6 @@ Item {
topMargin: topGradient.height
bottomMargin: 24
clip: true
boundsBehavior: Flickable.StopAtBounds
ScrollBar.vertical: StyledScrollBar {
parent: flickable.parent

View file

@ -48,6 +48,8 @@ static const Settings::Key UI_MUSICAL_FONT_SIZE_KEY("ui", "ui/theme/musicalFontS
static const QString WINDOW_GEOMETRY_KEY("window");
static const int FLICKABLE_MAX_VELOCITY = 1500;
static const QMap<ThemeStyleKey, QVariant> LIGHT_THEME_VALUES {
{ BACKGROUND_PRIMARY_COLOR, "#F5F5F6" },
{ BACKGROUND_SECONDARY_COLOR, "#E6E9ED" },
@ -641,3 +643,8 @@ mu::async::Notification UiConfiguration::toolConfigChanged(const QString& toolNa
{
return m_uiArrangement.toolConfigChanged(toolName);
}
int UiConfiguration::flickableMaxVelocity() const
{
return FLICKABLE_MAX_VELOCITY;
}

View file

@ -94,6 +94,8 @@ public:
void setToolConfig(const QString& toolName, const ToolConfig& config) override;
async::Notification toolConfigChanged(const QString& toolName) const override;
int flickableMaxVelocity() const override;
private:
bool needFollowSystemTheme() const;

View file

@ -92,6 +92,8 @@ public:
virtual ToolConfig toolConfig(const QString& toolName) const = 0;
virtual void setToolConfig(const QString& toolName, const ToolConfig& config) = 0;
virtual async::Notification toolConfigChanged(const QString& toolName) const = 0;
virtual int flickableMaxVelocity() const = 0;
};
}

View file

@ -304,6 +304,11 @@ qreal UiTheme::itemOpacityDisabled() const
return m_itemOpacityDisabled;
}
int UiTheme::flickableMaxVelocity() const
{
return configuration()->flickableMaxVelocity();
}
void UiTheme::initUiFonts()
{
setupUiFonts();

View file

@ -77,6 +77,8 @@ class UiTheme : public QProxyStyle, public async::Asyncable
Q_PROPERTY(QFont musicalFont READ musicalFont NOTIFY themeChanged)
Q_PROPERTY(int flickableMaxVelocity READ flickableMaxVelocity CONSTANT)
public:
UiTheme();
@ -121,6 +123,8 @@ public:
qreal itemOpacityDisabled() const;
int flickableMaxVelocity() const;
void polish(QWidget* widget) override;
void unpolish(QWidget* widget) override;

View file

@ -262,12 +262,10 @@ Item {
color: mainItem.background.color
radius: 4
ListView {
StyledListView {
id: view
anchors.fill: parent
clip: true
boundsBehavior: Flickable.StopAtBounds
model: root.model

View file

@ -22,7 +22,7 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
ListView {
StyledListView {
id: root
property alias radioButtonGroup: buttonGroup

View file

@ -0,0 +1,32 @@
/*
* SPDX-License-Identifier: GPL-3.0-only
* MuseScore-CLA-applies
*
* MuseScore
* Music Composition & Notation
*
* Copyright (C) 2021 MuseScore BVBA and others
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick 2.15
import QtQuick.Controls 2.15
Flickable {
clip: true
boundsBehavior: Flickable.StopAtBounds
maximumFlickVelocity: ui.theme.flickableMaxVelocity
ScrollBar.vertical: StyledScrollBar {}
ScrollBar.horizontal: StyledScrollBar {}
}

View file

@ -0,0 +1,32 @@
/*
* SPDX-License-Identifier: GPL-3.0-only
* MuseScore-CLA-applies
*
* MuseScore
* Music Composition & Notation
*
* Copyright (C) 2021 MuseScore BVBA and others
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick 2.15
import QtQuick.Controls 2.15
GridView {
clip: true
boundsBehavior: Flickable.StopAtBounds
maximumFlickVelocity: ui.theme.flickableMaxVelocity
ScrollBar.vertical: StyledScrollBar {}
ScrollBar.horizontal: StyledScrollBar {}
}

View file

@ -0,0 +1,32 @@
/*
* SPDX-License-Identifier: GPL-3.0-only
* MuseScore-CLA-applies
*
* MuseScore
* Music Composition & Notation
*
* Copyright (C) 2021 MuseScore BVBA and others
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick 2.15
import QtQuick.Controls 2.15
ListView {
clip: true
boundsBehavior: Flickable.StopAtBounds
maximumFlickVelocity: ui.theme.flickableMaxVelocity
ScrollBar.vertical: StyledScrollBar {}
ScrollBar.horizontal: StyledScrollBar {}
}

View file

@ -168,7 +168,7 @@ Item {
}
}
ListView {
StyledListView {
id: view
anchors.top: header.bottom
@ -181,9 +181,6 @@ Item {
model: sortFilterProxyModel
clip: true
boundsBehavior: Flickable.StopAtBounds
property NavigationPanel navigation: NavigationPanel {
name: "ValueListPanel"
section: root.navigationSection

View file

@ -49,3 +49,6 @@ StyledDropShadow 1.0 StyledDropShadow.qml
VisibilityBox 1.0 VisibilityBox.qml
MenuMetrics 1.0 MenuMetrics.qml
Utils 1.0 Utils.js
StyledFlickable 1.0 StyledFlickable.qml
StyledListView 1.0 StyledListView.qml
StyledGridView 1.0 StyledGridView.qml

View file

@ -56,5 +56,8 @@
<file>qml/MuseScore/UiComponents/VisibilityBox.qml</file>
<file>qml/MuseScore/UiComponents/MenuMetrics.qml</file>
<file>qml/MuseScore/UiComponents/PageIndicator.qml</file>
<file>qml/MuseScore/UiComponents/StyledListView.qml</file>
<file>qml/MuseScore/UiComponents/StyledGridView.qml</file>
<file>qml/MuseScore/UiComponents/StyledFlickable.qml</file>
</qresource>
</RCC>

View file

@ -44,7 +44,7 @@ Rectangle {
}
}
Flickable {
StyledFlickable {
id: flickableArea
anchors.fill: parent
@ -56,10 +56,7 @@ Rectangle {
}
}
clip: true
flickableDirection: Flickable.VerticalFlick
boundsBehavior: Flickable.StopAtBounds
maximumFlickVelocity: 1000
contentHeight: contentColumn.childrenRect.height + 2 * contentColumn.anchors.margins

View file

@ -44,7 +44,7 @@ InspectorPropertyView {
radius: 3
}
GridView {
StyledGridView {
id: gridView
anchors.fill: parent
anchors.margins: 8
@ -65,12 +65,6 @@ InspectorPropertyView {
{ value: Beam.MODE_BEGIN64, iconCode: IconCode.BEAM_64, hint: qsTrc("inspector", "Begin 64") }
]
interactive: true
boundsBehavior: Flickable.StopAtBounds
clip: true
ScrollBar.vertical: StyledScrollBar {}
delegate: ListItemBlank {
implicitHeight: gridView.cellHeight
implicitWidth: gridView.cellWidth

View file

@ -46,7 +46,7 @@ InspectorPropertyView {
radius: 3
}
GridView {
StyledGridView {
id: gridView
anchors.fill: parent
anchors.margins: 8
@ -62,12 +62,6 @@ InspectorPropertyView {
id: noteheadGroupsModel
}
interactive: true
boundsBehavior: Flickable.StopAtBounds
clip: true
ScrollBar.vertical: StyledScrollBar {}
delegate: ListItemBlank {
id: delegateItem
implicitHeight: gridView.cellHeight

View file

@ -123,7 +123,7 @@ Item {
wrapMode: Text.WordWrap
}
Flickable {
StyledFlickable {
id: flickable
Layout.fillWidth: true
@ -132,12 +132,8 @@ Item {
contentWidth: width
contentHeight: instrumentsTreeView.height
clip: true
boundsBehavior: Flickable.StopAtBounds
interactive: height < contentHeight
ScrollBar.vertical: StyledScrollBar {}
TreeView {
id: instrumentsTreeView

View file

@ -114,7 +114,7 @@ Item {
}
}
ListView {
StyledListView {
id: groupsView
anchors.top: genreBox.bottom
@ -123,11 +123,6 @@ Item {
anchors.left: parent.left
anchors.right: parent.right
boundsBehavior: ListView.StopAtBounds
clip: true
ScrollBar.vertical: StyledScrollBar {}
delegate: ListItemBlank {
id: item

View file

@ -139,7 +139,7 @@ Item {
}
}
ListView {
StyledListView {
id: instrumentsView
anchors.top: operationsRow.bottom
@ -148,11 +148,6 @@ Item {
anchors.left: parent.left
anchors.right: parent.right
boundsBehavior: ListView.StopAtBounds
clip: true
ScrollBar.vertical: StyledScrollBar {}
model: instrumentsOnScore
delegate: ListItemBlank {

View file

@ -89,7 +89,7 @@ Item {
}
}
ListView {
StyledListView {
id: instrumentsView
anchors.top: searchField.bottom
@ -98,11 +98,6 @@ Item {
anchors.left: parent.left
anchors.right: parent.right
boundsBehavior: ListView.StopAtBounds
clip: true
ScrollBar.vertical: StyledScrollBar {}
model: root.instrumentsModel
delegate: ListItemBlank {

View file

@ -135,7 +135,7 @@ Item {
}
}
ListView {
StyledListView {
id: view
anchors.top: header.bottom
@ -145,10 +145,6 @@ Item {
model: filterModel
clip: true
boundsBehavior: Flickable.StopAtBounds
ScrollBar.vertical: StyledScrollBar {
parent: view.parent

View file

@ -67,7 +67,7 @@ FocusScope {
}
}
GridView {
StyledGridView {
id: view
readonly property int columns: Math.max(0, Math.floor(width / cellWidth))
@ -79,9 +79,6 @@ FocusScope {
topMargin: topGradient.height
clip: true
boundsBehavior: Flickable.StopAtBounds
readonly property real spacingBetweenColumns: 50
readonly property real spacingBetweenRows: 24

View file

@ -45,14 +45,11 @@ Item {
selectionFilterModel.load()
}
ListView {
StyledListView {
anchors.fill: parent
anchors.margins: 12
boundsBehavior: Flickable.StopAtBounds
clip: true
spacing: 12
ScrollBar.vertical: StyledScrollBar {}
spacing: 12
model: SelectionFilterModel {
id: selectionFilterModel

View file

@ -26,14 +26,11 @@ import MuseScore.Ui 1.0
import MuseScore.UiComponents 1.0
import MuseScore.NotationScene 1.0
ListView {
StyledListView {
id: root
spacing: 0
boundsBehavior: Flickable.StopAtBounds
clip: true
signal selectRowRequested(int index)
signal clearSelectionRequested()
@ -78,8 +75,6 @@ ListView {
property var currentItemNavigationName: []
}
ScrollBar.vertical: StyledScrollBar {}
delegate: ListItemBlank {
id: itemDelegate

View file

@ -69,13 +69,12 @@ Rectangle {
anchors.bottom: parent.bottom
width: Math.min(contentWidth, parent.width)
clip: true
model: notationSwitchModel
currentIndex: 0
spacing: 0
interactive: width < contentWidth
boundsBehavior: Flickable.StopAtBounds
delegate: NotationSwitchButton {
id: button

View file

@ -65,7 +65,7 @@ Item {
SeparatorLine { anchors.margins: -prv.sideMargin }
}
ListView {
StyledListView {
id: view
anchors.top: header.bottom
@ -76,9 +76,7 @@ Item {
model: root.model
boundsBehavior: Flickable.StopAtBounds
interactive: height < contentHeight
clip: true
property NavigationPanel navigationPanel: NavigationPanel {
name: "PartsView"

View file

@ -86,22 +86,17 @@ StyledPopup {
wrapMode: Text.WordWrap
}
ListView {
StyledListView {
id: palettesList
spacing: 8
readonly property int availableHeight:
root.maxHeight - header.height - createCustomPaletteButton.height - 2 * contentColumn.spacing
height: Math.min(availableHeight, contentHeight)
width: parent.width
readonly property int availableHeight:
root.maxHeight - header.height - createCustomPaletteButton.height - 2 * contentColumn.spacing
spacing: 8
visible: count > 0
clip: true
boundsBehavior: Flickable.StopAtBounds
ScrollBar.vertical: StyledScrollBar {}
delegate: Item {
id: morePalettesDelegate

View file

@ -30,12 +30,8 @@ import MuseScore.Ui 1.0
import "utils.js" as Utils
GridView {
StyledGridView {
id: paletteView
clip: true
interactive: height < contentHeight // TODO: check if it helps on Mac
boundsBehavior: Flickable.StopAtBounds
property size cellSize
property bool drawGrid: false
@ -59,6 +55,8 @@ GridView {
property int navigationRow: 0
property int navigationCol: 1
interactive: height < contentHeight // TODO: check if it helps on Mac
states: [
State {
name: "default"

View file

@ -30,7 +30,7 @@ import MuseScore.UiComponents 1.0
import "utils.js" as Utils
ListView {
StyledListView {
id: paletteTree
property PaletteProvider paletteProvider
@ -154,11 +154,6 @@ ListView {
NumberAnimation { property: "y"; duration: 150 }
}
ScrollBar.vertical: StyledScrollBar {}
boundsBehavior: Flickable.StopAtBounds
maximumFlickVelocity: 1500
PlaceholderManager {
id: placeholder
delegateModel: paletteTreeDelegateModel

View file

@ -58,7 +58,7 @@ Rectangle {
}
}
Flickable {
StyledFlickable {
id: flickable
function positionViewAtEnd() {
@ -75,9 +75,6 @@ Rectangle {
anchors.fill: parent
clip: true
boundsBehavior: Flickable.StopAtBounds
contentWidth: contentColumn.width + 1 // for trailing separator
contentHeight: Math.max(contentColumn.height, height)
interactive: height < contentHeight || width < contentWidth

View file

@ -96,7 +96,7 @@ Item {
}
}
Flickable {
StyledFlickable {
id: flickable
anchors.top: parent.top
@ -112,9 +112,6 @@ Item {
topMargin: topGradient.height
bottomMargin: 24
clip: true
boundsBehavior: Flickable.StopAtBounds
ScrollBar.vertical: StyledScrollBar {
parent: flickable.parent

View file

@ -48,16 +48,12 @@ Rectangle {
direction: NavigationPanel.Vertical
}
ListView {
StyledListView {
id: listView
anchors.fill: parent
anchors.margins: root.border.width
boundsBehavior: Flickable.StopAtBounds
clip: true
ScrollBar.vertical: StyledScrollBar {}
delegate: ListItemBlank {
mouseArea.hoverEnabled: false
hoverHitColor: "transparent"

View file

@ -26,7 +26,7 @@ import MuseScore.Ui 1.0
import MuseScore.UiComponents 1.0
import MuseScore.Project 1.0
GridView {
StyledGridView {
id: root
property string backgroundColor: ui.theme.backgroundPrimaryColor
@ -38,8 +38,7 @@ GridView {
readonly property int sideMargin: 30
clip: true
boundsBehavior: Flickable.StopAtBounds
flickableDirection: Flickable.VerticalFlick
cellHeight: 334
cellWidth: sideMargin + 172 + sideMargin

View file

@ -119,9 +119,6 @@ FlatButton {
model: root.model.tempoNotes()
clip: true
boundsBehavior: ListView.StopAtBounds
delegate: FlatRadioButton {
width: 48
height: width

View file

@ -78,7 +78,7 @@ Item {
width: parent.width
}
ListView {
StyledListView {
id: view
anchors.top: searchEnabled ? searchField.bottom : title.bottom
@ -88,9 +88,6 @@ Item {
width: parent.width
spacing: 0
boundsBehavior: ListView.StopAtBounds
clip: true
currentIndex: 0
delegate: ListItemBlank {

View file

@ -45,12 +45,11 @@ RadioButtonGroup {
}
}
clip: true
spacing: 0
interactive: height < contentHeight
boundsBehavior: Flickable.StopAtBounds
orientation: Qt.Vertical
interactive: height < contentHeight
function focusOnSelected() {
if (prv.selectedWorkspace) {
prv.selectedWorkspace.navigation.requestActive()
@ -72,8 +71,6 @@ RadioButtonGroup {
}
}
ScrollBar.vertical: StyledScrollBar {}
Connections {
target: root.model