diff options
| author | shuffle2 <godisgovernment@gmail.com> | 2016-10-02 22:46:14 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-02 22:46:14 -0700 |
| commit | 09fd2fd8e2a931947abb870f901e65a2cd211708 (patch) | |
| tree | 95d999498ad122b951417b0e800eb67434a572b8 /Source | |
| parent | fba6801851d68c32b77bfd66f0e2b263b3d81c98 (diff) | |
| parent | 9842cef13f6a5ff8b524f6676f65fb3495846e7f (diff) | |
Merge pull request #4015 from EmptyChaos/wx-misc-fixes
WX: Fix pop-under (win) / game list garbage (win) / language support (Linux)
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/DolphinWX/GameListCtrl.cpp | 32 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/GameListCtrl.h | 4 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Main.cpp | 6 |
3 files changed, 39 insertions, 3 deletions
diff --git a/Source/Core/DolphinWX/GameListCtrl.cpp b/Source/Core/DolphinWX/GameListCtrl.cpp index 39ed2d4e9d..e382588b75 100644 --- a/Source/Core/DolphinWX/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/GameListCtrl.cpp @@ -30,6 +30,11 @@ #include <wx/tipwin.h> #include <wx/wxcrt.h> +#ifdef __WXMSW__ +#include <CommCtrl.h> +#include <wx/msw/dc.h> +#endif + #include "Common/CDUtils.h" #include "Common/CommonPaths.h" #include "Common/CommonTypes.h" @@ -1384,3 +1389,30 @@ bool CGameListCtrl::WiiCompressWarning() "by removing padding data. Your disc image will still work. Continue?"), _("Warning"), wxYES_NO) == wxYES; } + +#ifdef __WXMSW__ +// Windows draws vertical rules between columns when using UXTheme (e.g. Aero, Win10) +// This function paints over those lines which removes them. +// [The repaint background idea is ripped off from Eclipse SWT which does the same thing] +bool CGameListCtrl::MSWOnNotify(int id, WXLPARAM lparam, WXLPARAM* result) +{ + NMLVCUSTOMDRAW* nmlv = reinterpret_cast<NMLVCUSTOMDRAW*>(lparam); + // Intercept the NM_CUSTOMDRAW[CDDS_PREPAINT] + // This event occurs after the background has been painted before the content of the list + // is painted. We can repaint the background to eliminate the column lines here. + if (nmlv->nmcd.hdr.hwndFrom == GetHWND() && nmlv->nmcd.hdr.code == NM_CUSTOMDRAW && + nmlv->nmcd.dwDrawStage == CDDS_PREPAINT) + { + // The column separators have already been painted, paint over them. + wxDCTemp dc(nmlv->nmcd.hdc); + dc.SetBrush(GetBackgroundColour()); + dc.SetPen(*wxTRANSPARENT_PEN); + dc.DrawRectangle(nmlv->nmcd.rc.left, nmlv->nmcd.rc.top, + nmlv->nmcd.rc.right - nmlv->nmcd.rc.left, + nmlv->nmcd.rc.bottom - nmlv->nmcd.rc.top); + } + + // Defer to wxWidgets for normal processing. + return wxListCtrl::MSWOnNotify(id, lparam, result); +} +#endif diff --git a/Source/Core/DolphinWX/GameListCtrl.h b/Source/Core/DolphinWX/GameListCtrl.h index 09f91eca99..7d6275ed47 100644 --- a/Source/Core/DolphinWX/GameListCtrl.h +++ b/Source/Core/DolphinWX/GameListCtrl.h @@ -62,6 +62,10 @@ public: NUMBER_OF_COLUMN }; +#ifdef __WXMSW__ + bool MSWOnNotify(int id, WXLPARAM lparam, WXLPARAM* result) override; +#endif + private: std::vector<int> m_FlagImageIndex; std::vector<int> m_PlatformImageIndex; diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp index fdaa94b6d5..305cae3b7d 100644 --- a/Source/Core/DolphinWX/Main.cpp +++ b/Source/Core/DolphinWX/Main.cpp @@ -315,11 +315,11 @@ void DolphinApp::InitLanguageSupport() m_locale.reset(new wxLocale(language)); // Specify where dolphins *.gmo files are located on each operating system -#ifdef _WIN32 +#ifdef __WXMSW__ m_locale->AddCatalogLookupPathPrefix(StrToWxStr(File::GetExeDirectory() + DIR_SEP "Languages")); -#elif defined(__LINUX__) +#elif defined(__WXGTK__) m_locale->AddCatalogLookupPathPrefix(StrToWxStr(DATA_DIR "../locale")); -#elif defined(__APPLE__) +#elif defined(__WXOSX__) m_locale->AddCatalogLookupPathPrefix( StrToWxStr(File::GetBundleDirectory() + "Contents/Resources")); #endif |
