Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blurry Text for PT Run improvements #6049

Merged
merged 3 commits into from
Aug 21, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 31 additions & 19 deletions src/modules/launcher/PowerLauncher/LauncherControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:PowerLauncher"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="720">
<UserControl.Resources>
<Style x:Key="QueryTextBoxStyle" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Background" Value="{DynamicResource SystemChromeLow}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Foreground" Value="{DynamicResource ControlTextBrushKey}"/>
<Setter Property="CaretBrush" Value="{DynamicResource ControlTextBrushKey}"/>
Expand All @@ -25,7 +24,18 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Grid>
<TextBlock Margin="15, 1, 0, 0" Text="{TemplateBinding Tag}">
<Border x:Name="border" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" SnapsToDevicePixels="True">
<ScrollViewer x:Name="PART_ContentHost" Background="{TemplateBinding Background}" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
<ScrollViewer.ContentTemplate>
<DataTemplate>
<Grid Background="{Binding Background, ElementName=PART_ContentHost}" RenderOptions.ClearTypeHint="Enabled" TextOptions.TextFormattingMode="Display">
<ContentPresenter Content="{Binding Path=Content, ElementName=PART_ContentHost}"/>
</Grid>
</DataTemplate>
</ScrollViewer.ContentTemplate>
</ScrollViewer>
</Border>
<TextBlock Margin="14, 0, 0, 0" Text="{TemplateBinding Tag}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="Transparent"/>
Expand All @@ -37,9 +47,6 @@
</Style>
</TextBlock.Style>
</TextBlock>
<Border x:Name="border" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" SnapsToDevicePixels="True">
<ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
Expand Down Expand Up @@ -75,16 +82,7 @@
<ColumnDefinition Width="72"/>
</Grid.ColumnDefinitions>

<TextBlock
x:Name="AutoCompleteTextBlock"
x:FieldModifier="public"
Opacity="0.6"
Canvas.ZIndex="0"
Margin="24, 0, 14, 0"
VerticalAlignment="Center"
FontSize="24"
Foreground="{DynamicResource TextControlPlaceholderForeground}"
/>

Copy link

@AnuthaDev AnuthaDev Aug 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe remove this line...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the green line 85?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes


<!--
for adding on placeholder, look at the style with 90 votes
Expand All @@ -101,16 +99,30 @@
FontSize="24"
Style="{StaticResource QueryTextBoxStyle}"
Tag="{DynamicResource startTyping}"
RenderOptions.ClearTypeHint="Enabled"
/>

<TextBlock
x:Name="AutoCompleteTextBlock"
x:FieldModifier="public"
Opacity="0.6"
Canvas.ZIndex="0"
Margin="24, 0, 14, 0"
VerticalAlignment="Center"
FontSize="24"
Foreground="{DynamicResource TextControlPlaceholderForeground}"
RenderOptions.ClearTypeHint="Enabled"
/>
<TextBlock
AutomationProperties.Name="{DynamicResource SearchIcon}"
Grid.Column="1"
Text="&#xE721;"
FontFamily="Segoe MDL2 Assets"
FontSize="24"
FontSize="26"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{DynamicResource TextControlPlaceholderForeground}" />
Foreground="{DynamicResource TextControlPlaceholderForeground}"
RenderOptions.ClearTypeHint="Enabled"
TextOptions.TextRenderingMode="Auto"
SnapsToDevicePixels="True"/>
</Grid>
</UserControl>
44 changes: 22 additions & 22 deletions src/modules/launcher/PowerLauncher/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
Topmost="True"
SizeToContent="Height"
ResizeMode="NoResize"
TextOptions.TextRenderingMode="ClearType"
RenderOptions.ClearTypeHint="Enabled"
WindowStyle="None"
WindowStartupLocation="Manual"
AllowDrop="True"
Expand All @@ -24,6 +26,7 @@
Deactivated="OnDeactivated"
IsVisibleChanged="OnVisibilityChanged"
Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"

