Mercurial > foo_out_sdl
comparison foosdk/sdk/libPPUI/DarkMode-CHyperLink.h @ 1:20d02a178406 default tip
*: check in everything else
yay
| author | Paper <paper@tflc.us> |
|---|---|
| date | Mon, 05 Jan 2026 02:15:46 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 0:e9bb126753e7 | 1:20d02a178406 |
|---|---|
| 1 #pragma once | |
| 2 #include <atlctrlx.h> | |
| 3 #include "DarkMode.h" | |
| 4 | |
| 5 namespace DarkMode { | |
| 6 static constexpr COLORREF colorHyperLink = 0xCC6600; // taken from screenshot of syslink | |
| 7 | |
| 8 template<typename impl_t> class CHyperLinkImpl : public ::CHyperLinkImpl<impl_t> { | |
| 9 public: | |
| 10 BEGIN_MSG_MAP_EX(CDarkHyperLinkImpl) | |
| 11 MESSAGE_HANDLER_EX(DarkMode::msgSetDarkMode(), OnSetDarkMode) | |
| 12 CHAIN_MSG_MAP(::CHyperLinkImpl<impl_t>) | |
| 13 END_MSG_MAP() | |
| 14 private: | |
| 15 LRESULT OnSetDarkMode(UINT, WPARAM wp, LPARAM) { | |
| 16 const bool bDark = (wp != 0); | |
| 17 if ( m_clrLinkBackup == CLR_INVALID ) m_clrLinkBackup = this->m_clrLink; | |
| 18 | |
| 19 if (bDark != m_isDark) { | |
| 20 m_isDark = bDark; | |
| 21 this->m_clrLink = bDark ? colorHyperLink : m_clrLinkBackup; | |
| 22 this->Invalidate(); | |
| 23 } | |
| 24 | |
| 25 return 1; | |
| 26 } | |
| 27 COLORREF m_clrLinkBackup = CLR_INVALID; | |
| 28 bool m_isDark = false; | |
| 29 }; | |
| 30 | |
| 31 | |
| 32 class CHyperLink : public CHyperLinkImpl<CHyperLink> { | |
| 33 public: | |
| 34 DECLARE_WND_CLASS(_T("WTL_DarkHyperLink")) | |
| 35 }; | |
| 36 | |
| 37 } |
