Skip to content

Commit 16e11a7

Browse files
committed
Divide column settings into Instrument, Timing, and MIDI Effects tabs
1 parent 2cd2ccd commit 16e11a7

11 files changed

+136
-43
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Bug fixes:
2424

2525
Other:
2626

27+
* Divide column settings into Instrument, Timing, and MIDI Effects tabs
28+
2729
2.0.0
2830
=====
2931

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ set(QML_SOURCE_FILES
224224
${QML_BASE_DIR}/Dialogs/AddMidiCcSettingDialog.qml
225225
${QML_BASE_DIR}/Dialogs/AddPitchBendAutomationDialog.qml
226226
${QML_BASE_DIR}/Dialogs/ColumnSettingsDialog.qml
227+
${QML_BASE_DIR}/Dialogs/ColumnSettingsDialog_InstrumentSettings.qml
227228
${QML_BASE_DIR}/Dialogs/ColumnSettingsDialog_MidiEffects.qml
229+
${QML_BASE_DIR}/Dialogs/ColumnSettingsDialog_TimingSettings.qml
228230
${QML_BASE_DIR}/Dialogs/DelayCalculatorDialog.qml
229231
${QML_BASE_DIR}/Dialogs/DeleteUnusedPatternsDialog.qml
230232
${QML_BASE_DIR}/Dialogs/EditMidiCcAutomationsDelegate.qml

src/common/constants.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ QString webSiteUrl();
3838
size_t defaultPatternLineCount();
3939
size_t defaultTrackCount();
4040

41+
int transposeMin();
42+
int transposeMax();
43+
4144
namespace NahdXml {
4245

4346
QString xmlKeyFileFormatVersion();

src/view/qml/Constants.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ QtObject {
1616
readonly property int trackBorderFocusedWidth: 2
1717
readonly property int trackHeaderHeight: 40
1818

19+
readonly property int transposeMin: -48
20+
readonly property int transposeMax: 48
21+
1922
readonly property int positionBarBorderWidth: 1
2023
readonly property double positionBarOpacity: 0.25
2124
}

src/view/qml/Dialogs/ColumnSettingsDialog.qml

Lines changed: 47 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ Dialog {
1111
title: "<strong>" + qsTr("Column settings for track %1, column %2").arg(columnSettingsModel.trackIndex + 1).arg(columnSettingsModel.columnIndex + 1) + "</strong>"
1212
modal: true
1313
function initialize() {
14-
delaySpinBox.value = columnSettingsModel.delay;
15-
transposeSpinBox.value = columnSettingsModel.transpose;
14+
instrumentSettings.initialize();
15+
timingSettings.initialize();
1616
midiEffects.initialize();
17+
tabBar.currentIndex = 0;
1718
}
1819
function saveSettings() {
1920
columnSettingsModel.save();
@@ -42,51 +43,60 @@ Dialog {
4243
anchors.fill: parent
4344
spacing: 10
4445

45-
GroupBox {
46-
title: qsTr("General")
47-
Layout.fillWidth: true
46+
StackLayout {
47+
height: parent.height - tabBar.height - parent.spacing
4848
width: parent.width
49+
currentIndex: tabBar.currentIndex
4950

50-
RowLayout {
51-
spacing: 10
52-
Label {
53-
text: qsTr("Transpose:")
54-
}
55-
SpinBox {
56-
id: transposeSpinBox
57-
from: -48
58-
to: 48
59-
editable: true
60-
Keys.onReturnPressed: focus = false
61-
onValueModified: columnSettingsModel.transpose = value
51+
ScrollView {
52+
id: instrumentScrollView
53+
clip: true
54+
ScrollBar.vertical.policy: ScrollBar.AsNeeded
55+
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
56+
rightPadding: 10
57+
ColumnSettingsDialog_InstrumentSettings {
58+
id: instrumentSettings
59+
width: instrumentScrollView.availableWidth
6260
}
6361
}
64-
}
6562

66-
GroupBox {
67-
title: qsTr("Timing")
68-
Layout.fillWidth: true
69-
width: parent.width
70-
71-
RowLayout {
72-
spacing: 10
73-
Label {
74-
text: qsTr("Delay (ms):")
63+
ScrollView {
64+
id: timingScrollView
65+
clip: true
66+
ScrollBar.vertical.policy: ScrollBar.AsNeeded
67+
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
68+
rightPadding: 10
69+
ColumnSettingsDialog_TimingSettings {
70+
id: timingSettings
71+
width: timingScrollView.availableWidth
7572
}
76-
SpinBox {
77-
id: delaySpinBox
78-
from: -10000
79-
to: 10000
80-
editable: true
81-
Keys.onReturnPressed: focus = false
82-
onValueModified: columnSettingsModel.delay = value
73+
}
74+
75+
ScrollView {
76+
id: midiEffectsScrollView
77+
clip: true
78+
ScrollBar.vertical.policy: ScrollBar.AsNeeded
79+
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
80+
rightPadding: 10
81+
ColumnSettingsDialog_MidiEffects {
82+
id: midiEffects
83+
width: midiEffectsScrollView.availableWidth
8384
}
8485
}
8586
}
8687

87-
ColumnSettingsDialog_MidiEffects {
88-
id: midiEffects
89-
Layout.fillWidth: true
88+
TabBar {
89+
id: tabBar
90+
width: parent.width
91+
TabButton {
92+
text: qsTr("Instrument")
93+
}
94+
TabButton {
95+
text: qsTr("Timing")
96+
}
97+
TabButton {
98+
text: qsTr("MIDI Effects")
99+
}
90100
}
91101
}
92102

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import QtQuick 2.15
2+
import QtQuick.Controls 2.15
3+
import QtQuick.Controls.Universal 2.15
4+
import QtQuick.Layouts
5+
import ".."
6+
import "../Components"
7+
8+
GroupBox {
9+
title: qsTr("Instrument")
10+
Layout.fillWidth: true
11+
width: parent.width
12+
13+
function initialize() {
14+
transposeSpinBox.value = columnSettingsModel.transpose;
15+
}
16+
17+
RowLayout {
18+
spacing: 10
19+
Label {
20+
text: qsTr("Transpose:")
21+
}
22+
SpinBox {
23+
id: transposeSpinBox
24+
from: Constants.transposeMin
25+
to: Constants.transposeMax
26+
editable: true
27+
Keys.onReturnPressed: focus = false
28+
onValueModified: columnSettingsModel.transpose = value
29+
}
30+
}
31+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import QtQuick 2.15
2+
import QtQuick.Controls 2.15
3+
import QtQuick.Controls.Universal 2.15
4+
import QtQuick.Layouts
5+
import ".."
6+
import "../Components"
7+
8+
GroupBox {
9+
title: qsTr("Timing")
10+
Layout.fillWidth: true
11+
width: parent.width
12+
13+
function initialize() {
14+
delaySpinBox.value = columnSettingsModel.delay;
15+
}
16+
17+
RowLayout {
18+
spacing: 10
19+
Label {
20+
text: qsTr("Delay (ms):")
21+
}
22+
SpinBox {
23+
id: delaySpinBox
24+
from: -10000
25+
to: 10000
26+
editable: true
27+
Keys.onReturnPressed: focus = false
28+
onValueModified: columnSettingsModel.delay = value
29+
}
30+
}
31+
}

src/view/qml/Dialogs/TrackSettingsDialog_InstrumentSettings.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ ColumnLayout {
245245
}
246246
SpinBox {
247247
id: transposeSpinBox
248-
from: -24
249-
to: 24
248+
from: Constants.transposeMin
249+
to: Constants.transposeMax
250250
editable: true
251251
Layout.column: 2
252252
Layout.row: 5

src/view/qml/Editor/MainContextMenu_Column.qml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import "../Components"
66
Menu {
77
title: qsTr("Column")
88
width: rootItem.width
9+
Action {
10+
text: qsTr("Settings")
11+
onTriggered: UiService.requestColumnSettingsDialog(editorService.position.track, editorService.position.column)
12+
}
13+
MenuSeparator {}
914
Action {
1015
text: qsTr("Cut")
1116
shortcut: "Alt+F3"

src/view/qml/Editor/MainContextMenu_Track.qml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import "../Components"
66
Menu {
77
title: qsTr("Track")
88
width: rootItem.width
9+
Action {
10+
text: qsTr("Settings")
11+
onTriggered: UiService.requestTrackSettingsDialog(editorService.position.track)
12+
}
13+
MenuSeparator {}
914
Action {
1015
text: qsTr("Cut")
1116
shortcut: "Shift+F3"

0 commit comments

Comments
 (0)