fix<Launcher>: re-arrange app alerts to remove event blocking on top-left corner in Histories panel

This commit is contained in:
leo 2020-12-19 22:40:37 +08:00
parent 01ed685b59
commit cdc31a47e6
3 changed files with 78 additions and 81 deletions

View file

@ -20,19 +20,13 @@
</Style>
<Style x:Key="Style.ScrollBar.Thumb" TargetType="{x:Type Thumb}">
<Setter Property="Background" Value="{DynamicResource Brush.Border1}" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Focusable" Value="false" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="SnapsToDevicePixels" Value="true" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border x:Name="Border" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Opacity=".6"/>
<Border x:Name="Border" Background="{DynamicResource Brush.Border1}" BorderThickness="0" Opacity=".6"/>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Border" Property="Opacity" Value="1" />
@ -44,37 +38,31 @@
</Style>
<ControlTemplate x:Key="Template.ScrollBar.Horizontal" TargetType="{x:Type ScrollBar}">
<Grid>
<Track Name="PART_Track" Grid.Column="1">
<Track.DecreaseRepeatButton>
<RepeatButton Command="ScrollBar.PageLeftCommand" Style="{StaticResource Style.ScrollBar.RepeatPage}" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource Style.ScrollBar.Thumb}" />
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Command="ScrollBar.PageRightCommand" Style="{StaticResource Style.ScrollBar.RepeatPage}" />
</Track.IncreaseRepeatButton>
</Track>
</Grid>
<Track Name="PART_Track">
<Track.DecreaseRepeatButton>
<RepeatButton Command="ScrollBar.PageLeftCommand" Style="{StaticResource Style.ScrollBar.RepeatPage}" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource Style.ScrollBar.Thumb}"/>
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Command="ScrollBar.PageRightCommand" Style="{StaticResource Style.ScrollBar.RepeatPage}" />
</Track.IncreaseRepeatButton>
</Track>
</ControlTemplate>
<ControlTemplate x:Key="Template.ScrollBar.Vertical" TargetType="{x:Type ScrollBar}">
<Grid>
<Track Name="PART_Track"
Grid.Row="1"
IsDirectionReversed="true">
<Track.DecreaseRepeatButton>
<RepeatButton Command="ScrollBar.PageUpCommand" Style="{StaticResource Style.ScrollBar.RepeatPage}" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource Style.ScrollBar.Thumb}"/>
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Command="ScrollBar.PageDownCommand" Style="{StaticResource Style.ScrollBar.RepeatPage}" />
</Track.IncreaseRepeatButton>
</Track>
</Grid>
<Track Name="PART_Track" IsDirectionReversed="true">
<Track.DecreaseRepeatButton>
<RepeatButton Command="ScrollBar.PageUpCommand" Style="{StaticResource Style.ScrollBar.RepeatPage}" />
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb Style="{StaticResource Style.ScrollBar.Thumb}"/>
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Command="ScrollBar.PageDownCommand" Style="{StaticResource Style.ScrollBar.RepeatPage}" />
</Track.IncreaseRepeatButton>
</Track>
</ControlTemplate>
<Style TargetType="{x:Type ScrollBar}">
@ -84,14 +72,14 @@
<Style.Triggers>
<Trigger Property="Orientation" Value="Vertical">
<Setter Property="Width" Value="8" />
<Setter Property="Height" Value="Auto" />
<Setter Property="Template" Value="{StaticResource Template.ScrollBar.Vertical}" />
<Setter Property="Width" Value="8" />
</Trigger>
<Trigger Property="Orientation" Value="Horizontal">
<Setter Property="Width" Value="Auto" />
<Setter Property="Height" Value="8" />
<Setter Property="Template" Value="{StaticResource Template.ScrollBar.Horizontal}" />
<Setter Property="Width" Value="Auto" />
</Trigger>
</Style.Triggers>
</Style>

View file

@ -33,8 +33,7 @@
ViewportSize="{TemplateBinding ViewportHeight}"
Maximum="{TemplateBinding ScrollableHeight}"
Minimum="0"
Value="{TemplateBinding VerticalOffset}"
Margin="0,-1,-1,-1"/>
Value="{TemplateBinding VerticalOffset}"/>
<ScrollBar x:Name="PART_HorizontalScrollBar"
IsTabStop="False"
@ -43,8 +42,7 @@
ViewportSize="{TemplateBinding ViewportWidth}"
Maximum="{TemplateBinding ScrollableWidth}"
Minimum="0"
Value="{TemplateBinding HorizontalOffset}"
Margin="-1,0,-1,-1"/>
Value="{TemplateBinding HorizontalOffset}"/>
</Grid>
</Border>
</ControlTemplate>

View file

@ -292,49 +292,60 @@
</ItemsControl>
<!-- Alerts -->
<ScrollViewer
Grid.Row="1"
Margin="0,32,0,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto"
Panel.ZIndex="100">
<ItemsControl Margin="4" Width="300" Height="Auto" ItemsSource="{Binding Errors, ElementName=me}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid x:Name="item" Height="Auto" Width="300" Margin="0,8,0,0">
<Border Background="{StaticResource Brush.BG1}">
<Border.Effect>
<DropShadowEffect BlurRadius="8" ShadowDepth="2" Direction="270"/>
</Border.Effect>
</Border>
<ItemsControl
Grid.Row="1"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,32,0,0" Width="Auto" Height="Auto"
ItemsSource="{Binding Errors, ElementName=me}">
<Grid Margin="8">
<Grid.RowDefinitions>
<RowDefinition Height="26"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ItemsControl.Style>
<Style TargetType="{x:Type ItemsControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ItemsControl.Style>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid x:Name="item" Height="Auto" Width="300" Margin="8,8,16,8">
<Border Background="{StaticResource Brush.BG1}">
<Border.Effect>
<DropShadowEffect ShadowDepth="0"/>
</Border.Effect>
</Border>
<Label Grid.Row="0" Content="ERROR" FontWeight="DemiBold"/>
<TextBlock Grid.Row="1" Margin="6,8" Text="{Binding}" Foreground="{StaticResource Brush.FG}" TextWrapping="Wrap"/>
<Button
Grid.Row="2"
Margin="4,0"
Click="RemoveError"
Height="25"
Content="CLOSE"
Style="{StaticResource Style.Button.AccentBordered}"
BorderBrush="{StaticResource Brush.FG}"
VerticalAlignment="Center"
HorizontalAlignment="Right"/>
</Grid>
<Grid Margin="8">
<Grid.RowDefinitions>
<RowDefinition Height="26"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" Content="ERROR" FontWeight="DemiBold"/>
<TextBlock Grid.Row="1" Margin="6,8" Text="{Binding}" Foreground="{StaticResource Brush.FG}" TextWrapping="Wrap"/>
<Button
Grid.Row="2"
Margin="4,0"
Click="RemoveError"
Height="25"
Content="CLOSE"
Style="{StaticResource Style.Button.AccentBordered}"
BorderBrush="{StaticResource Brush.FG}"
VerticalAlignment="Center"
HorizontalAlignment="Right"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</Border>
</Window>