Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
sdottaka committed Sep 25, 2024
1 parent a1b27d1 commit 18aa09a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 31 deletions.
17 changes: 0 additions & 17 deletions Src/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
#include "locality.h"
#include "DirWatcher.h"
#include "Win_VersionHelper.h"
#include <afxwinverapi.h>

using std::vector;
using boost::begin;
Expand Down Expand Up @@ -224,10 +223,6 @@ BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
ON_WM_ACTIVATEAPP()
ON_WM_NCCALCSIZE()
ON_WM_SIZE()
ON_WM_MOUSEMOVE()
ON_WM_MOUSELEAVE()
ON_WM_NCMOUSEMOVE()
ON_WM_NCMOUSELEAVE()
ON_UPDATE_COMMAND_UI_RANGE(CMenuBar::FIRST_MENUID, CMenuBar::FIRST_MENUID + 10, OnUpdateMenuBarMenuItem)
// [File] menu
ON_COMMAND(ID_FILE_NEW, (OnFileNew<2, ID_MERGE_COMPARE_TEXT>))
Expand Down Expand Up @@ -2551,18 +2546,6 @@ void CMainFrame::OnSize(UINT nType, int cx, int cy)
__super::OnSize(nType, cx, cy);
}

void CMainFrame::OnMouseMove(UINT nFlags, CPoint point)
{
}

void CMainFrame::OnMouseLeave()
{
}

void CMainFrame::OnNcMouseMove(UINT nHitTest, CPoint point)
{
}

BOOL CMainFrame::CreateToolbar()
{
if (!m_wndMenuBar.Create(this))
Expand Down
3 changes: 0 additions & 3 deletions Src/MainFrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,6 @@ class CMainFrame : public CMDIFrameWnd
afx_msg void OnActivateApp(BOOL bActive, DWORD dwThreadID);
afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnMouseLeave();
afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
afx_msg void OnToolbarSize(UINT id);
afx_msg void OnUpdateToolbarSize(CCmdUI* pCmdUI);
afx_msg BOOL OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult);
Expand Down
21 changes: 10 additions & 11 deletions Src/TitleBarHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,16 @@ void CTitleBarHelper::DrawIcon(CWnd* pWnd, CDC& dc)
HICON hIcon = (HICON)pWnd->SendMessage(WM_GETICON, ICON_SMALL2, 0);
if (hIcon == nullptr)
hIcon = (HICON)GetClassLongPtr(pWnd->m_hWnd, GCLP_HICONSM);
if (hIcon != nullptr)
{
const int topMargin = (m_maximized ? -m_rc.top : 0);
const int height = m_size.cy - topMargin;
const int cx = PointToPixel(12.f);
const int cy = PointToPixel(12.f);
const int x = (PointToPixel(m_leftMargin) - cx) / 2;
const int y = (height - cy) / 2 + topMargin;
DrawIconEx(dc.m_hDC, x, y, hIcon,
cx, cy, 0, nullptr, DI_NORMAL);
}
if (hIcon == nullptr)
return;
const int topMargin = (m_maximized ? -m_rc.top : 0);
const int height = m_size.cy - topMargin;
const int cx = PointToPixel(12.f);
const int cy = PointToPixel(12.f);
const int x = (PointToPixel(m_leftMargin) - cx) / 2;
const int y = (height - cy) / 2 + topMargin;
DrawIconEx(dc.m_hDC, x, y, hIcon,
cx, cy, 0, nullptr, DI_NORMAL);
}

static void DrawTopRightEdgeWithCurve(Gdiplus::Graphics& graphics, Gdiplus::Pen& pen, Gdiplus::Rect rect, int cornerRadius)
Expand Down

0 comments on commit 18aa09a

Please sign in to comment.