修复label不显示下划线的问题
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
<utils:StringFormatMultiValueConverter x:Key="StrFmtCvter"/>
|
<utils:StringFormatMultiValueConverter x:Key="StrFmtCvter"/>
|
||||||
<utils:BackgroundToForegroundConverter x:Key="Bg2FgCvter"/>
|
<utils:BackgroundToForegroundConverter x:Key="Bg2FgCvter"/>
|
||||||
|
|
||||||
<Style x:Key="MyGridSplitterBaseStyle" TargetType="{x:Type GridSplitter}">
|
<Style x:Key="MyGridSplitterBaseStyle" TargetType="GridSplitter">
|
||||||
<Setter Property="Background" Value="{DynamicResource SecondaryBorderBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource SecondaryBorderBrush}"/>
|
||||||
<Setter Property="ShowsPreview" Value="False"/>
|
<Setter Property="ShowsPreview" Value="False"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
@@ -28,17 +28,17 @@
|
|||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="MyToggleButtonBaseStyle" TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource ToggleButtonSwitch}">
|
<Style x:Key="MyToggleButtonBaseStyle" TargetType="ToggleButton" BasedOn="{StaticResource ToggleButtonSwitch}">
|
||||||
<Setter Property="hc:VisualElement.HighlightBrush" Value="{DynamicResource DarkSuccessBrush}"/>
|
<Setter Property="hc:VisualElement.HighlightBrush" Value="{DynamicResource DarkSuccessBrush}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="MyListBoxBaseStyle" TargetType="{x:Type ListBox}" BasedOn="{StaticResource ListBoxBaseStyle}">
|
<Style x:Key="MyListBoxBaseStyle" TargetType="ListBox" BasedOn="{StaticResource ListBoxBaseStyle}">
|
||||||
<Setter Property="SelectionMode" Value="Extended"/>
|
<Setter Property="SelectionMode" Value="Extended"/>
|
||||||
<!--<Setter Property="VirtualizingPanel.IsVirtualizing" Value="False"/>-->
|
<!--<Setter Property="VirtualizingPanel.IsVirtualizing" Value="False"/>-->
|
||||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Visible"/>
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Visible"/>
|
||||||
<Setter Property="ItemContainerStyle">
|
<Setter Property="ItemContainerStyle">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource ListBoxItemBaseStyle}">
|
<Style TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItemBaseStyle}">
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||||
<Setter Property="Padding" Value="0"/>
|
<Setter Property="Padding" Value="0"/>
|
||||||
<Setter Property="Margin" Value="0"/>
|
<Setter Property="Margin" Value="0"/>
|
||||||
@@ -47,26 +47,26 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="MyListViewBaseStyle" TargetType="{x:Type ListView}" BasedOn="{StaticResource ListViewBaseStyle}">
|
<Style x:Key="MyListViewBaseStyle" TargetType="ListView" BasedOn="{StaticResource ListViewBaseStyle}">
|
||||||
<Setter Property="SelectionMode" Value="Extended"/>
|
<Setter Property="SelectionMode" Value="Extended"/>
|
||||||
<!--<Setter Property="VirtualizingPanel.IsVirtualizing" Value="False"/>-->
|
<!--<Setter Property="VirtualizingPanel.IsVirtualizing" Value="False"/>-->
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
<Setter Property="ItemContainerStyle" Value="{StaticResource ListViewItemBaseStyle.Small}"/>
|
<Setter Property="ItemContainerStyle" Value="{StaticResource ListViewItemBaseStyle.Small}"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="MyGroupBoxBaseStyle" TargetType="{x:Type GroupBox}" BasedOn="{StaticResource GroupBoxTab}">
|
<Style x:Key="MyGroupBoxBaseStyle" TargetType="GroupBox" BasedOn="{StaticResource GroupBoxTab}">
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
<Setter Property="hc:TitleElement.Background" Value="Transparent"/>
|
<Setter Property="hc:TitleElement.Background" Value="Transparent"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="MyLogRichTextBoxStyle" TargetType="{x:Type RichTextBox}" BasedOn="{StaticResource RichTextBoxBaseStyle}">
|
<Style x:Key="MyLogRichTextBoxStyle" TargetType="RichTextBox" BasedOn="{StaticResource RichTextBoxBaseStyle}">
|
||||||
<Setter Property="IsReadOnly" Value="True"/>
|
<Setter Property="IsReadOnly" Value="True"/>
|
||||||
<Setter Property="FontFamily" Value="Consolas"/>
|
<Setter Property="FontFamily" Value="Consolas"/>
|
||||||
<Setter Property="Block.LineHeight" Value="3"/>
|
<Setter Property="Block.LineHeight" Value="3"/>
|
||||||
<Setter Property="VerticalScrollBarVisibility" Value="Visible"/>
|
<Setter Property="VerticalScrollBarVisibility" Value="Visible"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="MyVerticalScrollViewerBaseStyle" TargetType="{x:Type ScrollViewer}" BasedOn="{StaticResource ScrollViewerNativeBaseStyle}">
|
<Style x:Key="MyVerticalScrollViewerBaseStyle" TargetType="ScrollViewer" BasedOn="{StaticResource ScrollViewerNativeBaseStyle}">
|
||||||
<Setter Property="Padding" Value="0"/>
|
<Setter Property="Padding" Value="0"/>
|
||||||
<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
|
<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
@@ -99,10 +99,24 @@
|
|||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style TargetType="{x:Type GridSplitter}" BasedOn="{StaticResource MyGridSplitterBaseStyle}"/>
|
<Style x:Key="MyLabelStyle" TargetType="Label" BasedOn="{StaticResource LabelDefault}">
|
||||||
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource MyToggleButtonBaseStyle}"/>
|
<Setter Property="Template">
|
||||||
<Style TargetType="{x:Type ListBox}" BasedOn="{StaticResource MyListBoxBaseStyle}"/>
|
<Setter.Value>
|
||||||
<Style TargetType="{x:Type ListView}" BasedOn="{StaticResource MyListViewBaseStyle}"/>
|
<ControlTemplate TargetType="Label">
|
||||||
<Style TargetType="{x:Type GroupBox}" BasedOn="{StaticResource MyGroupBoxBaseStyle}"/>
|
<Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||||
|
<!-- 直接复制的原本 LabelDefault 的样式, 但是去除了 RecognizesAccessKey 防止不显示第一个下划线 -->
|
||||||
|
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" RecognizesAccessKey="False" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="GridSplitter" BasedOn="{StaticResource MyGridSplitterBaseStyle}"/>
|
||||||
|
<Style TargetType="ToggleButton" BasedOn="{StaticResource MyToggleButtonBaseStyle}"/>
|
||||||
|
<Style TargetType="ListBox" BasedOn="{StaticResource MyListBoxBaseStyle}"/>
|
||||||
|
<Style TargetType="ListView" BasedOn="{StaticResource MyListViewBaseStyle}"/>
|
||||||
|
<Style TargetType="GroupBox" BasedOn="{StaticResource MyGroupBoxBaseStyle}"/>
|
||||||
|
<Style TargetType="Label" BasedOn="{StaticResource MyLabelStyle}"/>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<Grid Margin="30">
|
<Grid Margin="30">
|
||||||
<Grid.Resources>
|
<Grid.Resources>
|
||||||
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource LabelDefault}">
|
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource MyLabelStyle}">
|
||||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
<Border>
|
<Border>
|
||||||
<Border.Resources>
|
<Border.Resources>
|
||||||
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource LabelDefault}">
|
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource MyLabelStyle}">
|
||||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
<Border>
|
<Border>
|
||||||
<Border.Resources>
|
<Border.Resources>
|
||||||
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource LabelDefault}">
|
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource MyLabelStyle}">
|
||||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
<Border>
|
<Border>
|
||||||
<Border.Resources>
|
<Border.Resources>
|
||||||
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource LabelDefault}">
|
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource MyLabelStyle}">
|
||||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
<Border>
|
<Border>
|
||||||
<Border.Resources>
|
<Border.Resources>
|
||||||
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource LabelDefault}">
|
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource MyLabelStyle}">
|
||||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
<Border>
|
<Border>
|
||||||
<Border.Resources>
|
<Border.Resources>
|
||||||
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource LabelDefault}">
|
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource MyLabelStyle}">
|
||||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -239,7 +239,7 @@
|
|||||||
TabStripPlacement="Bottom"
|
TabStripPlacement="Bottom"
|
||||||
DataContext="{Binding SpineObjectTabViewModel}">
|
DataContext="{Binding SpineObjectTabViewModel}">
|
||||||
<TabControl.Resources>
|
<TabControl.Resources>
|
||||||
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource LabelDefault}">
|
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource MyLabelStyle}">
|
||||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -695,7 +695,7 @@
|
|||||||
</Border>
|
</Border>
|
||||||
</TabItem.Header>
|
</TabItem.Header>
|
||||||
<TabItem.Resources>
|
<TabItem.Resources>
|
||||||
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource LabelDefault}">
|
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource MyLabelStyle}">
|
||||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -955,7 +955,7 @@
|
|||||||
|
|
||||||
<Grid Grid.Row="2" DataContext="{Binding SelectedItem}">
|
<Grid Grid.Row="2" DataContext="{Binding SelectedItem}">
|
||||||
<Grid.Resources>
|
<Grid.Resources>
|
||||||
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource LabelDefault}">
|
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource MyLabelStyle}">
|
||||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
<Border>
|
<Border>
|
||||||
<Border.Resources>
|
<Border.Resources>
|
||||||
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource LabelDefault}">
|
<Style TargetType="{x:Type Label}" BasedOn="{StaticResource MyLabelStyle}">
|
||||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
<Setter Property="HorizontalContentAlignment" Value="Right"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
Reference in New Issue
Block a user