1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Introjucer: modules panel tweak.

This commit is contained in:
jules 2012-07-21 14:38:03 +01:00
parent cd62c252de
commit 6838666a58

View file

@ -46,21 +46,17 @@ public:
moduleList.rescan (ModuleList::getLocalModulesFolder (&project));
addAndMakeVisible (&modulesLocation);
modulesLocation.setBounds ("150, 3, parent.width - 180, 28");
modulesLocation.addListener (this);
modulesLabel.attachToComponent (&modulesLocation, true);
addAndMakeVisible (&updateModulesButton);
updateModulesButton.setBounds ("parent.width - 175, 3, parent.width - 4, 28");
updateModulesButton.addListener (this);
moduleListBox.setOwner (this);
addAndMakeVisible (&moduleListBox);
moduleListBox.setBounds ("4, 31, parent.width / 2 - 4, parent.height - 32");
addAndMakeVisible (&copyingMessage);
copyingMessage.setBounds ("4, parent.height - 30, parent.width - 4, parent.height - 1");
copyingMessage.refresh();
}
@ -104,12 +100,10 @@ public:
settings = nullptr;
if (selectedModule != nullptr)
{
addAndMakeVisible (settings = new ModuleSettingsPanel (project, moduleList, selectedModule->uid));
settings->setBounds ("parent.width / 2 + 1, 31, parent.width - 3, parent.height - 32");
}
copyingMessage.refresh();
resized();
}
void refresh()
@ -127,6 +121,18 @@ public:
getLookAndFeel().drawPropertyComponentBackground (g, getWidth(), getHeight(), *this);
}
void resized()
{
modulesLocation.setBounds (150, 3, getWidth() - 180 - 150, 25);
updateModulesButton.setBounds (modulesLocation.getRight() + 6, 3, getWidth() - modulesLocation.getRight() - 12, 25);
moduleListBox.setBounds (4, 31, getWidth() / 3 - 4, getHeight() - 63);
copyingMessage.setBounds (4, getHeight() - 30, getWidth() - 8, getHeight() - 31);
if (settings != nullptr)
settings->setBounds (moduleListBox.getRight() + 5, moduleListBox.getY(),
getWidth() - (moduleListBox.getRight() + 5), moduleListBox.getHeight());
}
//==============================================================================
class ModuleSelectionListBox : public ListBox,
public ListBoxModel
@ -177,10 +183,7 @@ public:
g.setColour (Colours::black);
g.setFont (Font (height * 0.7f, Font::bold));
g.drawFittedText (m->uid, height, 0, 200, height, Justification::centredLeft, 1);
g.setFont (Font (height * 0.55f, Font::italic));
g.drawText (m->name, height + 200, 0, width - height - 200, height, Justification::centredLeft, true);
g.drawFittedText (m->uid, height, 0, width - height, height, Justification::centredLeft, 1);
}
}