mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-12 02:09:24 +08:00
Blurry Text for PT Run improvements (#6049)
* Checking in adjustments based off @anuthadev pr's * Forcing an improvement on the magnifier glass * removing whitespace
This commit is contained in:
parent
9b567f9ba3
commit
cc0b808962
@ -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}"/>
|
||||
@ -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"/>
|
||||
@ -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">
|
||||
@ -75,22 +82,10 @@
|
||||
<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}"
|
||||
/>
|
||||
|
||||
<!--
|
||||
for adding on placeholder, look at the style with 90 votes
|
||||
https://stackoverflow.com/questions/11873378/adding-placeholder-text-to-textbox
|
||||
-->
|
||||
|
||||
<TextBox
|
||||
AutomationProperties.Name="{DynamicResource Query}"
|
||||
x:Name="QueryTextBox"
|
||||
@ -101,16 +96,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=""
|
||||
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>
|
@ -10,6 +10,8 @@
|
||||
Topmost="True"
|
||||
SizeToContent="Height"
|
||||
ResizeMode="NoResize"
|
||||
TextOptions.TextRenderingMode="ClearType"
|
||||
RenderOptions.ClearTypeHint="Enabled"
|
||||
WindowStyle="None"
|
||||
WindowStartupLocation="Manual"
|
||||
AllowDrop="True"
|
||||
@ -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"/>
|
||||
@ -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>
|
||||
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" />
|
||||
</Border.Effect>
|
||||
</Rectangle.Effect>
|
||||
</Rectangle>
|
||||
<local:LauncherControl
|
||||
x:Name="SearchBox">
|
||||
<!--<local:LauncherControl.RenderTransform>
|
||||
@ -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}">
|
||||
Visibility="{Binding Results.Visibility}">
|
||||
<!--<Border.RenderTransform>
|
||||
<TranslateTransform />
|
||||
</Border.RenderTransform>-->
|
||||
<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" />
|
||||
</Border.Effect>
|
||||
</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}" />
|
||||
|
@ -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>
|
||||
@ -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}">
|
||||
@ -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">
|
||||
<Grid Margin="8,2" >
|
||||
<Rectangle Fill="{DynamicResource ToolTipBackgroundBrushKey}" RadiusX="4" RadiusY="4" Stroke="{DynamicResource ToolTipBorderBrushKey}" StrokeThickness="1"/>
|
||||
<ContentPresenter Margin="4" HorizontalAlignment="Center" VerticalAlignment="Top" />
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
@ -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"
|
||||
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user