minimum sizes for all model controls#353
Conversation
src/MainComponent.cpp
Outdated
|
|
||
| if (auto* window = findParentComponentOfClass<DocumentWindow>()) | ||
| { | ||
| window->setResizeLimits(900, 700, 20000, 20000); |
There was a problem hiding this comment.
I don't see any noticeable difference from this line.
There was a problem hiding this comment.
Changes look good, but the control areas can still overlap (try with xribene/HARP-UI-TEST-v3). Maybe there is some way to extend the controls to separate rows when there would otherwise be overflow.
I also agree with making an inherited class for the ToggleComponent, but intrinsically it already has a label so the current code duplicates this (see below).
Finally, it seems the fixed minimum height can still lead to the labels on the sliders getting cut off.
|
Merging and closing this since the original issue has been fixed along with other improvements. However, there are still a few residual bugs that will be bumped to a new issue: #367. |

Summary
Previously, when the HARP window was resized horizontally, several controls would shrink below a usable width. This caused Inconsistent layout behavior across different models. The goal of this fix is to ensure a minimum size for all model control widgets so that labels, sliders, toggles, combo boxes, and text fields do not collapse or overlap when the window is resized.
Changes Introduced
SliderWithLabel.h
Added getMinimumWidth() helper to compute width based on text size.
Ensures labels never overlap the rotary slider, even when window width shrinks.
ComboBoxWithLabel.h
Added minimum width enforcement using label text width and padding.
TitledTextBox.h
Added minimum width calculation based on title text and baseline textbox width.
ControlAreaWidget.h
Replaced hardcoded constants with dynamic minimum widths
Testing Steps
Load various models (e.g., VampNet, MegaTTS3, Stable Audio 2.0). Resize the window horizontally.
Controls no longer shrink below readable/usable size
Layout feels consistent across models
All components maintain a stable minimal-width behavior
Closes #332