Browse Source

Introjucer: minor appearance tweaks.

tags/2021-05-28
jules 12 years ago
parent
commit
c75abb51c4
4 changed files with 22 additions and 11 deletions
  1. +10
    -7
      extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp
  2. +2
    -1
      extras/Introjucer/Source/Application/jucer_AppearanceSettings.h
  3. +9
    -3
      extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp
  4. +1
    -0
      extras/Introjucer/Source/Project/jucer_ProjectContentComponent.h

+ 10
- 7
extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp 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)


+ 2
- 1
extras/Introjucer/Source/Application/jucer_AppearanceSettings.h 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;


+ 9
- 3
extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp 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));


+ 1
- 0
extras/Introjucer/Source/Project/jucer_ProjectContentComponent.h View File

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


Loading…
Cancel
Save