@@ -206,7 +206,7 @@ void AppearanceSettings::applyToLookAndFeel (LookAndFeel& lf) const | |||||
} | } | ||||
lf.setColour (ScrollBar::thumbColourId, | lf.setColour (ScrollBar::thumbColourId, | ||||
getScrollbarColourForBackground (lf.findColour (mainBackgroundColourId))); | |||||
IntrojucerLookAndFeel::getScrollbarColourForBackground (lf.findColour (mainBackgroundColourId))); | |||||
} | } | ||||
void AppearanceSettings::applyToCodeEditor (CodeEditorComponent& editor) const | void AppearanceSettings::applyToCodeEditor (CodeEditorComponent& editor) const | ||||
@@ -233,7 +233,7 @@ void AppearanceSettings::applyToCodeEditor (CodeEditorComponent& editor) const | |||||
} | } | ||||
editor.setColour (ScrollBar::thumbColourId, | editor.setColour (ScrollBar::thumbColourId, | ||||
getScrollbarColourForBackground (editor.findColour (CodeEditorComponent::backgroundColourId))); | |||||
IntrojucerLookAndFeel::getScrollbarColourForBackground (editor.findColour (CodeEditorComponent::backgroundColourId))); | |||||
} | } | ||||
Font AppearanceSettings::getCodeFont() const | Font AppearanceSettings::getCodeFont() const | ||||
@@ -278,11 +278,6 @@ bool AppearanceSettings::getColour (const String& name, Colour& result) const | |||||
return false; | return false; | ||||
} | } | ||||
Colour AppearanceSettings::getScrollbarColourForBackground (const Colour& background) | |||||
{ | |||||
return background.contrasting().withAlpha (0.13f); | |||||
} | |||||
//============================================================================== | //============================================================================== | ||||
struct AppearanceEditor | struct AppearanceEditor | ||||
{ | { | ||||
@@ -534,6 +529,14 @@ IntrojucerLookAndFeel::IntrojucerLookAndFeel() | |||||
setColour (mainBackgroundColourId, Colour::greyLevel (0.8f)); | setColour (mainBackgroundColourId, Colour::greyLevel (0.8f)); | ||||
setColour (treeviewHighlightColourId, Colour (0x401111ee)); | setColour (treeviewHighlightColourId, Colour (0x401111ee)); | ||||
setColour (TextButton::buttonColourId, Colour (0xffeeeeff)); | 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) | Rectangle<int> IntrojucerLookAndFeel::getPropertyComponentContentPosition (PropertyComponent& component) | ||||
@@ -54,7 +54,6 @@ public: | |||||
void selectPresetScheme (int index); | void selectPresetScheme (int index); | ||||
static Font getDefaultCodeFont(); | static Font getDefaultCodeFont(); | ||||
static Colour getScrollbarColourForBackground (const Colour& background); | |||||
static void showEditorWindow (ScopedPointer<Component>& ownerPointer); | static void showEditorWindow (ScopedPointer<Component>& ownerPointer); | ||||
@@ -113,6 +112,8 @@ public: | |||||
void drawButtonBackground (Graphics& g, Button& button, const Colour& backgroundColour, | void drawButtonBackground (Graphics& g, Button& button, const Colour& backgroundColour, | ||||
bool isMouseOverButton, bool isButtonDown); | bool isMouseOverButton, bool isButtonDown); | ||||
static Colour getScrollbarColourForBackground (const Colour& background); | |||||
private: | private: | ||||
Image backgroundTexture; | Image backgroundTexture; | ||||
Colour backgroundTextureBaseColour; | Colour backgroundTextureBaseColour; | ||||
@@ -146,7 +146,7 @@ void ProjectContentComponent::paintOverChildren (Graphics& g) | |||||
if (resizerBar != nullptr) | if (resizerBar != nullptr) | ||||
{ | { | ||||
const int shadowSize = 15; | const int shadowSize = 15; | ||||
const int x = resizerBar->getRight(); | |||||
const int x = resizerBar->getX(); | |||||
ColourGradient cg (Colours::black.withAlpha (0.25f), (float) x, 0, | ColourGradient cg (Colours::black.withAlpha (0.25f), (float) x, 0, | ||||
Colours::transparentBlack, (float) (x - shadowSize), 0, false); | Colours::transparentBlack, (float) (x - shadowSize), 0, false); | ||||
@@ -166,7 +166,7 @@ void ProjectContentComponent::resized() | |||||
treeViewTabs.setBounds (r.removeFromLeft (treeViewTabs.getWidth())); | treeViewTabs.setBounds (r.removeFromLeft (treeViewTabs.getWidth())); | ||||
if (resizerBar != nullptr) | if (resizerBar != nullptr) | ||||
resizerBar->setBounds (r.removeFromLeft (4)); | |||||
resizerBar->setBounds (r.withWidth (4)); | |||||
if (contentView != nullptr) | if (contentView != nullptr) | ||||
contentView->setBounds (r); | contentView->setBounds (r); | ||||
@@ -205,7 +205,7 @@ void ProjectContentComponent::setProject (Project* newProject) | |||||
settings.setValue ("lastTab", treeViewTabs.getCurrentTabName()); | settings.setValue ("lastTab", treeViewTabs.getCurrentTabName()); | ||||
} | } | ||||
treeViewTabs.clearTabs(); | |||||
deleteProjectTabs(); | |||||
project = newProject; | project = newProject; | ||||
if (project != nullptr) | if (project != nullptr) | ||||
@@ -232,6 +232,7 @@ void ProjectContentComponent::setProject (Project* newProject) | |||||
addAndMakeVisible (resizerBar = new ResizableEdgeComponent (&treeViewTabs, &treeSizeConstrainer, | addAndMakeVisible (resizerBar = new ResizableEdgeComponent (&treeViewTabs, &treeSizeConstrainer, | ||||
ResizableEdgeComponent::rightEdge)); | ResizableEdgeComponent::rightEdge)); | ||||
resizerBar->setAlwaysOnTop (true); | |||||
project->addChangeListener (this); | project->addChangeListener (this); | ||||
@@ -255,6 +256,11 @@ void ProjectContentComponent::createProjectTabs() | |||||
treeViewTabs.addTab ("Config", tabColour, new ConfigTreeTab (*project), true); | treeViewTabs.addTab ("Config", tabColour, new ConfigTreeTab (*project), true); | ||||
} | } | ||||
void ProjectContentComponent::deleteProjectTabs() | |||||
{ | |||||
treeViewTabs.clearTabs(); | |||||
} | |||||
TreeView* ProjectContentComponent::getFilesTreeView() const | TreeView* ProjectContentComponent::getFilesTreeView() const | ||||
{ | { | ||||
FileTreeTab* ft = dynamic_cast<FileTreeTab*> (treeViewTabs.getTabContentComponent (0)); | FileTreeTab* ft = dynamic_cast<FileTreeTab*> (treeViewTabs.getTabContentComponent (0)); | ||||
@@ -78,6 +78,7 @@ public: | |||||
void updateMissingFileStatuses(); | void updateMissingFileStatuses(); | ||||
virtual void createProjectTabs(); | virtual void createProjectTabs(); | ||||
void deleteProjectTabs(); | |||||
void showBubbleMessage (const Rectangle<int>& pos, const String& text); | void showBubbleMessage (const Rectangle<int>& pos, const String& text); | ||||