SubWindow: Increase to respect child's sizeHint (#6956)

Before this commit, on creation, `SubWindow` gets resized to exactly the
children's `sizeHint`. This makes the child too small, since the
`SubWindow` already contains a title bar and borders.

With this commit, the `SubWindow` is calculated such that after
rendering, the child window gets exactly the `size` that its `sizeHint`
has previously suggested.

Most of LMMS widgets are not resizable, but the Lv2 help window is a
good example to test this out. The help windows now in most cases
contain enough space to fit the help text. In some cases, it still does
not fit, though debug prints show that the `size` matches the
`sizeHint`.
This commit is contained in:
Johannes Lorenz
2023-11-12 02:21:51 +01:00
committed by GitHub
parent 5c37aa2e2e
commit 652b1fa57a
3 changed files with 38 additions and 6 deletions

View File

@@ -68,6 +68,8 @@ public:
void setActiveColor( const QBrush & b );
void setTextShadowColor( const QColor &c );
void setBorderColor( const QColor &c );
int titleBarHeight() const;
int frameWidth() const;
protected:
// hook the QWidget move/resize events to update the tracked geometry