Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions OpenUtau.Core/Util/Preferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public class SerializablePreferences {
public int PlaybackAutoScroll = 2;
public bool ReverseLogOrder = true;
public bool ShowPortrait = true;
public bool ShowIcon = true;
public bool ShowGhostNotes = true;
public bool PlayTone = true;
public bool ShowVibrato = true;
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ Warning: this option removes custom presets.</system:String>
<system:String x:Key="prefs.appearance.degree.solfege">Solfège (do re mi fa sol la ti)</system:String>
<system:String x:Key="prefs.appearance.lang">Language</system:String>
<system:String x:Key="prefs.appearance.showghostnotes">Show other tracks' notes on piano roll</system:String>
<system:String x:Key="prefs.appearance.showicon">Show icon on piano roll</system:String>
<system:String x:Key="prefs.appearance.showportrait">Show portrait on piano roll</system:String>
<system:String x:Key="prefs.appearance.sortorder">Singer name display language</system:String>
<system:String x:Key="prefs.appearance.theme">Theme</system:String>
Expand Down
2 changes: 1 addition & 1 deletion OpenUtau/ViewModels/NotesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ private void LoadPortrait(UPart? part, UProject? project) {
lock (portraitLock) {
Avatar?.Dispose();
Avatar = null;
if (singer != null && singer.AvatarData != null) {
if (singer != null && singer.AvatarData != null && Preferences.Default.ShowIcon) {
try {
using (var stream = new MemoryStream(singer.AvatarData)) {
Avatar = new Bitmap(stream);
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/ViewModels/PianoRollViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class PianoRollViewModel : ViewModelBase, ICmdSubscriber {
[Reactive] public PlaybackViewModel? PlaybackViewModel { get; set; }

public bool ShowPortrait { get => Preferences.Default.ShowPortrait; }
public bool ShowIcon { get => Preferences.Default.ShowIcon; }
public bool ShowGhostNotes { get => Preferences.Default.ShowGhostNotes; }
public bool UseTrackColor { get => Preferences.Default.UseTrackColor; }
public bool DegreeStyle0 { get => Preferences.Default.DegreeStyle == 0 ? true : false; }
Expand Down
8 changes: 8 additions & 0 deletions OpenUtau/ViewModels/PreferencesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public AudioOutputDevice? AudioOutputDevice {
[Reactive] public int DegreeStyle { get; set; }
[Reactive] public bool UseTrackColor { get; set; }
[Reactive] public bool ShowPortrait { get; set; }
[Reactive] public bool ShowIcon { get; set; }
[Reactive] public bool ShowGhostNotes { get; set; }
[Reactive] public int OtoEditor { get; set; }
public string VLabelerPath => Preferences.Default.VLabelerPath;
Expand Down Expand Up @@ -140,6 +141,7 @@ public PreferencesViewModel() {
DegreeStyle = Preferences.Default.DegreeStyle;
UseTrackColor = Preferences.Default.UseTrackColor;
ShowPortrait = Preferences.Default.ShowPortrait;
ShowIcon = Preferences.Default.ShowIcon;
ShowGhostNotes = Preferences.Default.ShowGhostNotes;
Beta = Preferences.Default.Beta;
LyricsHelper = LyricsHelpers.FirstOrDefault(option => option.klass.Equals(ActiveLyricsHelper.Inst.GetPreferred()));
Expand Down Expand Up @@ -227,6 +229,12 @@ public PreferencesViewModel() {
Preferences.Save();
MessageBus.Current.SendMessage(new PianorollRefreshEvent("Portrait"));
});
this.WhenAnyValue(vm => vm.ShowIcon)
.Subscribe(showIcon => {
Preferences.Default.ShowIcon = showIcon;
Preferences.Save();
MessageBus.Current.SendMessage(new PianorollRefreshEvent("Portrait"));
});
this.WhenAnyValue(vm => vm.ShowGhostNotes)
.Subscribe(showGhostNotes => {
Preferences.Default.ShowGhostNotes = showGhostNotes;
Expand Down
5 changes: 5 additions & 0 deletions OpenUtau/Views/PianoRollWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@
<CheckBox IsChecked="{Binding ShowPortrait}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{DynamicResource prefs.appearance.showicon}" Click="OnMenuShowIcon">
<MenuItem.Icon>
<CheckBox IsChecked="{Binding ShowIcon}" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{DynamicResource prefs.appearance.showghostnotes}" Click="OnMenuShowGhostNotes">
<MenuItem.Icon>
<CheckBox IsChecked="{Binding ShowGhostNotes}" />
Expand Down
6 changes: 6 additions & 0 deletions OpenUtau/Views/PianoRollWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ void OnMenuShowPortrait(object sender, RoutedEventArgs args) {
ViewModel.RaisePropertyChanged(nameof(ViewModel.ShowPortrait));
MessageBus.Current.SendMessage(new PianorollRefreshEvent("Portrait"));
}
void OnMenuShowIcon(object sender, RoutedEventArgs args) {
Preferences.Default.ShowIcon = !Preferences.Default.ShowIcon;
Preferences.Save();
ViewModel.RaisePropertyChanged(nameof(ViewModel.ShowIcon));
MessageBus.Current.SendMessage(new PianorollRefreshEvent("Portrait"));
}
void OnMenuShowGhostNotes(object sender, RoutedEventArgs args) {
Preferences.Default.ShowGhostNotes = !Preferences.Default.ShowGhostNotes;
Preferences.Save();
Expand Down
4 changes: 4 additions & 0 deletions OpenUtau/Views/PreferencesDialog.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@
<TextBlock Text="{DynamicResource prefs.appearance.showportrait}" HorizontalAlignment="Left"/>
<ToggleSwitch IsChecked="{Binding ShowPortrait}"/>
</Grid>
<Grid Margin="0,5,0,0">
<TextBlock Text="{DynamicResource prefs.appearance.showicon}" HorizontalAlignment="Left"/>
<ToggleSwitch IsChecked="{Binding ShowIcon}"/>
</Grid>
<Grid>
<TextBlock Text="{DynamicResource prefs.appearance.showghostnotes}" HorizontalAlignment="Left"/>
<ToggleSwitch IsChecked="{Binding ShowGhostNotes}"/>
Expand Down