feat: add tooltip

main
DESKTOP-3BO4HSG\ksat 2 years ago
parent 9b2fbc6e49
commit 21c5cab0f8

@ -191,4 +191,17 @@
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
<!--ToolTip-->
<ControlTemplate x:Key="ToolTipTemplate"
TargetType="ToolTip">
<Border CornerRadius="3"
BorderThickness="1"
BorderBrush="#393c43"
Background="#2e323a"
Padding="4">
<TextBlock Text="{TemplateBinding Name}"
Foreground="#abb2bf"/>
</Border>
</ControlTemplate>
</ResourceDictionary> </ResourceDictionary>

@ -191,4 +191,16 @@
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
<!--ToolTip-->
<ControlTemplate x:Key="ToolTipTemplate"
TargetType="ToolTip">
<Border CornerRadius="3"
BorderThickness="1"
BorderBrush="#dfdfdf"
Background="#f6f6f6"
Padding="4">
<TextBlock Text="{TemplateBinding Name}"/>
</Border>
</ControlTemplate>
</ResourceDictionary> </ResourceDictionary>

@ -102,7 +102,11 @@
Command="{Binding SourceSpeakCmd}"/> Command="{Binding SourceSpeakCmd}"/>
<Button Template="{DynamicResource ButtonTemplate}" <Button Template="{DynamicResource ButtonTemplate}"
Visibility="{Binding InputTxt, Converter={StaticResource String2VisibilityConverter}}" Visibility="{Binding InputTxt, Converter={StaticResource String2VisibilityConverter}}"
Command="{Binding CopyInputCmd}"/> Command="{Binding CopyInputCmd}">
<Button.ToolTip>
<ToolTip x:Name="复制" Template="{DynamicResource ToolTipTemplate}"/>
</Button.ToolTip>
</Button>
<Border Style="{DynamicResource LanguageMarkBorderStyle}" <Border Style="{DynamicResource LanguageMarkBorderStyle}"
Visibility="{Binding IdentifyLanguage, Converter={StaticResource String2VisibilityConverter}}"> Visibility="{Binding IdentifyLanguage, Converter={StaticResource String2VisibilityConverter}}">
<StackPanel Margin="5,2" <StackPanel Margin="5,2"
@ -165,27 +169,44 @@
<StackPanel Orientation="Horizontal" <StackPanel Orientation="Horizontal"
Margin="10,5" Margin="10,5"
VerticalAlignment="Bottom"> VerticalAlignment="Bottom">
<!--语音-->
<Button Template="{DynamicResource ButtonTemplateSpeak}" <Button Template="{DynamicResource ButtonTemplateSpeak}"
Visibility="{Binding OutputTxt, Converter={StaticResource String2VisibilityConverter}}" Visibility="{Binding OutputTxt, Converter={StaticResource String2VisibilityConverter}}"
Command="{Binding TargetSpeakCmd}"/> Command="{Binding TargetSpeakCmd}"/>
<!--普通复制--> <!--普通复制-->
<Button Template="{DynamicResource ButtonTemplate}" <Button Template="{DynamicResource ButtonTemplate}"
Visibility="{Binding OutputTxt, Converter={StaticResource String2VisibilityConverter}}" Visibility="{Binding OutputTxt, Converter={StaticResource String2VisibilityConverter}}"
Command="{Binding CopyResultCmd}"/> Command="{Binding CopyResultCmd}">
<Button.ToolTip>
<ToolTip x:Name="直接复制" Template="{DynamicResource ToolTipTemplate}"/>
</Button.ToolTip>
</Button>
<!--蛇形复制--> <!--蛇形复制-->
<Button Margin="5,0" <Button Margin="5,0"
Template="{DynamicResource ButtonTemplateSnakeCopy}" Template="{DynamicResource ButtonTemplateSnakeCopy}"
Visibility="{Binding SnakeRet, Converter={StaticResource String2VisibilityConverter}}" Visibility="{Binding SnakeRet, Converter={StaticResource String2VisibilityConverter}}"
Command="{Binding CopySnakeResultCmd}"/> Command="{Binding CopySnakeResultCmd}">
<Button.ToolTip>
<ToolTip x:Name="蛇形复制" Template="{DynamicResource ToolTipTemplate}"/>
</Button.ToolTip>
</Button>
<!--小驼峰复制--> <!--小驼峰复制-->
<Button Template="{DynamicResource ButtonTemplateSmallHumpCopy}" <Button Template="{DynamicResource ButtonTemplateSmallHumpCopy}"
Visibility="{Binding SmallHumpRet, Converter={StaticResource String2VisibilityConverter}}" Visibility="{Binding SmallHumpRet, Converter={StaticResource String2VisibilityConverter}}"
Command="{Binding CopySmallHumpResultCmd}"/> Command="{Binding CopySmallHumpResultCmd}">
<Button.ToolTip>
<ToolTip x:Name="小驼峰复制" Template="{DynamicResource ToolTipTemplate}"/>
</Button.ToolTip>
</Button>
<!--大驼峰复制--> <!--大驼峰复制-->
<Button Margin="5,0" <Button Margin="5,0"
Template="{DynamicResource ButtonTemplateLargeHumpCopy}" Template="{DynamicResource ButtonTemplateLargeHumpCopy}"
Visibility="{Binding LargeHumpRet, Converter={StaticResource String2VisibilityConverter}}" Visibility="{Binding LargeHumpRet, Converter={StaticResource String2VisibilityConverter}}"
Command="{Binding CopyLargeHumpResultCmd}"/> Command="{Binding CopyLargeHumpResultCmd}">
<Button.ToolTip>
<ToolTip x:Name="大驼峰复制" Template="{DynamicResource ToolTipTemplate}"/>
</Button.ToolTip>
</Button>
</StackPanel> </StackPanel>
</Grid> </Grid>
</Border> </Border>

Loading…
Cancel
Save