Skip to content

Commit

Permalink
Fix global N cycles control and focus releasing bugs (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderVocke committed Jun 25, 2024
1 parent 947e0da commit 2415879
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/shoopdaloop/lib/qml/AppControls.qml
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,12 @@ Item {
value: registries.state_registry.apply_n_cycles
from: -1

editable: true
valueFromText: function(text, locale) {
release_focus_notifier.notify()
return Number.fromLocaleString(locale, text);
}

onValueModified: {
if (value != registries.state_registry.apply_n_cycles) {
registries.state_registry.set_apply_n_cycles(value)
Expand Down
2 changes: 1 addition & 1 deletion src/shoopdaloop/lib/qml/DetailsPane.qml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Item {
bottom: parent.bottom
}

ScrollView {
FocusReleasingScrollView {
anchors.fill: parent
ScrollBar.vertical.policy: ScrollBar.AsNeeded
ScrollBar.horizontal.policy: ScrollBar.AsNeeded
Expand Down
15 changes: 15 additions & 0 deletions src/shoopdaloop/lib/qml/FocusReleasingScrollView.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import QtQuick 6.6
import QtQuick.Controls 6.6
import QtQuick.Controls.Material 6.6

ScrollView {
id: root

MouseArea {
x: 0
y: 0
width: Math.max(root.contentWidth, root.width)
height: Math.max(root.contentHeight, root.height)
onClicked: release_focus_notifier.notify()
}
}
4 changes: 2 additions & 2 deletions src/shoopdaloop/lib/qml/TracksWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "../generate_session.js" as GenerateSession

import ShoopDaLoop.PythonLogger

ScrollView {
FocusReleasingScrollView {
ScrollBar.horizontal.policy: ScrollBar.horizontal.size < 1.0 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AlwaysOff
ScrollBar.horizontal.height: 10
Expand Down Expand Up @@ -134,7 +134,7 @@ ScrollView {
Component.onCompleted: initialize()
function reload() { initialize() }

ScrollView {
FocusReleasingScrollView {
id: tracks_view
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.vertical.size < 1.0 ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff;
Expand Down

0 comments on commit 2415879

Please sign in to comment.