diff --git a/extras/Introjucer/Source/Application/jucer_Application.h b/extras/Introjucer/Source/Application/jucer_Application.h index 530f474662..ff6fb2df2c 100644 --- a/extras/Introjucer/Source/Application/jucer_Application.h +++ b/extras/Introjucer/Source/Application/jucer_Application.h @@ -520,8 +520,24 @@ public: virtual void doExtraInitialisation() {} virtual void addExtraConfigItems (Project&, TreeViewItem&) {} + virtual String getLogFolderName() const { return "com.juce.introjucer"; } + virtual PropertiesFile::Options getPropertyFileOptionsFor (const String& filename) + { + PropertiesFile::Options options; + options.applicationName = filename; + options.filenameSuffix = "settings"; + options.osxLibrarySubFolder = "Application Support"; + #if JUCE_LINUX + options.folderName = ".introjucer"; + #else + options.folderName = "Introjucer"; + #endif + + return options; + } + virtual Component* createProjectContentComponent() const { return new ProjectContentComponent(); diff --git a/extras/Introjucer/Source/ComponentEditor/ui/jucer_EditingPanelBase.cpp b/extras/Introjucer/Source/ComponentEditor/ui/jucer_EditingPanelBase.cpp index a83e7a6551..178fc4faed 100644 --- a/extras/Introjucer/Source/ComponentEditor/ui/jucer_EditingPanelBase.cpp +++ b/extras/Introjucer/Source/ComponentEditor/ui/jucer_EditingPanelBase.cpp @@ -49,8 +49,7 @@ public: void setScaleFactor (double newScale) { scaleFactor = newScale; - content->setTransform (AffineTransform::scale ((float) scaleFactor, - (float) scaleFactor)); + content->setTransform (AffineTransform::scale ((float) scaleFactor)); } private: @@ -70,14 +69,14 @@ public: void mouseWheelMove (const MouseEvent& e, const MouseWheelDetails& wheel) { if (e.mods.isCtrlDown() || e.mods.isAltDown() || e.mods.isCommandDown()) - { - const double factor = 1.0f / (1.0f - wheel.deltaY); - panel->setZoom (panel->getZoom() * factor, e.x, e.y); - } + mouseMagnify (e, 1.0f / (1.0f - wheel.deltaY)); else - { Viewport::mouseWheelMove (e, wheel); - } + } + + void mouseMagnify (const MouseEvent& e, float factor) + { + panel->setZoom (panel->getZoom() * factor, e.x, e.y); } void dragKeyHeldDown (const bool isKeyDown) diff --git a/extras/Introjucer/Source/ComponentEditor/ui/jucer_PaintRoutineEditor.cpp b/extras/Introjucer/Source/ComponentEditor/ui/jucer_PaintRoutineEditor.cpp index 69541a4c12..ae91c0a0b3 100644 --- a/extras/Introjucer/Source/ComponentEditor/ui/jucer_PaintRoutineEditor.cpp +++ b/extras/Introjucer/Source/ComponentEditor/ui/jucer_PaintRoutineEditor.cpp @@ -181,7 +181,6 @@ void PaintRoutineEditor::refreshAllElements() if (currentBackgroundColour != graphics.getBackgroundColour()) { currentBackgroundColour = graphics.getBackgroundColour(); - grid.updateColour(); repaint(); } @@ -241,7 +240,7 @@ void PaintRoutineEditor::findLassoItemsInArea (Array & results, c { for (int i = 0; i < getNumChildComponents(); ++i) if (PaintElement* const e = dynamic_cast (getChildComponent (i))) - if (e->getBounds().expanded (-e->borderThickness, -e->borderThickness).intersects (lasso)) + if (e->getBounds().expanded (-e->borderThickness).intersects (lasso)) results.add (e); } diff --git a/extras/Introjucer/Source/ComponentEditor/ui/jucer_SnapGridPainter.h b/extras/Introjucer/Source/ComponentEditor/ui/jucer_SnapGridPainter.h index 67cc18fe4c..875ec106ca 100644 --- a/extras/Introjucer/Source/ComponentEditor/ui/jucer_SnapGridPainter.h +++ b/extras/Introjucer/Source/ComponentEditor/ui/jucer_SnapGridPainter.h @@ -46,50 +46,36 @@ public: { snapGridSize = design.getSnappingGridSize(); snapShown = design.isSnapShown() && design.isSnapActive (false); - - backgroundFill = Image(); return true; } return false; } - void updateColour() - { - backgroundFill = Image(); - } - void draw (Graphics& g, PaintRoutine* backgroundGraphics) { - if (backgroundFill.isNull() && snapShown) + if (snapShown && snapGridSize > 2) { - backgroundFill = Image (Image::ARGB, snapGridSize, snapGridSize, true); - - Graphics g2 (backgroundFill); - Colour col (Colours::black); if (backgroundGraphics != nullptr) col = backgroundGraphics->getBackgroundColour().contrasting(); - if (snapGridSize > 2) - { - g2.setColour (col.withAlpha (0.1f)); - g2.drawRect (0, 0, snapGridSize + 1, snapGridSize + 1); - } - } + g.setColour (col.withAlpha (0.1f)); - if (backgroundFill.isValid()) - { - g.setTiledImageFill (backgroundFill, 0, 0, 1.0f); - g.fillAll(); + const Rectangle clip (g.getClipBounds()); + + for (int y = clip.getY() - (clip.getY() % snapGridSize); y < clip.getBottom(); y += snapGridSize) + g.drawHorizontalLine (y, 0.0f, (float) clip.getRight()); + + for (int x = clip.getX() - (clip.getX() % snapGridSize); x < clip.getRight(); x += snapGridSize) + g.drawVerticalLine (x, 0.0f, (float) clip.getBottom()); } } private: int snapGridSize; bool snapShown; - Image backgroundFill; }; diff --git a/extras/Introjucer/Source/Utility/jucer_StoredSettings.cpp b/extras/Introjucer/Source/Utility/jucer_StoredSettings.cpp index d378589d27..63d4ecb69a 100644 --- a/extras/Introjucer/Source/Utility/jucer_StoredSettings.cpp +++ b/extras/Introjucer/Source/Utility/jucer_StoredSettings.cpp @@ -57,17 +57,8 @@ PropertiesFile& StoredSettings::getGlobalProperties() static PropertiesFile* createPropsFile (const String& filename) { - PropertiesFile::Options options; - options.applicationName = filename; - options.filenameSuffix = "settings"; - options.osxLibrarySubFolder = "Application Support"; - #if JUCE_LINUX - options.folderName = ".introjucer"; - #else - options.folderName = "Introjucer"; - #endif - - return new PropertiesFile (options); + return new PropertiesFile (IntrojucerApp::getApp() + .getPropertyFileOptionsFor (filename)); } PropertiesFile& StoredSettings::getProjectProperties (const String& projectUID)