commit ff5e96a417e690cef132603e2cb5a2bcb2b9c36f
parent 9b619c11288600b7aa4e1770658deff3b9a9fe97
Author: cfillion <cfillion@users.noreply.github.com>
Date: Tue, 8 Mar 2016 03:42:02 -0500
give a vertical bias to the default dialog position
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/dialog.cpp b/src/dialog.cpp
@@ -177,6 +177,14 @@ void Dialog::center()
int top = (parentHeight - dialogHeight) / 2;
top = min(top + (int)parentRect.top, screenHeight - dialogHeight);
+ const int verticalBias = (int)(parentHeight * 0.1);
+
+#ifdef _WIN32
+ top -= verticalBias;
+#else
+ top += verticalBias; // according to SWELL, top means bottom.
+#endif
+
SetWindowPos(m_handle, HWND_TOP, max(0, left), max(0, top), 0, 0, SWP_NOSIZE);
}