-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from baconpaul/ally-one
Accesibility Change One: Show Acessible Info
- Loading branch information
Showing
5 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
#pragma once | ||
#include "melatonin_inspector/melatonin/component_model.h" | ||
|
||
namespace melatonin | ||
{ | ||
class Accessibility : public juce::Component, private ComponentModel::Listener | ||
{ | ||
public: | ||
Accessibility(ComponentModel & m) : model(m) { | ||
addAndMakeVisible (&panel); | ||
model.addListener (*this); | ||
} | ||
|
||
void updateProperties() | ||
{ | ||
panel.clear(); | ||
|
||
if (!model.getSelectedComponent()) | ||
return; | ||
|
||
auto& ad = model.accessiblityDetail; | ||
auto aprops = juce::Array<juce::PropertyComponent*> { | ||
new juce::TextPropertyComponent (ad.title, "Title", 200, false, false), | ||
new juce::TextPropertyComponent (ad.value, "Value", 200, false, false), | ||
new juce::TextPropertyComponent (ad.role, "Role", 200, false, false), | ||
new juce::TextPropertyComponent (ad.handlerType, "Handler", 200, false, false), | ||
}; | ||
for (auto* p : aprops) | ||
{ | ||
p->setLookAndFeel (&getLookAndFeel()); | ||
} | ||
panel.addProperties(aprops, 0); | ||
resized(); | ||
} | ||
|
||
protected: | ||
ComponentModel& model; | ||
void componentModelChanged (ComponentModel& model) override { | ||
updateProperties(); | ||
} | ||
|
||
|
||
void resized() override | ||
{ | ||
TRACE_COMPONENT(); | ||
// let the property panel know what total height we need to be | ||
panel.setBounds (getLocalBounds().withTrimmedTop (padding)); | ||
} | ||
|
||
int padding {3}; | ||
|
||
juce::PropertyPanel panel { "Accessibility" }; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters