mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Minor introjucer fixes.
This commit is contained in:
parent
2a4aa982d0
commit
9f37bf2e58
5 changed files with 35 additions and 44 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 <PaintElement*>& results, c
|
|||
{
|
||||
for (int i = 0; i < getNumChildComponents(); ++i)
|
||||
if (PaintElement* const e = dynamic_cast <PaintElement*> (getChildComponent (i)))
|
||||
if (e->getBounds().expanded (-e->borderThickness, -e->borderThickness).intersects (lasso))
|
||||
if (e->getBounds().expanded (-e->borderThickness).intersects (lasso))
|
||||
results.add (e);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<int> 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;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue