mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Allow for setting of negative font sizes (#2631)
This commit is contained in:
parent
6e2eb03071
commit
895b40fdad
@ -86,7 +86,7 @@
|
|||||||
Header="{x:Static resources:Strings.Menu_FastFlags_Presets_FPSLimit_Title}"
|
Header="{x:Static resources:Strings.Menu_FastFlags_Presets_FPSLimit_Title}"
|
||||||
Description="{x:Static resources:Strings.Menu_FastFlags_Presets_FPSLimit_Description}"
|
Description="{x:Static resources:Strings.Menu_FastFlags_Presets_FPSLimit_Description}"
|
||||||
HelpLink="https://github.com/pizzaboxer/bloxstrap/wiki/A-guide-to-FastFlags#framerate-limit">
|
HelpLink="https://github.com/pizzaboxer/bloxstrap/wiki/A-guide-to-FastFlags#framerate-limit">
|
||||||
<ui:TextBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" Text="{Binding FramerateLimit, Mode=TwoWay}" PreviewTextInput="ValidateInt32" />
|
<ui:TextBox Margin="5,0,0,0" Padding="10,5,10,5" Width="200" Text="{Binding FramerateLimit, Mode=TwoWay}" PreviewTextInput="ValidateUInt32" />
|
||||||
</controls:OptionControl>
|
</controls:OptionControl>
|
||||||
|
|
||||||
<controls:OptionControl
|
<controls:OptionControl
|
||||||
|
@ -31,6 +31,8 @@ namespace Bloxstrap.UI.Elements.Settings.Pages
|
|||||||
DataContext = new FastFlagsViewModel(this);
|
DataContext = new FastFlagsViewModel(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ValidateInt32(object sender, TextCompositionEventArgs e) => e.Handled = !Int32.TryParse(e.Text, out int _);
|
private void ValidateInt32(object sender, TextCompositionEventArgs e) => e.Handled = e.Text != "-" && !Int32.TryParse(e.Text, out int _);
|
||||||
|
|
||||||
|
private void ValidateUInt32(object sender, TextCompositionEventArgs e) => e.Handled = !UInt32.TryParse(e.Text, out uint _);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user