@@ -250,7 +250,7 @@ void KeyboardMacroView::refreshUI() {
250250 }
251251}
252252
253- void setMidiDeviceFromString (std::shared_ptr<TypedNamedValue> prop, std::string const & storedValue, bool allowAppend = false ) {
253+ void setMidiDeviceFromString (const std::shared_ptr<TypedNamedValue>& prop, const std::string& storedValue, bool allowAppend = false ) {
254254 if (prop) {
255255 auto midiDeviceProp = std::dynamic_pointer_cast<MidiDevicePropertyEditor>(prop);
256256 if (midiDeviceProp) {
@@ -381,15 +381,19 @@ void KeyboardMacroView::resized()
381381{
382382 auto area = getLocalBounds ();
383383
384+ constexpr int SETUP_HEIGHT_DIVISOR = 2 ; // Setup gets 1/2 of height
385+ constexpr int KEYBOARD_HEIGHT_DIVISOR = 4 ; // Keyboard gets 1/4 of height
386+
384387 // Needed width
385388 float keyboardDesiredWidth = keyboard_.getTotalKeyboardWidth () + LAYOUT_INSET_NORMAL *2 ;
386389 int contentWidth = std::min (area.getWidth (), 600 );
387390 int availableHeight = area.getHeight ();
388391
389392 // On Top, the setup
390- customSetup_.setBounds (area.removeFromTop (availableHeight/2 ).withSizeKeepingCentre (contentWidth, availableHeight / 2 -2 * LAYOUT_INSET_NORMAL ).reduced (LAYOUT_INSET_NORMAL ));
393+ int setupHeight = availableHeight / SETUP_HEIGHT_DIVISOR ;
394+ customSetup_.setBounds (area.removeFromTop (setupHeight).withSizeKeepingCentre (contentWidth, setupHeight -2 * LAYOUT_INSET_NORMAL ).reduced (LAYOUT_INSET_NORMAL ));
391395 // Then the keyboard
392- auto keyboardArea = area.removeFromTop (availableHeight /4 );
396+ auto keyboardArea = area.removeFromTop (availableHeight / KEYBOARD_HEIGHT_DIVISOR );
393397 keyboard_.setBounds (keyboardArea.withSizeKeepingCentre ((int )keyboardDesiredWidth, std::min (area.getHeight (), 150 )).reduced (LAYOUT_INSET_NORMAL ));
394398
395399 // Set up table
0 commit comments