MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / updateMinimumSize

Method updateMinimumSize

app/src/Platform/CSD.cpp:1088–1103  ·  view source on GitHub ↗

* @brief Updates the window minimum size to account for CSD decorations. */

Source from the content-addressed store, hash-verified

1086 * @brief Updates the window minimum size to account for CSD decorations.
1087 */
1088void Window::updateMinimumSize()
1089{
1090 if (!m_window)
1091 return;
1092
1093 m_minSize = preferredSize();
1094 const int margin = shadowMargin();
1095 const int tbHeight = titleBarHeight();
1096 const int minWidth = qMax(0, m_minSize.width()) + 2 * margin;
1097 const int minHeight = qMax(0, m_minSize.height()) + 2 * margin + tbHeight;
1098 const int minTitleBarWidth = 3 * (CSD::ButtonSize + CSD::ButtonSpacing) + 2 * CSD::ButtonMargin
1099 + CSD::IconSize + 2 * CSD::IconMargin;
1100
1101 m_window->setMinimumSize(
1102 QSize(qMax(minWidth, minTitleBarWidth + 2 * margin), qMax(minHeight, tbHeight + 2 * margin)));
1103}
1104
1105/**
1106 * @brief Updates the frame position and size to fill the window.

Callers

nothing calls this directly

Calls 2

widthMethod · 0.80
heightMethod · 0.80

Tested by

no test coverage detected