diff --git a/extras/Introjucer/JuceLibraryCode/BinaryData.cpp b/extras/Introjucer/JuceLibraryCode/BinaryData.cpp index 50aa63df6d..25026b2502 100644 --- a/extras/Introjucer/JuceLibraryCode/BinaryData.cpp +++ b/extras/Introjucer/JuceLibraryCode/BinaryData.cpp @@ -1,7 +1,6 @@ /* ==================================== JUCER_BINARY_RESOURCE ==================================== - This is an auto-generated file, created by The Introjucer 3.0.0 - Do not edit anything in this file! + This is an auto-generated file: Any edits you make may be overwritten! */ diff --git a/extras/Introjucer/JuceLibraryCode/BinaryData.h b/extras/Introjucer/JuceLibraryCode/BinaryData.h index c90cce4c63..83f09d1876 100644 --- a/extras/Introjucer/JuceLibraryCode/BinaryData.h +++ b/extras/Introjucer/JuceLibraryCode/BinaryData.h @@ -1,7 +1,6 @@ /* ========================================================================================= - This is an auto-generated file, created by The Introjucer 3.0.0 - Do not edit anything in this file! + This is an auto-generated file: Any edits you make may be overwritten! */ diff --git a/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp b/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp index d1a3ce0ae5..db125f7ec4 100644 --- a/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp +++ b/extras/Introjucer/Source/Application/jucer_AppearanceSettings.cpp @@ -88,16 +88,13 @@ void AppearanceSettings::writeDefaultSchemeFile (const String& xmlString, const { const File file (getSchemesFolder().getChildFile (name).withFileExtension (getSchemeFileSuffix())); - if (! file.exists()) - { - AppearanceSettings settings (false); + AppearanceSettings settings (false); - ScopedPointer xml (XmlDocument::parse (xmlString)); - if (xml != nullptr) - settings.readFromXML (*xml); + ScopedPointer xml (XmlDocument::parse (xmlString)); + if (xml != nullptr) + settings.readFromXML (*xml); - settings.writeToFile (file); - } + settings.writeToFile (file); } void AppearanceSettings::refreshPresetSchemeList() @@ -562,7 +559,7 @@ void IntrojucerLookAndFeel::createTabTextLayout (const TabBarButton& button, con Colour IntrojucerLookAndFeel::getTabBackgroundColour (TabBarButton& button) { - const Colour normalBkg (button.getTabBackgroundColour()); + const Colour normalBkg (button.findColour (mainBackgroundColourId)); Colour bkg (normalBkg.contrasting (0.15f)); if (button.isFrontTab()) bkg = bkg.overlaidWith (Colours::yellow.withAlpha (0.5f)); @@ -580,7 +577,7 @@ void IntrojucerLookAndFeel::drawTabButton (TabBarButton& button, Graphics& g, bo bkg.darker (0.1f), 0, (float) activeArea.getBottom(), false)); g.fillRect (activeArea); - g.setColour (button.getTabBackgroundColour().darker (0.3f)); + g.setColour (button.findColour (mainBackgroundColourId).darker (0.3f)); g.drawRect (activeArea); GlyphArrangement textLayout; @@ -639,3 +636,32 @@ void IntrojucerLookAndFeel::drawScrollbar (Graphics& g, ScrollBar& scrollbar, in g.setColour (thumbCol.contrasting ((isMouseOver || isMouseDown) ? 0.2f : 0.1f)); g.strokePath (thumbPath, PathStrokeType (1.0f)); } + +void IntrojucerLookAndFeel::fillWithBackgroundTexture (Graphics& g) +{ + const Colour bkg (findColour (mainBackgroundColourId)); + + if (backgroundTextureBaseColour != bkg) + { + backgroundTextureBaseColour = bkg; + + const Image original (ImageCache::getFromMemory (BinaryData::brushed_aluminium_png, + BinaryData::brushed_aluminium_pngSize)); + const int w = original.getWidth(); + const int h = original.getHeight(); + + backgroundTexture = Image (Image::RGB, w, h, false); + + for (int y = 0; y < h; ++y) + { + for (int x = 0; x < w; ++x) + { + const float b = original.getPixelAt (x, y).getBrightness(); + backgroundTexture.setPixelAt (x, y, bkg.withMultipliedBrightness (b + 0.4f)); + } + } + } + + g.setTiledImageFill (backgroundTexture, 0, 0, 1.0f); + g.fillAll(); +} diff --git a/extras/Introjucer/Source/Application/jucer_AppearanceSettings.h b/extras/Introjucer/Source/Application/jucer_AppearanceSettings.h index d9d5e2417a..e771713596 100644 --- a/extras/Introjucer/Source/Application/jucer_AppearanceSettings.h +++ b/extras/Introjucer/Source/Application/jucer_AppearanceSettings.h @@ -85,10 +85,11 @@ class IntrojucerLookAndFeel : public LookAndFeel public: IntrojucerLookAndFeel(); + void fillWithBackgroundTexture (Graphics&); + int getTabButtonOverlap (int tabDepth); int getTabButtonSpaceAroundImage(); int getTabButtonBestWidth (TabBarButton& button, int tabDepth); - static Colour getTabBackgroundColour (TabBarButton& button); void createTabTextLayout (const TabBarButton& button, const Rectangle& textArea, GlyphArrangement& textLayout); void drawTabButton (TabBarButton& button, Graphics& g, bool isMouseOver, bool isMouseDown); @@ -103,6 +104,10 @@ public: void drawScrollbar (Graphics& g, ScrollBar& scrollbar, int x, int y, int width, int height, bool isScrollbarVertical, int thumbStartPosition, int thumbSize, bool /*isMouseOver*/, bool /*isMouseDown*/); + +private: + Image backgroundTexture; + Colour backgroundTextureBaseColour; }; diff --git a/extras/Introjucer/Source/Application/jucer_FilePreviewComponent.h b/extras/Introjucer/Source/Application/jucer_FilePreviewComponent.h index df91016674..a0f780d136 100644 --- a/extras/Introjucer/Source/Application/jucer_FilePreviewComponent.h +++ b/extras/Introjucer/Source/Application/jucer_FilePreviewComponent.h @@ -42,7 +42,7 @@ public: void paint (Graphics& g) { - drawTexturedBackground (g); + dynamic_cast (getLookAndFeel()).fillWithBackgroundTexture (g); Rectangle area = RectanglePlacement (RectanglePlacement::centred | RectanglePlacement::onlyReduceInSize) .appliedTo (image.getBounds(), Rectangle (4, 22, getWidth() - 8, getHeight() - 26)); diff --git a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h index f81e663823..84a3f349fc 100644 --- a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h +++ b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_XCode.h @@ -186,6 +186,22 @@ protected: XcodeBuildConfiguration (Project& project, const ValueTree& settings, const bool iOS_) : BuildConfiguration (project, settings), iOS (iOS_) { + if (iOS) + { + if (getiOSCompatibilityVersion().isEmpty()) + getiOSCompatibilityVersionValue() = osxVersionDefault; + } + else + { + if (getMacSDKVersion().isEmpty()) + getMacSDKVersionValue() = osxVersionDefault; + + if (getMacCompatibilityVersion().isEmpty()) + getMacCompatibilityVersionValue() = osxVersionDefault; + + if (getMacArchitecture().isEmpty()) + getMacArchitectureValue() = osxArch_Default; + } } Value getMacSDKVersionValue() { return getValue (Ids::osxSDK); } @@ -207,9 +223,6 @@ protected: if (iOS) { - if (getiOSCompatibilityVersion().isEmpty()) - getiOSCompatibilityVersionValue() = osxVersionDefault; - const char* iosVersions[] = { "Use Default", "3.2", "4.0", "4.1", "4.2", "4.3", "5.0", "5.1", 0 }; const char* iosVersionValues[] = { osxVersionDefault, "3.2", "4.0", "4.1", "4.2", "4.3", "5.0", "5.1", 0 }; @@ -219,12 +232,6 @@ protected: } else { - if (getMacSDKVersion().isEmpty()) - getMacSDKVersionValue() = osxVersionDefault; - - if (getMacCompatibilityVersion().isEmpty()) - getMacCompatibilityVersionValue() = osxVersionDefault; - const char* osxVersions[] = { "Use Default", osxVersion10_5, osxVersion10_6, osxVersion10_7, 0 }; const char* osxVersionValues[] = { osxVersionDefault, osxVersion10_5, osxVersion10_6, osxVersion10_7, 0 }; @@ -236,9 +243,6 @@ protected: StringArray (osxVersions), Array (osxVersionValues)), "The minimum version of OSX that the target binary will be compatible with."); - if (getMacArchitecture().isEmpty()) - getMacArchitectureValue() = osxArch_Default; - const char* osxArch[] = { "Use Default", "Native architecture of build machine", "Universal Binary (32-bit)", "Universal Binary (64-bit)", "64-bit Intel", 0 }; const char* osxArchValues[] = { osxArch_Default, osxArch_Native, osxArch_32BitUniversal, diff --git a/extras/Introjucer/Source/Project/jucer_ConfigPage.h b/extras/Introjucer/Source/Project/jucer_ConfigPage.h index 1ba614b663..bf6bb07954 100644 --- a/extras/Introjucer/Source/Project/jucer_ConfigPage.h +++ b/extras/Introjucer/Source/Project/jucer_ConfigPage.h @@ -95,7 +95,7 @@ public: void paint (Graphics& g) { - drawTexturedBackground (g); + dynamic_cast (getLookAndFeel()).fillWithBackgroundTexture (g); } void resized() diff --git a/extras/Introjucer/Source/Project/jucer_GroupInformationComponent.h b/extras/Introjucer/Source/Project/jucer_GroupInformationComponent.h index f6c518c206..24ba231ccd 100644 --- a/extras/Introjucer/Source/Project/jucer_GroupInformationComponent.h +++ b/extras/Introjucer/Source/Project/jucer_GroupInformationComponent.h @@ -57,7 +57,7 @@ public: //============================================================================== void paint (Graphics& g) { - drawTexturedBackground (g); + dynamic_cast (getLookAndFeel()).fillWithBackgroundTexture (g); } void resized() diff --git a/extras/Introjucer/Source/Project/jucer_Project.cpp b/extras/Introjucer/Source/Project/jucer_Project.cpp index 4e6927e81f..c80c5c8770 100644 --- a/extras/Introjucer/Source/Project/jucer_Project.cpp +++ b/extras/Introjucer/Source/Project/jucer_Project.cpp @@ -88,8 +88,8 @@ String Project::getDocumentTitle() void Project::updateProjectSettings() { - projectRoot.setProperty (Ids::jucerVersion, ProjectInfo::versionString, 0); - projectRoot.setProperty (Ids::name, getDocumentTitle(), 0); + projectRoot.setProperty (Ids::jucerVersion, ProjectInfo::versionString, nullptr); + projectRoot.setProperty (Ids::name, getDocumentTitle(), nullptr); } void Project::setMissingDefaultValues() @@ -608,7 +608,7 @@ void Project::Item::initialiseMissingProperties() if (isFile()) { - state.setProperty (Ids::name, getFile().getFileName(), 0); + state.setProperty (Ids::name, getFile().getFileName(), nullptr); } else if (isGroup()) { diff --git a/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp b/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp index 1f93412152..91180fad2a 100644 --- a/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp +++ b/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.cpp @@ -138,7 +138,7 @@ ProjectContentComponent::~ProjectContentComponent() void ProjectContentComponent::paint (Graphics& g) { - g.fillAll (findColour (mainBackgroundColourId)); + dynamic_cast (getLookAndFeel()).fillWithBackgroundTexture (g); } void ProjectContentComponent::paintOverChildren (Graphics& g) @@ -176,11 +176,6 @@ void ProjectContentComponent::resized() void ProjectContentComponent::lookAndFeelChanged() { - const Colour tabColour (findColour (mainBackgroundColourId)); - - for (int i = treeViewTabs.getNumTabs(); --i >= 0;) - treeViewTabs.setTabBackgroundColour (i, tabColour); - repaint(); } @@ -252,7 +247,7 @@ void ProjectContentComponent::setProject (Project* newProject) void ProjectContentComponent::createProjectTabs() { jassert (project != nullptr); - const Colour tabColour (findColour (mainBackgroundColourId)); + const Colour tabColour (Colours::transparentBlack); treeViewTabs.addTab ("Files", tabColour, new FileTreeTab (*project), true); treeViewTabs.addTab ("Config", tabColour, new ConfigTreeTab (*project), true); diff --git a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp index 775fa4a9b8..ec7a412891 100644 --- a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp +++ b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.cpp @@ -184,55 +184,6 @@ void autoScrollForMouseEvent (const MouseEvent& e, bool scrollX, bool scrollY) } } -void drawComponentPlaceholder (Graphics& g, int w, int h, const String& text) -{ - g.fillAll (Colours::white.withAlpha (0.4f)); - g.setColour (Colours::grey); - g.drawRect (0, 0, w, h); - - g.drawLine (0.5f, 0.5f, w - 0.5f, h - 0.5f); - g.drawLine (0.5f, h - 0.5f, w - 0.5f, 0.5f); - - g.setColour (Colours::black); - g.setFont (11.0f); - g.drawFittedText (text, 2, 2, w - 4, h - 4, Justification::centredTop, 2); -} - -static Image createTexturisedBackgroundTile() -{ - const Colour bkg (LookAndFeel::getDefaultLookAndFeel().findColour (mainBackgroundColourId)); - const int64 hash = bkg.getARGB() + 0x3474572a; - - Image tile (ImageCache::getFromHashCode (hash)); - - if (tile.isNull()) - { - const Image original (ImageCache::getFromMemory (BinaryData::brushed_aluminium_png, - BinaryData::brushed_aluminium_pngSize)); - - tile = Image (Image::RGB, original.getWidth(), original.getHeight(), false); - - for (int y = 0; y < tile.getHeight(); ++y) - { - for (int x = 0; x < tile.getWidth(); ++x) - { - const float b = original.getPixelAt (x, y).getBrightness(); - tile.setPixelAt (x, y, bkg.withMultipliedBrightness (b + 0.4f)); - } - } - - ImageCache::addImageToCache (tile, hash); - } - - return tile; -} - -void drawTexturedBackground (Graphics& g) -{ - g.setTiledImageFill (createTexturisedBackgroundTile(), 0, 0, 1.0f); - g.fillAll(); -} - //============================================================================== int indexOfLineStartingWith (const StringArray& lines, const String& text, int startIndex) { diff --git a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h index 98877522e5..17d69e8913 100644 --- a/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h +++ b/extras/Introjucer/Source/Utility/jucer_MiscUtilities.h @@ -46,9 +46,6 @@ int indexOfLineStartingWith (const StringArray& lines, const String& text, int s void autoScrollForMouseEvent (const MouseEvent& e, bool scrollX = true, bool scrollY = true); -void drawComponentPlaceholder (Graphics& g, int w, int h, const String& text); -void drawTexturedBackground (Graphics& g); - void showUTF8ToolWindow (ScopedPointer& ownerPointer); bool cancelAnyModalComponents(); diff --git a/extras/JuceDemo/JuceLibraryCode/BinaryData.cpp b/extras/JuceDemo/JuceLibraryCode/BinaryData.cpp index 7eacc57e92..e587b2b4b8 100644 --- a/extras/JuceDemo/JuceLibraryCode/BinaryData.cpp +++ b/extras/JuceDemo/JuceLibraryCode/BinaryData.cpp @@ -1,7 +1,6 @@ /* ==================================== JUCER_BINARY_RESOURCE ==================================== - This is an auto-generated file, created by The Introjucer 3.0.0 - Do not edit anything in this file! + This is an auto-generated file: Any edits you make may be overwritten! */ diff --git a/extras/JuceDemo/JuceLibraryCode/BinaryData.h b/extras/JuceDemo/JuceLibraryCode/BinaryData.h index 144c767467..0dd4b696f0 100644 --- a/extras/JuceDemo/JuceLibraryCode/BinaryData.h +++ b/extras/JuceDemo/JuceLibraryCode/BinaryData.h @@ -1,7 +1,6 @@ /* ========================================================================================= - This is an auto-generated file, created by The Introjucer 3.0.0 - Do not edit anything in this file! + This is an auto-generated file: Any edits you make may be overwritten! */ diff --git a/extras/the jucer/JuceLibraryCode/BinaryData.cpp b/extras/the jucer/JuceLibraryCode/BinaryData.cpp index 6c41440e81..ec6d2370ba 100644 --- a/extras/the jucer/JuceLibraryCode/BinaryData.cpp +++ b/extras/the jucer/JuceLibraryCode/BinaryData.cpp @@ -1,7 +1,6 @@ /* ==================================== JUCER_BINARY_RESOURCE ==================================== - This is an auto-generated file, created by The Introjucer 3.0.0 - Do not edit anything in this file! + This is an auto-generated file: Any edits you make may be overwritten! */ diff --git a/extras/the jucer/JuceLibraryCode/BinaryData.h b/extras/the jucer/JuceLibraryCode/BinaryData.h index e92a404d31..cbc22f7693 100644 --- a/extras/the jucer/JuceLibraryCode/BinaryData.h +++ b/extras/the jucer/JuceLibraryCode/BinaryData.h @@ -1,7 +1,6 @@ /* ========================================================================================= - This is an auto-generated file, created by The Introjucer 3.0.0 - Do not edit anything in this file! + This is an auto-generated file: Any edits you make may be overwritten! */