mirror of
https://github.com/openbullet/openbullet.git
synced 2023-10-21 07:33:42 -05:00
148 lines
8.0 KiB
XML
148 lines
8.0 KiB
XML
<Window x:Class="OpenBullet.LogWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:local="clr-namespace:OpenBullet"
|
|
mc:Ignorable="d"
|
|
Background="#222"
|
|
Title="Log" Height="450" Width="800">
|
|
<Window.Resources>
|
|
<ContextMenu x:Key="ItemContextMenu">
|
|
<MenuItem x:Name="copy" Header="Copy" Click="copyClick"/>
|
|
</ContextMenu>
|
|
</Window.Resources>
|
|
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="40" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<ListView x:Name="logListView" Grid.Row="0" Foreground="Gainsboro" Background="Transparent" ItemsSource="{Binding Path=List, Mode=OneWay}" SelectionMode="Extended" BorderThickness="1">
|
|
<!-- Align Headers to the Left -->
|
|
<ListView.Resources>
|
|
<Style x:Key="GridViewColumnHeaderGripper" TargetType="Thumb">
|
|
<Setter Property="Width" Value="18" />
|
|
<Setter Property="Background">
|
|
<Setter.Value>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
|
<LinearGradientBrush.GradientStops>
|
|
<GradientStopCollection>
|
|
<GradientStop Color="{DynamicResource BorderLightColor}" Offset="0.0" />
|
|
<GradientStop Color="{DynamicResource BorderDarkColor}" Offset="1.0" />
|
|
</GradientStopCollection>
|
|
</LinearGradientBrush.GradientStops>
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Thumb}">
|
|
<Border Padding="{TemplateBinding Padding}" Background="Transparent">
|
|
<Rectangle HorizontalAlignment="Center" Width="1" Fill="{TemplateBinding Background}" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="BorderBrush">
|
|
<Setter.Value>
|
|
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
|
<GradientStop Color="Black" Offset="0" />
|
|
<GradientStop Color="White" Offset="1" />
|
|
</LinearGradientBrush>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style TargetType="{x:Type GridViewColumnHeader}">
|
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
|
|
<Grid>
|
|
<Border BorderThickness="0,0,0,1" BorderBrush="Black" Background="Transparent">
|
|
<TextBlock x:Name="ContentHeader" Text="{TemplateBinding Content}" Padding="5,5,5,0" Width="{TemplateBinding Width}" TextAlignment="Left" />
|
|
</Border>
|
|
<Thumb x:Name="PART_HeaderGripper"
|
|
HorizontalAlignment="Right"
|
|
Margin="0,0,-9,0"
|
|
Style="{StaticResource GridViewColumnHeaderGripper}" />
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
|
<Setter Property="Foreground" Value="Gainsboro" />
|
|
<Setter Property="FontFamily" Value="pack://application:,,,/Fonts/#Century Gothic" />
|
|
<Setter Property="FontSize" Value="14" />
|
|
</Style>
|
|
<Style TargetType="{x:Type ListViewItem}">
|
|
<EventSetter Event="MouseRightButtonDown" Handler="ListViewItem_MouseRightButtonDown" />
|
|
<Setter Property="ContextMenu" Value="{StaticResource ItemContextMenu}"/>
|
|
<Setter Property="Foreground">
|
|
<Setter.Value>
|
|
<SolidColorBrush Color="{Binding LogColor}"/>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ListViewItem}">
|
|
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
Background="{TemplateBinding Background}"
|
|
Padding="0"
|
|
SnapsToDevicePixels="true">
|
|
<GridViewRowPresenter
|
|
HorizontalAlignment="Left"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Background" Value="{DynamicResource BackgroundSecondary}" />
|
|
</Trigger>
|
|
<Trigger Property="IsSelected" Value="True">
|
|
<Setter Property="Background" Value="Black" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</ListView.Resources>
|
|
|
|
<!-- Show Headers by overriding the default style -->
|
|
<ListView.Style>
|
|
<Style TargetType="{x:Type ListView}" />
|
|
</ListView.Style>
|
|
|
|
<ListView.View>
|
|
<GridView>
|
|
<GridViewColumn Header="Time" Width="140" DisplayMemberBinding="{Binding Path=LogTime}" />
|
|
<GridViewColumn Header="Level" Width="70" DisplayMemberBinding="{Binding Path=LogLevel}" />
|
|
<GridViewColumn Header="Component" Width="100" DisplayMemberBinding="{Binding Path=LogComponent}" />
|
|
<GridViewColumn Header="Message" Width="10000" DisplayMemberBinding="{Binding Path=LogString}" />
|
|
</GridView>
|
|
</ListView.View>
|
|
</ListView>
|
|
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="auto" />
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<StackPanel Grid.Column="0" Margin="5" Orientation="Horizontal">
|
|
<Button x:Name="copyAllButton" Content="Copy All" Click="copyAllButton_Click" />
|
|
<Button x:Name="clearButton" Content="Clear" Click="clearButton_Click"/>
|
|
<CheckBox Content="Only Show Errors" IsChecked="{Binding OnlyErrors}" VerticalAlignment="Center" VerticalContentAlignment="Center"/>
|
|
</StackPanel>
|
|
|
|
<TextBox Grid.Column="1" x:Name="searchBar" Text="{Binding SearchString}" Margin="5" />
|
|
<Button Grid.Column="2" x:Name="searchButton" Content="Search" Click="searchButton_Click" Margin="5"/>
|
|
|
|
</Grid>
|
|
</Grid>
|
|
</Window>
|