Merge pS-w1-t6-size: 1080p default window size + min floor (S-VIEW-SIZE-1)

This commit is contained in:
2026-07-27 13:37:43 -04:00
2 changed files with 19 additions and 2 deletions
+18 -2
View File
@@ -128,8 +128,9 @@ int thumbBins(const BrowserLayout& layout) {
ReaSamplerEditor::ReaSamplerEditor(ReaSamplerProcessor* processor) ReaSamplerEditor::ReaSamplerEditor(ReaSamplerProcessor* processor)
: CPluginView(nullptr), processor_(processor) { : CPluginView(nullptr), processor_(processor) {
// Default view size — sized to show a couple of card rows + the setup strip. // Default view size — 840×560 gives comfortable room for the three-band Sample face
ViewRect r(0, 0, 560, 400); // on a 1080p screen (an interim canvas; Wave 2 tunes final band-height numbers).
ViewRect r(0, 0, 840, 560);
setRect(r); setRect(r);
} }
@@ -480,6 +481,21 @@ tresult PLUGIN_API ReaSamplerEditor::canResize() {
return kResultTrue; return kResultTrue;
} }
tresult PLUGIN_API ReaSamplerEditor::checkSizeConstraint(ViewRect* rect) {
// Enforce a minimum usable floor: at least 560 wide and 380 tall. The host calls this
// before every resize; clamp the proposed rect in place and return kResultTrue so the
// host applies the (possibly adjusted) rect rather than the raw user drag.
// 560×380 keeps the title band + toggle band + a couple of card rows + the setup strip
// visible; anything smaller would clip essential UI. The default 840×560 is above this
// floor — Wave 2 tunes final numbers once the three-band layout is in.
constexpr int kMinW = 560;
constexpr int kMinH = 380;
if (!rect) return kResultFalse;
if (rect->getWidth() < kMinW) rect->right = rect->left + kMinW;
if (rect->getHeight() < kMinH) rect->bottom = rect->top + kMinH;
return kResultTrue;
}
#ifdef _WIN32 #ifdef _WIN32
void ReaSamplerEditor::invalidate() { void ReaSamplerEditor::invalidate() {
+1
View File
@@ -56,6 +56,7 @@ public:
Steinberg::tresult PLUGIN_API isPlatformTypeSupported( Steinberg::tresult PLUGIN_API isPlatformTypeSupported(
Steinberg::FIDString type) override; Steinberg::FIDString type) override;
Steinberg::tresult PLUGIN_API canResize() override; Steinberg::tresult PLUGIN_API canResize() override;
Steinberg::tresult PLUGIN_API checkSizeConstraint(Steinberg::ViewRect* rect) override;
protected: protected:
void attachedToParent() override; void attachedToParent() override;