Skip to content
Open
Changes from all 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
25 changes: 24 additions & 1 deletion Plain Craft Launcher 2/Application.xaml.vb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Imports System.Reflection
Imports System.ComponentModel
Imports System.Reflection
Imports System.Windows.Threading

Public Class Application
Expand Down Expand Up @@ -262,4 +263,26 @@ WaitRetry:
ShowingTooltips.Remove(sender)
End Sub

'Tooltip 显示位置修正

Private Shared ReadOnly _menuDropAlignmentField As FieldInfo

Shared Sub New()
_menuDropAlignmentField = GetType(SystemParameters).GetField("_menuDropAlignment", BindingFlags.NonPublic Or BindingFlags.Static)
System.Diagnostics.Debug.Assert(_menuDropAlignmentField IsNot Nothing)

EnsureStandardPopupAlignment()
AddHandler SystemParameters.StaticPropertyChanged, AddressOf SystemParameters_StaticPropertyChanged
End Sub

Private Shared Sub SystemParameters_StaticPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
EnsureStandardPopupAlignment()
End Sub

Private Shared Sub EnsureStandardPopupAlignment()
If SystemParameters.MenuDropAlignment AndAlso _menuDropAlignmentField IsNot Nothing Then
_menuDropAlignmentField.SetValue(Nothing, False)
End If
End Sub

End Class
Loading