Skip to content

Commit

Permalink
fix type, no need for a dedicated namespace for PropertyEditors
Browse files Browse the repository at this point in the history
  • Loading branch information
oxygen-dioxide committed Dec 18, 2024
1 parent 5b4f82f commit 00c7c0f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion OpenUtau/Controls/PropertyEditors/FloatEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Avalonia.Interactivity;
using ReactiveUI;

namespace OpenUtau.Controls.PropertyEditors{
namespace OpenUtau.Controls{
public class FloatEditor : TextBox
{
protected override Type StyleKeyOverride => typeof(TextBox);
Expand Down
4 changes: 2 additions & 2 deletions OpenUtau/Controls/PropertyEditors/IntEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Avalonia.Interactivity;
using ReactiveUI;

namespace OpenUtau.Controls.PropertyEditors{
namespace OpenUtau.Controls{
public class IntEditor : TextBox
{
protected override Type StyleKeyOverride => typeof(TextBox);
Expand Down Expand Up @@ -53,7 +53,7 @@ protected void OnTextChanged(string? newText)

protected override void OnLostFocus(RoutedEventArgs e) {
base.OnLostFocus(e);
if (!float.TryParse(Text, out float newValue))
if (!int.TryParse(Text, out int newValue))
{
Text = Value.ToString();
}
Expand Down
8 changes: 4 additions & 4 deletions OpenUtau/Views/ExpressionsDialog.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:OpenUtau.App.ViewModels"
xmlns:pe="using:OpenUtau.Controls.PropertyEditors"
xmlns:c="using:OpenUtau.Controls"
mc:Ignorable="d"
x:Class="OpenUtau.App.Views.ExpressionsDialog"
Icon="/Assets/open-utau.ico"
Expand Down Expand Up @@ -67,15 +67,15 @@
</Grid>
<Grid IsVisible="{Binding Expression.ShowNumbers}">
<Label Content="{DynamicResource exps.minvalue}" Width="130" HorizontalAlignment="Left"/>
<pe:FloatEditor Margin="140,0,0,4" IsEnabled="{Binding Expression.IsCustom}" Text="{Binding Expression.Min}"/>
<c:FloatEditor Margin="140,0,0,4" IsEnabled="{Binding Expression.IsCustom}" Text="{Binding Expression.Min}"/>
</Grid>
<Grid IsVisible="{Binding Expression.ShowNumbers}">
<Label Content="{DynamicResource exps.maxvalue}" Width="130" HorizontalAlignment="Left"/>
<pe:FloatEditor Margin="140,0,0,4" IsEnabled="{Binding Expression.IsCustom}" Text="{Binding Expression.Max}"/>
<c:FloatEditor Margin="140,0,0,4" IsEnabled="{Binding Expression.IsCustom}" Text="{Binding Expression.Max}"/>
</Grid>
<Grid IsVisible="{Binding Expression.ShowNumbers}">
<Label Content="{DynamicResource exps.defaultvalue}" Width="130" HorizontalAlignment="Left"/>
<pe:FloatEditor Margin="140,0,0,4" Value="{Binding Expression.DefaultValue}"/>
<c:FloatEditor Margin="140,0,0,4" Value="{Binding Expression.DefaultValue}"/>
</Grid>
<Grid IsVisible="{Binding Expression.IsOptions}">
<Label Content="{DynamicResource exps.optionvalues}" Width="130" HorizontalAlignment="Left"/>
Expand Down
24 changes: 12 additions & 12 deletions OpenUtau/Views/NoteDefaultsDialog.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:OpenUtau.App.ViewModels"
xmlns:pe="using:OpenUtau.Controls.PropertyEditors"
xmlns:c="using:OpenUtau.Controls"
mc:Ignorable="d" d:DesignWidth="600" d:DesignHeight="500"
x:Class="OpenUtau.App.Views.NoteDefaultsDialog"
Icon="/Assets/open-utau.ico"
Expand Down Expand Up @@ -42,13 +42,13 @@
</Grid>
<Grid ColumnDefinitions="180,20,50,20,*">
<Label Content="{DynamicResource notedefaults.portamento.length}"/>
<pe:IntEditor Grid.Column="2" Value="{Binding CurrentPortamentoLength}" />
<c:IntEditor Grid.Column="2" Value="{Binding CurrentPortamentoLength}" />
<Slider Grid.Column="4" Classes="fader" Value="{Binding CurrentPortamentoLength}" Minimum="2" Maximum="320"
TickPlacement="BottomRight" TickFrequency="1" IsSnapToTickEnabled="true" />
</Grid>
<Grid ColumnDefinitions="180,20,50,20,*">
<Label Content="{DynamicResource notedefaults.portamento.start}"/>
<pe:IntEditor Grid.Column="2" Value="{Binding CurrentPortamentoStart}" />
<c:IntEditor Grid.Column="2" Value="{Binding CurrentPortamentoStart}" />
<Slider Grid.Column="4" Classes="fader" Value="{Binding CurrentPortamentoStart}" Minimum="-200" Maximum="200"
TickPlacement="BottomRight" TickFrequency="1" IsSnapToTickEnabled="true" />
</Grid>
Expand All @@ -69,51 +69,51 @@
</Grid>
<Grid ColumnDefinitions="180,20,50,20,*">
<Label Content="{DynamicResource notedefaults.vibrato.length}"/>
<pe:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoLength}" />
<c:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoLength}" />
<Slider Grid.Column="4" Classes="fader" Value="{Binding CurrentVibratoLength}" Minimum="0" Maximum="100"
TickPlacement="BottomRight" TickFrequency="0.1" IsSnapToTickEnabled="true" />
</Grid>
<Grid ColumnDefinitions="180,20,50,20,*">
<Label Content="{DynamicResource notedefaults.vibrato.period}"/>
<pe:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoPeriod}" />
<c:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoPeriod}" />
<Slider Grid.Column="4" Classes="fader" Value="{Binding CurrentVibratoPeriod}" Minimum="5" Maximum="500"
TickPlacement="BottomRight" TickFrequency="0.1" IsSnapToTickEnabled="true" />
</Grid>
<Grid ColumnDefinitions="180,20,50,20,*">
<Label Content="{DynamicResource notedefaults.vibrato.depth}"/>
<pe:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoDepth}" />
<c:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoDepth}" />
<Slider Grid.Column="4" Classes="fader" Value="{Binding CurrentVibratoDepth}" Minimum="5" Maximum="200"
TickPlacement="BottomRight" TickFrequency="0.1" IsSnapToTickEnabled="true" />
</Grid>
<Grid ColumnDefinitions="*,20,*">
<Grid Grid.Column="0" ColumnDefinitions="70,10,40,20,*">
<Label Content="{DynamicResource notedefaults.vibrato.in}"/>
<pe:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoIn}" />
<c:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoIn}" />
<Slider Grid.Column="4" Classes="fader" Value="{Binding CurrentVibratoIn}" Minimum="0" Maximum="100"
TickPlacement="BottomRight" TickFrequency="0.1" IsSnapToTickEnabled="true" />
</Grid>
<Grid Grid.Column="2" ColumnDefinitions="70,10,40,20,*">
<Label Content="{DynamicResource notedefaults.vibrato.out}"/>
<pe:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoOut}" />
<c:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoOut}" />
<Slider Grid.Column="4" Classes="fader" Value="{Binding CurrentVibratoOut}" Minimum="0" Maximum="100"
TickPlacement="BottomRight" TickFrequency="0.1" IsSnapToTickEnabled="true" />
</Grid>
</Grid>
<Grid ColumnDefinitions="180,20,50,20,*">
<Label Content="{DynamicResource notedefaults.vibrato.shift}"/>
<pe:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoShift}" />
<c:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoShift}" />
<Slider Grid.Column="4" Classes="fader" Value="{Binding CurrentVibratoShift}" Minimum="0" Maximum="100"
TickPlacement="BottomRight" TickFrequency="0.1" IsSnapToTickEnabled="true" />
</Grid>
<Grid ColumnDefinitions="180,20,50,20,*">
<Label Content="{DynamicResource notedefaults.vibrato.drift}"/>
<pe:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoDrift}" />
<c:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoDrift}" />
<Slider Grid.Column="4" Classes="fader" Value="{Binding CurrentVibratoDrift}" Minimum="-100" Maximum="100"
TickPlacement="BottomRight" TickFrequency="0.1" IsSnapToTickEnabled="true" />
</Grid>
<Grid ColumnDefinitions="180,20,50,20,*">
<Label Content="{DynamicResource notedefaults.vibrato.vollink}"/>
<pe:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoVolLink}" />
<c:FloatEditor Grid.Column="2" Value="{Binding CurrentVibratoVolLink}" />
<Slider Grid.Column="4" Classes="fader" Value="{Binding CurrentVibratoVolLink}" Minimum="-100" Maximum="100"
TickPlacement="BottomRight" TickFrequency="0.1" IsSnapToTickEnabled="true" />
</Grid>
Expand All @@ -123,7 +123,7 @@
</Grid>
<Grid ColumnDefinitions="180,20,50,20,*">
<Label Content="{DynamicResource notedefaults.vibrato.autominlength}"/>
<pe:FloatEditor Grid.Column="2" IsEnabled="{Binding AutoVibratoToggle}" Value="{Binding AutoVibratoNoteLength}" />
<c:FloatEditor Grid.Column="2" IsEnabled="{Binding AutoVibratoToggle}" Value="{Binding AutoVibratoNoteLength}" />
<Slider Grid.Column="4" Classes="fader" IsEnabled="{Binding AutoVibratoToggle}" Value="{Binding AutoVibratoNoteLength}" Minimum="10" Maximum="1920"
TickPlacement="BottomRight" TickFrequency="1" IsSnapToTickEnabled="true" />
</Grid>
Expand Down

0 comments on commit 00c7c0f

Please sign in to comment.