diff options
Diffstat (limited to 'src/mpc-hc/MainFrmControls.cpp')
-rw-r--r-- | src/mpc-hc/MainFrmControls.cpp | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/src/mpc-hc/MainFrmControls.cpp b/src/mpc-hc/MainFrmControls.cpp index 0aaaea205..80161db66 100644 --- a/src/mpc-hc/MainFrmControls.cpp +++ b/src/mpc-hc/MainFrmControls.cpp @@ -1,5 +1,5 @@ /* - * (C) 2013-2014 see Authors.txt + * (C) 2013-2016 see Authors.txt * * This file is part of MPC-HC. * @@ -21,6 +21,8 @@ #include "stdafx.h" #include "MainFrmControls.h" #include "MainFrm.h" +#include "mplayerc.h" +#include <mvrInterfaces.h> #define DELAY_SHOW_NOT_LOADED_TIME_MS 3000 @@ -243,7 +245,7 @@ CSize CMainFrameControls::GetDockZonesMinSize(unsigned uSaneFallback) auto pBar = static_cast<CPlayerBar*>(pDock->m_arrBars[i]); if (!pBar && !bNewRow) { bNewRow = true; - maxRowSize = max(maxRowSize, rowSize); + maxRowSize = std::max(maxRowSize, rowSize); rowSize = 0; } if (pBar) { @@ -271,8 +273,8 @@ CSize CMainFrameControls::GetDockZonesMinSize(unsigned uSaneFallback) const CSize sizeBottom(m_panelZones.find(DOCK_BOTTOM) != std::end(m_panelZones) ? calcDock(DOCK_BOTTOM) : 0); CSize ret; - ret.cx = max(sizeLeft.cx + sizeRight.cx, max(sizeTop.cx, sizeBottom.cx)); - ret.cy = sizeTop.cy + sizeBottom.cy + max(sizeLeft.cy, sizeRight.cy); + ret.cx = std::max(sizeLeft.cx + sizeRight.cx, std::max(sizeTop.cx, sizeBottom.cx)); + ret.cy = sizeTop.cy + sizeBottom.cy + std::max(sizeLeft.cy, sizeRight.cy); const unsigned uToolbars = GetToolbarsHeight(); if (uToolbars) { ret.cx = std::max(ret.cx, saneX); @@ -322,8 +324,14 @@ void CMainFrameControls::UpdateToolbarsVisibility() struct { int maskShow, maskHide; - void show(int mask) { maskShow |= mask; maskHide &= ~mask; } - void hide(int mask) { maskHide |= mask; maskShow &= ~mask; } + void show(int mask) { + maskShow |= mask; + maskHide &= ~mask; + } + void hide(int mask) { + maskHide |= mask; + maskShow &= ~mask; + } } mask = { 0, 0 }; const int maskAll = DOCK_LEFT | DOCK_RIGHT | DOCK_TOP | DOCK_BOTTOM; @@ -396,17 +404,21 @@ void CMainFrameControls::UpdateToolbarsVisibility() if (bOnWindow) { unsigned uTop, uLeft, uRight, uBottom; GetDockZones(uTop, uLeft, uRight, uBottom, bEnumedPanelZones ? false : (bEnumedPanelZones = true)); - unsigned uExclSeekbarHeight = 0; + CRect clientRect; + m_pMainFrame->GetClientRect(clientRect); + CRect exclSeekbarRect; if (bExclSeekbar) { - uExclSeekbarHeight = 56; // TODO: query this through IMadVRInfo + if (!m_pMainFrame->m_pMVRI + || FAILED(m_pMainFrame->m_pMVRI->GetRect("seekbarRect", exclSeekbarRect))) { + exclSeekbarRect = clientRect; + exclSeekbarRect.top = 56; + } uBottom = 0; } if (!bCanHideDockedPanels) { uTop = uLeft = uRight = 0; } - CRect clientRect; - m_pMainFrame->GetClientRect(clientRect); - const bool bHoveringExclSeekbar = (bExclSeekbar && clientPoint.y + (int)uExclSeekbarHeight >= clientRect.Height()); + const bool bHoveringExclSeekbar = (bExclSeekbar && exclSeekbarRect.PtInRect(clientPoint)); ret = true; if (clientRect.PtInRect(clientPoint)) { if (ePolicy == CAppSettings::HideFullscreenControlsPolicy::SHOW_WHEN_CURSOR_MOVED) { |