d:DataContext="{d:DesignInstance vm:MainViewModel}">
<Window.Resources>
<CubicEase x:Key="CubicEaseOut" EasingMode="EaseOut"/>
Expand Down Expand Up @@ -52,17 +55,15 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border
<Grid
x:Name="SearchBoxBorder"
Grid.Row="0"
Margin="24,24,24,24"
BorderThickness="1"
CornerRadius="4"
Background="{DynamicResource SystemChromeLow}"
BorderBrush="{DynamicResource BorderBrush}">
<Border.Effect>
<DropShadowEffect BlurRadius="32" Opacity="0.28" ShadowDepth="1" />
</Border.Effect>
Margin="24,24,24,24">
<Rectangle Fill="{DynamicResource SystemChromeLow}" RadiusX="4" RadiusY="4" Stroke="{DynamicResource BorderBrush}" StrokeThickness="1">
<Rectangle.Effect>
<DropShadowEffect BlurRadius="32" Opacity="0.28" ShadowDepth="1" />
</Rectangle.Effect>
</Rectangle>
<local:LauncherControl
x:Name="SearchBox">
<!--<local:LauncherControl.RenderTransform>
Expand All @@ -72,29 +73,28 @@
<!--<Border.RenderTransform>
<TranslateTransform />
</Border.RenderTransform>-->
</Border>
<Border
</Grid>
<Grid
x:Name="ListBoxBorder"
Grid.Row="1"
Margin="24,-8,24,24"
BorderThickness="1"
CornerRadius="4"
Visibility="{Binding Results.Visibility}"
Background="{DynamicResource SystemChromeLow}"
BorderBrush="{DynamicResource BorderBrush}">
Grid.Row="1"
Margin="24,-8,24,24"
Visibility="{Binding Results.Visibility}">
<!--<Border.RenderTransform>
<TranslateTransform />
</Border.RenderTransform>-->
<Border.Effect>
<DropShadowEffect BlurRadius="32" Opacity="0.28" ShadowDepth="1" />
</Border.Effect>
<Rectangle RadiusX="4" RadiusY="4" Fill="{DynamicResource SystemChromeLow}" Stroke="{DynamicResource BorderBrush}" StrokeThickness="1">
<Rectangle.Effect>
<DropShadowEffect BlurRadius="32" Opacity="0.28" ShadowDepth="1" />
</Rectangle.Effect>
</Rectangle>
<local:ResultList x:Name="ListBox"
PreviewMouseDown="ListBox_PreviewMouseDown" >
<!--<local:ResultList.RenderTransform>
<TranslateTransform />
</local:ResultList.RenderTransform>-->
</local:ResultList>
</Border>
<Rectangle RadiusX="4" RadiusY="4" Stroke="{DynamicResource SystemChromeLow}" StrokeThickness="1" />
</Grid>
</Grid>
<Window.InputBindings>
<KeyBinding Key="Escape" Command="{Binding EscCommand}" />
Expand Down
26 changes: 14 additions & 12 deletions src/modules/launcher/PowerLauncher/ResultList.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
<Grid Background="Transparent">
<Border x:Name="HighlightBorder" BorderThickness="0" Background="Transparent" BorderBrush="Transparent" SnapsToDevicePixels="true"/>
<Border x:Name="HighlightBorder" BorderThickness="0" Background="{DynamicResource SystemChromeLow}" BorderBrush="Transparent" SnapsToDevicePixels="true"/>
<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
<ControlTemplate.Triggers>
Expand All @@ -95,6 +95,7 @@
<Style x:Key="CommandButtonListViewItemContainerStyle" TargetType="ListViewItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
Expand Down Expand Up @@ -134,11 +135,10 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToolTip}" >
<StackPanel Margin="8,2" >
<Border CornerRadius="4" Background="{DynamicResource ToolTipBackgroundBrushKey}" BorderBrush="{DynamicResource ToolTipBorderBrushKey}" BorderThickness="1">
<ContentPresenter Margin="4" HorizontalAlignment="Center" VerticalAlignment="Top" />
</Border>
</StackPanel>
<Grid Margin="8,2" >
<Rectangle Fill="{DynamicResource ToolTipBackgroundBrushKey}" RadiusX="4" RadiusY="4" Stroke="{DynamicResource ToolTipBorderBrushKey}" StrokeThickness="1"/>
<ContentPresenter Margin="4" HorizontalAlignment="Center" VerticalAlignment="Top" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand Down Expand Up @@ -199,18 +199,20 @@
Style="{DynamicResource CollapsableTextblock}"
Foreground="{DynamicResource ToolTipForegroundBrushKey}" FontWeight="Bold" FontSize="12"
Text="{Binding Result.ToolTipData.Title}"
TextWrapping="Wrap" />
TextWrapping="Wrap"
RenderOptions.ClearTypeHint="Enabled" />
<TextBlock
Style="{DynamicResource CollapsableTextblock}"
Foreground="{DynamicResource ToolTipForegroundBrushKey}" FontSize="12"
Text="{Binding Result.ToolTipData.Text}"
TextWrapping="Wrap" />
TextWrapping="Wrap"
RenderOptions.ClearTypeHint="Enabled" />
</StackPanel>
</ToolTip>
</Grid.ToolTip>
<Image AutomationProperties.Name="{DynamicResource AppIcon}" x:Name="AppIcon" Height="36" MaxWidth="56" Grid.RowSpan="2" Margin="-6,-2,0,0" HorizontalAlignment="Center" Source="{Binding Image}" />
<TextBlock AutomationProperties.Name="{DynamicResource Title}" x:Name="Title" Grid.Column="1" Text="{Binding Result.Title}" FontWeight="SemiBold" FontSize="20" Margin="0,0,0,-2" VerticalAlignment="Bottom"/>
<TextBlock AutomationProperties.Name="{DynamicResource Subtitle}" x:Name="Path" Grid.Column="1" Text= "{Binding Result.SubTitle}" Grid.Row="1" Foreground="{DynamicResource SecondaryTextForeground}" Margin="0,2,0,0" VerticalAlignment="Top"/>
<TextBlock AutomationProperties.Name="{DynamicResource Title}" x:Name="Title" Grid.Column="1" Text="{Binding Result.Title}" FontWeight="SemiBold" FontSize="20" Margin="0,0,0,-2" VerticalAlignment="Bottom" RenderOptions.ClearTypeHint="Enabled"/>
<TextBlock AutomationProperties.Name="{DynamicResource Subtitle}" x:Name="Path" Grid.Column="1" Text= "{Binding Result.SubTitle}" Grid.Row="1" Foreground="{DynamicResource SecondaryTextForeground}" Margin="0,2,0,0" VerticalAlignment="Top" RenderOptions.ClearTypeHint="Enabled"/>
<ListView
AutomationProperties.Name="{DynamicResource ContextMenuItemsCollection}"
HorizontalAlignment="Right"
Expand Down Expand Up @@ -239,11 +241,11 @@
<Button AutomationProperties.Name="{DynamicResource ContextMenuItem}" Style="{StaticResource IconButtonStyle}" Command="{Binding Command}" VerticalAlignment="Center" Height="42" Width="42" BorderThickness="1" >
<ToolTipService.ToolTip>
<ToolTip >
<TextBlock AutomationProperties.Name="{DynamicResource ContextMenuItemAdditionalInformation}" Text="{Binding Title}" Foreground="{DynamicResource ToolTipForegroundBrushKey}" Margin="8,5" FontSize="12"/>
<TextBlock AutomationProperties.Name="{DynamicResource ContextMenuItemAdditionalInformation}" Text="{Binding Title}" Foreground="{DynamicResource ToolTipForegroundBrushKey}" Margin="8,5" FontSize="12" RenderOptions.ClearTypeHint="Enabled"/>
</ToolTip>
</ToolTipService.ToolTip>
<Button.Content>
<TextBlock AutomationProperties.Name="{DynamicResource ContextMenuIcon}" FontFamily="{Binding FontFamily}" FontSize="16" Text="{Binding Glyph}"/>
<TextBlock AutomationProperties.Name="{DynamicResource ContextMenuIcon}" FontFamily="{Binding FontFamily}" FontSize="16" Text="{Binding Glyph}" RenderOptions.ClearTypeHint="Enabled"/>
</Button.Content>
</Button>
</DataTemplate>
Expand Down