From 27a8f22c601b944181c14eb15d94e09f8fe15859 Mon Sep 17 00:00:00 2001 From: atouu <67765922+atouu@users.noreply.github.com> Date: Tue, 16 Jun 2026 21:12:25 +0800 Subject: [PATCH 1/2] Change detach pianoroll default to true --- OpenUtau.Core/Util/Preferences.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenUtau.Core/Util/Preferences.cs b/OpenUtau.Core/Util/Preferences.cs index 46aa926f1..c963d45c2 100644 --- a/OpenUtau.Core/Util/Preferences.cs +++ b/OpenUtau.Core/Util/Preferences.cs @@ -250,7 +250,7 @@ public class SerializablePreferences { errors.txt "; public string RecoveryPath = string.Empty; - public bool DetachPianoRoll = false; + public bool DetachPianoRoll = true; // ----- Mix FX (post-processing) ----- // Per-track FX state lives in UTrack.MixFx and the project ustx. From 6986cf52c55d80c3d0950014ac97b51e27dd608b Mon Sep 17 00:00:00 2001 From: atouu <67765922+atouu@users.noreply.github.com> Date: Tue, 16 Jun 2026 21:13:01 +0800 Subject: [PATCH 2/2] Add pianoroll attachment toggle in preferences appearance --- OpenUtau/Controls/PianoRoll.axaml.cs | 13 +++++++++++-- OpenUtau/Strings/Strings.axaml | 1 + OpenUtau/ViewModels/PreferencesViewModel.cs | 8 ++++++++ OpenUtau/Views/MainWindow.axaml.cs | 13 +++++-------- OpenUtau/Views/PreferencesDialog.axaml | 4 ++++ 5 files changed, 29 insertions(+), 10 deletions(-) diff --git a/OpenUtau/Controls/PianoRoll.axaml.cs b/OpenUtau/Controls/PianoRoll.axaml.cs index abdb081b3..b2cdcf051 100644 --- a/OpenUtau/Controls/PianoRoll.axaml.cs +++ b/OpenUtau/Controls/PianoRoll.axaml.cs @@ -219,6 +219,14 @@ await MessageBox.ShowProcessing(RootWindow, $"{name} - ? / ?", } }); + MessageBus.Current.Listen() + .Subscribe(e => { + if(e.refreshItem == "Attachment") { + MainWindow?.SetPianoRollAttachment(); + ViewModel.RaisePropertyChanged(nameof(ViewModel.PianoRollDetached)); + } + }); + DocManager.Inst.AddSubscriber(this); } @@ -330,8 +338,9 @@ void OnMenuSearchNote(object sender, RoutedEventArgs args) { } void OnMenuDetachPianoRoll(object sender, RoutedEventArgs args) { - MainWindow?.SetPianoRollAttachment(); - ViewModel.RaisePropertyChanged(nameof(ViewModel.PianoRollDetached)); + Preferences.Default.DetachPianoRoll ^= true; + Preferences.Save(); + MessageBus.Current.SendMessage(new PianorollRefreshEvent("Attachment")); } void OnMenuHidePianoRoll(object sender, RoutedEventArgs args) { diff --git a/OpenUtau/Strings/Strings.axaml b/OpenUtau/Strings/Strings.axaml index 7c08bab77..b43096d13 100644 --- a/OpenUtau/Strings/Strings.axaml +++ b/OpenUtau/Strings/Strings.axaml @@ -571,6 +571,7 @@ Warning: this option removes custom presets. Show other tracks' notes on piano roll Show icon on piano roll Show portrait on piano roll + Show piano roll in separate window Singer name display language Theme Dark diff --git a/OpenUtau/ViewModels/PreferencesViewModel.cs b/OpenUtau/ViewModels/PreferencesViewModel.cs index 9db829b46..ce60bb44c 100644 --- a/OpenUtau/ViewModels/PreferencesViewModel.cs +++ b/OpenUtau/ViewModels/PreferencesViewModel.cs @@ -100,6 +100,7 @@ public int SafeMaxThreadCount { [Reactive] public bool ShowPortrait { get; set; } [Reactive] public bool ShowIcon { get; set; } [Reactive] public bool ShowGhostNotes { get; set; } + [Reactive] public bool DetachPianoRoll { get; set; } [Reactive] public bool ThemeEditable { get; set; } public List ThemeItems => ThemeManager.GetAvailableThemes(); public bool IsThemeEditorOpen => Views.ThemeEditorWindow.IsOpen; @@ -183,6 +184,7 @@ public PreferencesViewModel() { ShowPortrait = Preferences.Default.ShowPortrait; ShowIcon = Preferences.Default.ShowIcon; ShowGhostNotes = Preferences.Default.ShowGhostNotes; + DetachPianoRoll = Preferences.Default.DetachPianoRoll; Beta = Preferences.Default.Beta; LyricsHelper = LyricsHelpers.FirstOrDefault(option => option.klass.Equals(ActiveLyricsHelper.Inst.GetPreferred())); LyricsHelperBrackets = Preferences.Default.LyricsHelperBrackets; @@ -305,6 +307,12 @@ public PreferencesViewModel() { Preferences.Save(); MessageBus.Current.SendMessage(new PianorollRefreshEvent("Part")); }); + this.WhenAnyValue(vm => vm.DetachPianoRoll) + .Subscribe(detachPianoRoll => { + Preferences.Default.DetachPianoRoll = detachPianoRoll; + Preferences.Save(); + MessageBus.Current.SendMessage(new PianorollRefreshEvent("Attachment")); + }); this.WhenAnyValue(vm => vm.Beta) .Subscribe(beta => { Preferences.Default.Beta = beta; diff --git a/OpenUtau/Views/MainWindow.axaml.cs b/OpenUtau/Views/MainWindow.axaml.cs index 5ea4cdb0c..521e81153 100644 --- a/OpenUtau/Views/MainWindow.axaml.cs +++ b/OpenUtau/Views/MainWindow.axaml.cs @@ -1223,21 +1223,18 @@ public void SetPianoRollAttachment() { return; } if (Preferences.Default.DetachPianoRoll) { - pianoRollWindow?.ForceClose(); - pianoRollWindow = null; - PianoRollContainer.Content = pianoRoll; - viewModel.ShowPianoRoll = true; - Preferences.Default.DetachPianoRoll = false; - } else { PianoRollContainer.Content = null; viewModel.ShowPianoRoll = false; if (pianoRollWindow == null) { pianoRollWindow = new(pianoRoll); pianoRollWindow.Show(); } - Preferences.Default.DetachPianoRoll = true; + } else { + pianoRollWindow?.ForceClose(); + pianoRollWindow = null; + PianoRollContainer.Content = pianoRoll; + viewModel.ShowPianoRoll = true; } - Preferences.Save(); } public void MainPagePointerWheelChanged(object sender, PointerWheelEventArgs args) { diff --git a/OpenUtau/Views/PreferencesDialog.axaml b/OpenUtau/Views/PreferencesDialog.axaml index e116bbe34..9779a5b8d 100644 --- a/OpenUtau/Views/PreferencesDialog.axaml +++ b/OpenUtau/Views/PreferencesDialog.axaml @@ -269,6 +269,10 @@ + + + +