Skip to content

Commit

Permalink
fix firmware version label resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
vsicurella committed Aug 11, 2024
1 parent 1c20cbd commit aaf0c4f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/MainComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> lumatoneBounds = allKeysOverview->getLocalGraphicBounds().translated(allKeysOverview->getX(), allKeysOverview->getY());
lblFirmwareVersion->setBounds(lumatoneBounds.getX(), lumatoneBounds.getBottom(), contentWidth, btnHeight * 0.7f);
}

void MainContentComponent::resizeEditSectionTabs()
Expand Down Expand Up @@ -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();
}
}
5 changes: 5 additions & 0 deletions Source/lumatone_editor_library/ui/keyboard_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ void LumatoneKeyboardComponent::setUiMode(LumatoneKeyboardComponent::UiMode mode
uiMode = modeIn;
}

juce::Rectangle<int> LumatoneKeyboardComponent::getLocalGraphicBounds() const
{
return lumatoneBounds;
}

void LumatoneKeyboardComponent::layoutChanged(const LumatoneLayout& mappingData)
{
for (int boardIndex = 0; boardIndex < octaveBoards.size(); boardIndex++)
Expand Down
4 changes: 4 additions & 0 deletions Source/lumatone_editor_library/ui/keyboard_component.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ class LumatoneKeyboardComponent : public juce::Component,
LumatoneKeyboardComponent::UiMode getUiMode() const { return uiMode; }
void setUiMode(LumatoneKeyboardComponent::UiMode modeIn);

public:

juce::Rectangle<int> getLocalGraphicBounds() const;

public:
// LumatoneEditor::EditorListener Implementation
void layoutChanged(const LumatoneLayout& mappingData) override;
Expand Down

0 comments on commit aaf0c4f

Please sign in to comment.