1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-14 00:14:18 +00:00

Refactoring of some glypharrangement code.

This commit is contained in:
jules 2013-06-15 19:27:34 +01:00
parent 49fd486c23
commit fc79df875f
8 changed files with 46 additions and 107 deletions

View file

@ -232,6 +232,7 @@ Result ModuleList::rescan (const File& newModulesFolder)
info->version = m.getVersion();
info->name = m.moduleInfo ["name"];
info->description = m.moduleInfo ["description"];
info->license = m.moduleInfo ["license"];
info->file = moduleDef;
}
}
@ -273,6 +274,7 @@ bool ModuleList::loadFromWebsite()
info->version = lm.getVersion();
info->name = lm.getName();
info->description = lm.getDescription();
info->license = lm.getLicense();
info->url = baseURL.getChildURL (file);
}
}
@ -294,6 +296,7 @@ bool ModuleList::Module::operator== (const Module& other) const
&& version == other.version
&& name == other.name
&& description == other.description
&& license == other.license
&& file == other.file
&& url == other.url;
}

View file

@ -43,6 +43,7 @@ public:
String getVersion() const { return moduleInfo ["version"].toString(); }
String getName() const { return moduleInfo ["name"].toString(); }
String getDescription() const { return moduleInfo ["description"].toString(); }
String getLicense() const { return moduleInfo ["license"].toString(); }
const File& getFolder() const { return moduleFolder; }
void writeIncludes (ProjectSaver&, OutputStream&);
@ -109,7 +110,7 @@ public:
{
LibraryModule* create() const;
String uid, version, name, description;
String uid, version, name, description, license;
File file;
URL url;

View file

@ -307,14 +307,17 @@ public:
if (const ModuleList::Module* module = moduleList.findModuleInfo (moduleID))
{
String text;
text << module->name << newLine << "Version: " << module->version << newLine << newLine
<< module->description;
AttributedString s;
s.setJustification (Justification::topLeft);
GlyphArrangement ga;
ga.addJustifiedText (Font (13.0f), text, 4.0f, 16.0f, getWidth() - 8.0f, Justification::topLeft);
g.setColour (Colours::black);
ga.draw (g);
Font f (13.0f);
s.append (module->name + "\n", f.boldened());
s.append ("Version: " + module->version
+ " License: " + module->license + "\n", f.italicised());
s.append ("\n" + module->description, f);
s.draw (g, getLocalBounds().reduced (4, 2).toFloat());
}
}
@ -355,10 +358,10 @@ public:
String text ("This module requires the following dependencies:\n");
text << missingDependencies.joinIntoString (", ");
GlyphArrangement ga;
ga.addJustifiedText (Font (13.0f), text, 4.0f, 16.0f, getWidth() - 8.0f, Justification::topLeft);
g.setColour (Colours::red);
ga.draw (g);
AttributedString s;
s.setJustification (Justification::topLeft);
s.append (text, Font (13.0f), Colours::red);
s.draw (g, getLocalBounds().reduced (4, 16).toFloat());
}
void buttonClicked (Button*)