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

Introjucer: minor appearance tweaks.

This commit is contained in:
jules 2012-09-07 12:10:25 +01:00
parent b0b6a7ca25
commit c75abb51c4
4 changed files with 22 additions and 11 deletions

View file

@ -206,7 +206,7 @@ void AppearanceSettings::applyToLookAndFeel (LookAndFeel& lf) const
}
lf.setColour (ScrollBar::thumbColourId,
getScrollbarColourForBackground (lf.findColour (mainBackgroundColourId)));
IntrojucerLookAndFeel::getScrollbarColourForBackground (lf.findColour (mainBackgroundColourId)));
}
void AppearanceSettings::applyToCodeEditor (CodeEditorComponent& editor) const
@ -233,7 +233,7 @@ void AppearanceSettings::applyToCodeEditor (CodeEditorComponent& editor) const
}
editor.setColour (ScrollBar::thumbColourId,
getScrollbarColourForBackground (editor.findColour (CodeEditorComponent::backgroundColourId)));
IntrojucerLookAndFeel::getScrollbarColourForBackground (editor.findColour (CodeEditorComponent::backgroundColourId)));
}
Font AppearanceSettings::getCodeFont() const
@ -278,11 +278,6 @@ bool AppearanceSettings::getColour (const String& name, Colour& result) const
return false;
}
Colour AppearanceSettings::getScrollbarColourForBackground (const Colour& background)
{
return background.contrasting().withAlpha (0.13f);
}
//==============================================================================
struct AppearanceEditor
{
@ -534,6 +529,14 @@ IntrojucerLookAndFeel::IntrojucerLookAndFeel()
setColour (mainBackgroundColourId, Colour::greyLevel (0.8f));
setColour (treeviewHighlightColourId, Colour (0x401111ee));
setColour (TextButton::buttonColourId, Colour (0xffeeeeff));
setColour (ScrollBar::thumbColourId,
getScrollbarColourForBackground (findColour (mainBackgroundColourId)));
}
Colour IntrojucerLookAndFeel::getScrollbarColourForBackground (const Colour& background)
{
return background.contrasting().withAlpha (0.13f);
}
Rectangle<int> IntrojucerLookAndFeel::getPropertyComponentContentPosition (PropertyComponent& component)

View file

@ -54,7 +54,6 @@ public:
void selectPresetScheme (int index);
static Font getDefaultCodeFont();
static Colour getScrollbarColourForBackground (const Colour& background);
static void showEditorWindow (ScopedPointer<Component>& ownerPointer);
@ -113,6 +112,8 @@ public:
void drawButtonBackground (Graphics& g, Button& button, const Colour& backgroundColour,
bool isMouseOverButton, bool isButtonDown);
static Colour getScrollbarColourForBackground (const Colour& background);
private:
Image backgroundTexture;
Colour backgroundTextureBaseColour;

View file

@ -146,7 +146,7 @@ void ProjectContentComponent::paintOverChildren (Graphics& g)
if (resizerBar != nullptr)
{
const int shadowSize = 15;
const int x = resizerBar->getRight();
const int x = resizerBar->getX();
ColourGradient cg (Colours::black.withAlpha (0.25f), (float) x, 0,
Colours::transparentBlack, (float) (x - shadowSize), 0, false);
@ -166,7 +166,7 @@ void ProjectContentComponent::resized()
treeViewTabs.setBounds (r.removeFromLeft (treeViewTabs.getWidth()));
if (resizerBar != nullptr)
resizerBar->setBounds (r.removeFromLeft (4));
resizerBar->setBounds (r.withWidth (4));
if (contentView != nullptr)
contentView->setBounds (r);
@ -205,7 +205,7 @@ void ProjectContentComponent::setProject (Project* newProject)
settings.setValue ("lastTab", treeViewTabs.getCurrentTabName());
}
treeViewTabs.clearTabs();
deleteProjectTabs();
project = newProject;
if (project != nullptr)
@ -232,6 +232,7 @@ void ProjectContentComponent::setProject (Project* newProject)
addAndMakeVisible (resizerBar = new ResizableEdgeComponent (&treeViewTabs, &treeSizeConstrainer,
ResizableEdgeComponent::rightEdge));
resizerBar->setAlwaysOnTop (true);
project->addChangeListener (this);
@ -255,6 +256,11 @@ void ProjectContentComponent::createProjectTabs()
treeViewTabs.addTab ("Config", tabColour, new ConfigTreeTab (*project), true);
}
void ProjectContentComponent::deleteProjectTabs()
{
treeViewTabs.clearTabs();
}
TreeView* ProjectContentComponent::getFilesTreeView() const
{
FileTreeTab* ft = dynamic_cast<FileTreeTab*> (treeViewTabs.getTabContentComponent (0));

View file

@ -78,6 +78,7 @@ public:
void updateMissingFileStatuses();
virtual void createProjectTabs();
void deleteProjectTabs();
void showBubbleMessage (const Rectangle<int>& pos, const String& text);