Skip to content

Commit

Permalink
fix Hex-Dragon#5744: 模组下载界面显示Tooltip时滚动鼠标致使该Tooltip被永远隐藏
Browse files Browse the repository at this point in the history
  • Loading branch information
Open-KFC committed Mar 1, 2025
1 parent 503244a commit f72b508
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Plain Craft Launcher 2/Application.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border Loaded="TooltipLoaded" Unloaded="TooltipUnloaded" BorderBrush="{DynamicResource ColorBrush1}" BorderThickness="1" CornerRadius="3" Background="White" Margin="0,0,4,4" SnapsToDevicePixels="True">
<Border x:Name="PART_ExtendTextTooltipBoarder" Loaded="TooltipLoaded" Unloaded="TooltipUnloaded" BorderBrush="{DynamicResource ColorBrush1}" BorderThickness="1" CornerRadius="3" Background="White" Margin="0,0,4,4" SnapsToDevicePixels="True">
<TextBlock Text="{TemplateBinding ContentControl.Content}" TextWrapping="Wrap" Foreground="{DynamicResource ColorBrush1}" Margin="7,5" FontSize="12"/>
</Border>
</ControlTemplate>
Expand Down
7 changes: 7 additions & 0 deletions Plain Craft Launcher 2/Modules/Minecraft/MyCompItem.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
'指向时扩展描述
Private Sub LabInfo_MouseEnter(sender As Object, e As MouseEventArgs) Handles LabInfo.MouseEnter
If IsTextTrimmed(LabInfo) Then
'fix #5744
'MyScrollViewer.vb ln23 为使鼠标滚动时tooltip被隐藏,将不透明度改为了0
Dim TooltipBorder As Border = CType(ToolTipInfo.Template.FindName("PART_ExtendTextTooltipBoarder", ToolTipInfo), Border)
If TooltipBorder IsNot Nothing Then
TooltipBorder.Opacity = 1
End If

ToolTipInfo.Content = LabInfo.Text
ToolTipInfo.Width = LabInfo.ActualWidth + 25
LabInfo.ToolTip = ToolTipInfo
Expand Down

0 comments on commit f72b508

Please sign in to comment.