mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Introjucer: added a version and build date to the window background logo area.
This commit is contained in:
parent
e580172733
commit
3e662da32b
1 changed files with 24 additions and 10 deletions
|
|
@ -144,20 +144,34 @@ private:
|
|||
};
|
||||
|
||||
//==============================================================================
|
||||
class LogoComponent : public Component
|
||||
struct LogoComponent : public Component
|
||||
{
|
||||
public:
|
||||
LogoComponent() {}
|
||||
|
||||
void paint (Graphics& g)
|
||||
{
|
||||
const Path& logo = getIcons().mainJuceLogo;
|
||||
const AffineTransform trans (RectanglePlacement (RectanglePlacement::centred)
|
||||
.getTransformToFit (logo.getBounds(),
|
||||
getLocalBounds().toFloat()));
|
||||
|
||||
g.setColour (findColour (mainBackgroundColourId).contrasting (0.3f));
|
||||
g.fillPath (logo, trans);
|
||||
|
||||
Rectangle<int> r (getLocalBounds());
|
||||
|
||||
g.setFont (15.0f);
|
||||
g.drawFittedText (getVersionInfo(), r.removeFromBottom (30), Justification::centred, 2);
|
||||
|
||||
const Path& logo = getIcons().mainJuceLogo;
|
||||
g.fillPath (logo, RectanglePlacement (RectanglePlacement::centred)
|
||||
.getTransformToFit (logo.getBounds(), r.toFloat()));
|
||||
}
|
||||
|
||||
static String getVersionInfo()
|
||||
{
|
||||
const Time buildDate (Time::getCompilationDate());
|
||||
|
||||
String s;
|
||||
|
||||
s << SystemStats::getJUCEVersion() << newLine
|
||||
<< "Introjucer built: " << buildDate.getDayOfMonth()
|
||||
<< " " << Time::getMonthName (buildDate.getMonth(), true)
|
||||
<< " " << buildDate.getYear();
|
||||
|
||||
return s;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue