From aaf0c4f7a579b9f6997fd5f79835ed7fdd580a4c Mon Sep 17 00:00:00 2001 From: Vincenzo Sicurella Date: Sat, 10 Aug 2024 23:39:26 -0400 Subject: [PATCH] fix firmware version label resizing --- Source/MainComponent.cpp | 6 ++++-- Source/lumatone_editor_library/ui/keyboard_component.cpp | 5 +++++ Source/lumatone_editor_library/ui/keyboard_component.h | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Source/MainComponent.cpp b/Source/MainComponent.cpp index b6a5a3f..b1fcba5 100644 --- a/Source/MainComponent.cpp +++ b/Source/MainComponent.cpp @@ -420,8 +420,8 @@ void MainContentComponent::resized() resizeLabelWithHeight(lblAppVersion.get(), roundToInt(lblAppName->getHeight() * 0.75f)); lblAppVersion->setTopLeftPosition(lblAppName->getRight(), lblAppName->getBottom() - lblAppVersion->getHeight()); - // resizeLabelWithHeight(lblFirmwareVersion.get(), btnHeight * 0.6f); - lblFirmwareVersion->setBounds(allKeysOverview->getX(), allKeysOverview->getBottom(), btnHeight * 0.6f, contentWidth); + juce::Rectangle lumatoneBounds = allKeysOverview->getLocalGraphicBounds().translated(allKeysOverview->getX(), allKeysOverview->getY()); + lblFirmwareVersion->setBounds(lumatoneBounds.getX(), lumatoneBounds.getBottom(), contentWidth, btnHeight * 0.7f); } void MainContentComponent::resizeEditSectionTabs() @@ -455,5 +455,7 @@ void MainContentComponent::handleStatePropertyChange(juce::ValueTree stateIn, co { auto string = juce::String("Firmware version: " + getFirmwareVersion().toDisplayString()); lblFirmwareVersion->setText(string, juce::NotificationType::sendNotification); + + requestDeviceGlobalSettings(); } } diff --git a/Source/lumatone_editor_library/ui/keyboard_component.cpp b/Source/lumatone_editor_library/ui/keyboard_component.cpp index cf4e1f3..68b3f16 100644 --- a/Source/lumatone_editor_library/ui/keyboard_component.cpp +++ b/Source/lumatone_editor_library/ui/keyboard_component.cpp @@ -187,6 +187,11 @@ void LumatoneKeyboardComponent::setUiMode(LumatoneKeyboardComponent::UiMode mode uiMode = modeIn; } +juce::Rectangle LumatoneKeyboardComponent::getLocalGraphicBounds() const +{ + return lumatoneBounds; +} + void LumatoneKeyboardComponent::layoutChanged(const LumatoneLayout& mappingData) { for (int boardIndex = 0; boardIndex < octaveBoards.size(); boardIndex++) diff --git a/Source/lumatone_editor_library/ui/keyboard_component.h b/Source/lumatone_editor_library/ui/keyboard_component.h index 33a2979..e4ba7b4 100644 --- a/Source/lumatone_editor_library/ui/keyboard_component.h +++ b/Source/lumatone_editor_library/ui/keyboard_component.h @@ -78,6 +78,10 @@ class LumatoneKeyboardComponent : public juce::Component, LumatoneKeyboardComponent::UiMode getUiMode() const { return uiMode; } void setUiMode(LumatoneKeyboardComponent::UiMode modeIn); +public: + + juce::Rectangle getLocalGraphicBounds() const; + public: // LumatoneEditor::EditorListener Implementation void layoutChanged(const LumatoneLayout& mappingData) override;