Browse Source

Normalized sizes of inputs

Krzysztof Krysiński 1 year ago
parent
commit
26e074225b

+ 0 - 1
src/PixiEditor.AvaloniaUI/ViewModels/Tools/ToolSettings/Settings/FloatSetting.cs

@@ -30,7 +30,6 @@ internal sealed class FloatSetting : Setting<float>
         var numbrInput = new NumberInput
         var numbrInput = new NumberInput
         {
         {
             Width = 40,
             Width = 40,
-            Height = 20,
             Min = Min,
             Min = Min,
             Max = Max
             Max = Max
         };
         };

+ 2 - 3
src/PixiEditor.AvaloniaUI/Views/Input/NumberInput.axaml

@@ -7,13 +7,12 @@
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:behaviours="clr-namespace:PixiEditor.AvaloniaUI.Helpers.Behaviours"
     xmlns:behaviours="clr-namespace:PixiEditor.AvaloniaUI.Helpers.Behaviours"
     xmlns:converters="clr-namespace:PixiEditor.AvaloniaUI.Helpers.Converters"
     xmlns:converters="clr-namespace:PixiEditor.AvaloniaUI.Helpers.Converters"
-    mc:Ignorable="d"
-             d:DesignHeight="20" d:DesignWidth="40" x:Name="numberInput" Focusable="False">
+    mc:Ignorable="d" d:DesignHeight="20" d:DesignWidth="40" x:Name="numberInput" Focusable="False">
     <TextBox TextAlignment="Center" Focusable="True" Name="TextBox"
     <TextBox TextAlignment="Center" Focusable="True" Name="TextBox"
              PointerWheelChanged="TextBox_MouseWheel"
              PointerWheelChanged="TextBox_MouseWheel"
              LostFocus="TextBox_OnLostFocus"
              LostFocus="TextBox_OnLostFocus"
              Text="{Binding ElementName=numberInput, Path=FormattedValue, Mode=TwoWay}"
              Text="{Binding ElementName=numberInput, Path=FormattedValue, Mode=TwoWay}"
-             Padding="0" VerticalContentAlignment="Center">
+             VerticalContentAlignment="Center">
         <Interaction.Behaviors>
         <Interaction.Behaviors>
             <behaviours:GlobalShortcutFocusBehavior/>
             <behaviours:GlobalShortcutFocusBehavior/>
             <behaviours:TextBoxFocusBehavior SelectOnMouseClick="True" ConfirmOnEnter="True"
             <behaviours:TextBoxFocusBehavior SelectOnMouseClick="True" ConfirmOnEnter="True"

+ 2 - 2
src/PixiEditor.AvaloniaUI/Views/Input/SizeInput.axaml

@@ -7,10 +7,10 @@
              xmlns:ui="clr-namespace:PixiEditor.Extensions.UI;assembly=PixiEditor.Extensions"
              xmlns:ui="clr-namespace:PixiEditor.Extensions.UI;assembly=PixiEditor.Extensions"
              xmlns:converters="clr-namespace:PixiEditor.AvaloniaUI.Helpers.Converters"
              xmlns:converters="clr-namespace:PixiEditor.AvaloniaUI.Helpers.Converters"
              xmlns:behaviours="clr-namespace:PixiEditor.AvaloniaUI.Helpers.Behaviours"
              xmlns:behaviours="clr-namespace:PixiEditor.AvaloniaUI.Helpers.Behaviours"
-             mc:Ignorable="d" Foreground="White" Focusable="True"
+             mc:Ignorable="d" Focusable="True"
              d:DesignHeight="30" Name="uc"
              d:DesignHeight="30" Name="uc"
              FlowDirection="LeftToRight">
              FlowDirection="LeftToRight">
-    <Border BorderThickness="1" CornerRadius="3.5"
+    <Border BorderThickness="1" CornerRadius="{DynamicResource ControlCornerRadius}"
             x:Name="border"
             x:Name="border"
             Cursor="IBeam" PointerPressed="Border_MouseLeftButtonDown"
             Cursor="IBeam" PointerPressed="Border_MouseLeftButtonDown"
             PointerWheelChanged="Border_MouseWheel">
             PointerWheelChanged="Border_MouseWheel">

+ 1 - 1
src/PixiEditor.UI.Common/Controls/TextBox.axaml

@@ -90,7 +90,7 @@
     <Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}" />
     <Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}" />
     <Setter Property="SelectionBrush" Value="{DynamicResource ThemeControlHighlightBrush}" />
     <Setter Property="SelectionBrush" Value="{DynamicResource ThemeControlHighlightBrush}" />
     <Setter Property="SelectionForegroundBrush" Value="{DynamicResource ThemeHighlightForegroundBrush}" />
     <Setter Property="SelectionForegroundBrush" Value="{DynamicResource ThemeHighlightForegroundBrush}" />
-    <Setter Property="Padding" Value="4" />
+    <Setter Property="Padding" Value="3" />
     <Setter Property="ContextFlyout" Value="{StaticResource TextBoxContextFlyout}" />
     <Setter Property="ContextFlyout" Value="{StaticResource TextBoxContextFlyout}" />
     <Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
     <Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
     <Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}"/>
     <Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}"/>