Skip to content

Commit

Permalink
Added: Dark Mode for ToolTips
Browse files Browse the repository at this point in the history
  • Loading branch information
XusinboyBekchanov committed Mar 13, 2022
1 parent 8728946 commit a1af773
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion mff/Control.bas
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,10 @@ Namespace My.Sys.Forms
Brush.Handle = hbrBkgnd
End If
SetWindowTheme(FHandle, "DarkMode_Explorer", nullptr)
If ToolTipHandle <> 0 Then SetWindowTheme(ToolTipHandle, "DarkMode_Explorer", nullptr)
Else
SetWindowTheme(FHandle, NULL, NULL)
If ToolTipHandle <> 0 Then SetWindowTheme(ToolTipHandle, NULL, NULL)
If FBackColor = -1 Then
Brush.Handle = 0
Else
Expand Down Expand Up @@ -1529,7 +1531,7 @@ Namespace My.Sys.Forms
Case WM_NOTIFY
Dim As LPNMHDR NM
Static As HWND FWindow
NM = Cast(LPNMHDR,Message.lParam)
NM = Cast(LPNMHDR, Message.lParam)
If NM->Code = TTN_NEEDTEXT Then
If FWindow Then SendMessage FWindow,CM_NEEDTEXT,Message.wParam, Message.lParam
Else
Expand Down
7 changes: 6 additions & 1 deletion mff/ToolBar.bas
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,12 @@ Namespace My.Sys.Forms
If Value Then
SetWindowTheme(FHandle, "DarkMode_InfoPaneToolbar", nullptr) ' "DarkMode", "DarkMode_InfoPaneToolbar", "DarkMode_BBComposited", "DarkMode_InactiveBBComposited", "DarkMode_MaxBBComposited", "DarkMode_MaxInactiveBBComposited"
Brush.Handle = hbrBkgnd
Dim As HWND hwndTT = Cast(HWND, SendMessage(FHandle, TB_GETTOOLTIPS, 0, 0))
SetWindowTheme(hwndTT, "DarkMode_Explorer", nullptr)
'SendMessageW(FHandle, WM_THEMECHANGED, 0, 0)
Else
Dim As HWND hwndTT = Cast(HWND, SendMessage(FHandle, TB_GETTOOLTIPS, 0, 0))
SetWindowTheme(hwndTT, NULL, NULL)
End If
'SendMessage FHandle, WM_THEMECHANGED, 0, 0
End Sub
Expand All @@ -873,7 +878,7 @@ Namespace My.Sys.Forms
#ifndef __USE_GTK__
Select Case Message.Msg
Case WM_PAINT
If g_darkModeSupported AndAlso g_darkModeEnabled AndAlso FDefaultBackColor = FBackColor Then
If g_darkModeSupported AndAlso g_darkModeEnabled Then
If Not FDarkMode Then
SetDark True
' FDarkMode = True
Expand Down

0 comments on commit a1af773

Please sign in to comment.