2024-06-02 14:01:39 +00:00
|
|
|
#include "AboutComponent.h"
|
|
|
|
|
2025-02-03 14:33:53 +00:00
|
|
|
AboutComponent::AboutComponent(const void *image, size_t imageSize, juce::String sectionText, int port) {
|
2024-06-02 14:01:39 +00:00
|
|
|
addAndMakeVisible(logoComponent);
|
|
|
|
addAndMakeVisible(text);
|
2024-09-22 17:49:58 +00:00
|
|
|
|
|
|
|
logo = juce::ImageFileFormat::loadFrom(image, imageSize);
|
2024-06-02 14:01:39 +00:00
|
|
|
|
|
|
|
logoComponent.setImage(logo);
|
|
|
|
|
|
|
|
text.setMultiLine(true);
|
|
|
|
text.setReadOnly(true);
|
|
|
|
text.setInterceptsMouseClicks(false, false);
|
|
|
|
text.setOpaque(false);
|
|
|
|
text.setColour(juce::TextEditor::backgroundColourId, juce::Colours::transparentBlack);
|
|
|
|
text.setColour(juce::TextEditor::outlineColourId, juce::Colours::transparentBlack);
|
|
|
|
text.setJustification(juce::Justification(juce::Justification::centred));
|
2024-09-22 17:49:58 +00:00
|
|
|
text.setText(sectionText);
|
2025-01-24 12:38:28 +00:00
|
|
|
|
2025-02-03 14:45:59 +00:00
|
|
|
if (port > 0) {
|
|
|
|
addAndMakeVisible(portText);
|
|
|
|
|
|
|
|
// TODO: Integrate this better
|
|
|
|
portText.setMultiLine(false);
|
|
|
|
portText.setReadOnly(true);
|
|
|
|
portText.setInterceptsMouseClicks(false, false);
|
|
|
|
portText.setOpaque(false);
|
|
|
|
portText.setColour(juce::TextEditor::backgroundColourId, juce::Colours::transparentBlack);
|
|
|
|
portText.setColour(juce::TextEditor::outlineColourId, juce::Colours::transparentBlack);
|
|
|
|
portText.setJustification(juce::Justification(juce::Justification::centred));
|
|
|
|
portText.setText(juce::String("Blender Port: ") + juce::String(port));
|
|
|
|
}
|
2024-06-02 14:01:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void AboutComponent::resized() {
|
|
|
|
auto area = getLocalBounds();
|
|
|
|
area.removeFromTop(10);
|
|
|
|
logoComponent.setBounds(area.removeFromTop(110));
|
2025-01-24 12:38:28 +00:00
|
|
|
portText.setBounds(area.removeFromBottom(20).removeFromTop(15));
|
2024-06-02 14:01:39 +00:00
|
|
|
text.setBounds(area);
|
|
|
|
}
|