Change ThresholdSlider to a grid, to make things easier to position. StackPanel is too limited for this.

master
Glenn Maynard 5 years ago
parent 883d87779a
commit 18475afbf8
  1. 24
      smx-config/MainWindow.xaml

@ -135,23 +135,23 @@ Use if the platform is too sensitive.</clr:String>
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type controls:ThresholdSlider}"> <ControlTemplate TargetType="{x:Type controls:ThresholdSlider}">
<StackPanel Margin="0,0,0,0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> <Grid Margin="0,0,0,0" Width="400" HorizontalAlignment="Center" VerticalAlignment="Center">
<Image <Image
Margin="0,0,0,0" Margin="-370,0,0,0"
Height="28" Width="28" Height="28" Width="28"
HorizontalAlignment="Left" VerticalAlignment="Top" VerticalAlignment="Top"
Source="{TemplateBinding Icon}" Source="{TemplateBinding Icon}"
/> />
<Label Margin="5,0,0,0" x:Name="LowerValue" Content="0" Width="30" HorizontalContentAlignment="Right" <Label Margin="-300,0,0,0" x:Name="LowerValue" Content="0" Width="30" HorizontalContentAlignment="Right"
HorizontalAlignment="Left" VerticalAlignment="Top" VerticalAlignment="Top"
/> />
<Image x:Name="ThresholdWarning" <Image x:Name="ThresholdWarning"
Source="Resources/threshold_warning.png" Width="9" Height="28" Source="Resources/threshold_warning.png" Width="9" Height="28"
Margin="10,0,0,0" Margin="-240,0,0,0"
Visibility="Visible" Visibility="Visible"
/> />
<controls:DoubleSlider x:Name="Slider" <controls:DoubleSlider x:Name="Slider"
Margin="24,5,0,0" Margin="50,5,0,0"
MinimumDistance="10" MinimumDistance="10"
LowerValue="20" UpperValue="35" LowerValue="20" UpperValue="35"
VerticalAlignment="Top" VerticalAlignment="Top"
@ -159,10 +159,10 @@ Use if the platform is too sensitive.</clr:String>
Focusable="False" Focusable="False"
Style="{DynamicResource DoubleSlider}" Style="{DynamicResource DoubleSlider}"
/> />
<Label Margin="11,0,0,0" x:Name="UpperValue" Content="0" Width="40" HorizontalContentAlignment="Center" <Label Margin="360,0,0,0" x:Name="UpperValue" Content="0" Width="40" HorizontalContentAlignment="Center"
HorizontalAlignment="Left" VerticalAlignment="Top" VerticalAlignment="Top"
/> />
</StackPanel> </Grid>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
@ -847,7 +847,9 @@ Use if the platform is too sensitive.</clr:String>
DockPanel.Dock="Top" DockPanel.Dock="Top"
> >
<DockPanel Margin="0,0,0,0" VerticalAlignment="Top" x:Name="ThresholdSliderContainer"> <DockPanel Margin="0,0,0,0" VerticalAlignment="Top" x:Name="ThresholdSliderContainer">
<!-- CreateThresholdSliders adds ThresholdSliders here. --> <!-- CreateThresholdSliders adds ThresholdSliders here. The slider below is only
for the UI preview, and is removed on refresh. -->
<controls:ThresholdSlider DockPanel.Dock="Top" controls:ThresholdSlider.Type="up-left" controls:ThresholdSlider.Icon="Resources/pad_up_left.png" Margin="0,8,0,0" />
</DockPanel> </DockPanel>
</ScrollViewer> </ScrollViewer>
<TextBlock DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="0,25,0,0" VerticalAlignment="Top" <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="0,25,0,0" VerticalAlignment="Top"

Loading…
Cancel
Save