Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordemi_alucard <demi_alucard@users.sourceforge.net>2012-05-23 00:16:56 +0400
committerdemi_alucard <demi_alucard@users.sourceforge.net>2012-05-23 00:16:56 +0400
commit2b9cb449bedd9c1bf2742e624559047eff41c3de (patch)
treeda36c50f40d23c9d9499648ecb93764fcf08cf4a /src/DSUtil/DSUtil.cpp
parenta4b77b6a55e1cc5ede0cdc8063991ff059d02bbd (diff)
Fixed the comboboxes dropdown list width if they are too small to have scrollbars
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4838 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/DSUtil/DSUtil.cpp')
-rw-r--r--src/DSUtil/DSUtil.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/DSUtil/DSUtil.cpp b/src/DSUtil/DSUtil.cpp
index 1b26bb3d3..7a7975cc6 100644
--- a/src/DSUtil/DSUtil.cpp
+++ b/src/DSUtil/DSUtil.cpp
@@ -2900,8 +2900,13 @@ void CorrectComboListWidth(CComboBox& m_pComboBox)
pDC->SelectObject(pOldFont);
m_pComboBox.ReleaseDC(pDC);
+ // Get the scrollbar width if it exists
+ int min_visible = m_pComboBox.GetMinVisible();
+ int scroll_width = (m_pComboBox.GetCount() > min_visible) ?
+ ::GetSystemMetrics(SM_CXVSCROLL) : 0;
+
// Adjust the width for the vertical scroll bar and the left and right border.
- dx += ::GetSystemMetrics(SM_CXVSCROLL) + 2*::GetSystemMetrics(SM_CXEDGE);
+ dx += scroll_width + 2*::GetSystemMetrics(SM_CXEDGE);
// Set the width of the list box so that every item is completely visible.
m_pComboBox.SetDroppedWidth(dx);