mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Introjucer: items which are not included in the project are now crossed-out.
This commit is contained in:
parent
2ae82c4db4
commit
80dc4c57b0
14 changed files with 93 additions and 116 deletions
|
|
@ -35,22 +35,18 @@ void SettingsTreeViewItemBase::showSettingsPage (Component* content)
|
|||
content->setComponentID (getUniqueName());
|
||||
|
||||
ScopedPointer<Component> comp (content);
|
||||
ProjectContentComponent* pcc = getProjectContentComponent();
|
||||
|
||||
if (pcc != nullptr)
|
||||
if (ProjectContentComponent* pcc = getProjectContentComponent())
|
||||
pcc->setEditorComponent (new PropertyPanelViewport (comp.release()), nullptr);
|
||||
}
|
||||
|
||||
void SettingsTreeViewItemBase::closeSettingsPage()
|
||||
{
|
||||
ProjectContentComponent* pcc = getProjectContentComponent();
|
||||
|
||||
if (pcc != nullptr)
|
||||
if (ProjectContentComponent* pcc = getProjectContentComponent())
|
||||
{
|
||||
PropertyPanelViewport* ppv = dynamic_cast<PropertyPanelViewport*> (pcc->getEditorComponent());
|
||||
|
||||
if (ppv != nullptr && ppv->viewport.getViewedComponent()->getComponentID() == getUniqueName())
|
||||
pcc->hideEditor();
|
||||
if (PropertyPanelViewport* ppv = dynamic_cast<PropertyPanelViewport*> (pcc->getEditorComponent()))
|
||||
if (ppv->viewport.getViewedComponent()->getComponentID() == getUniqueName())
|
||||
pcc->hideEditor();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ class GroupInformationComponent : public Component,
|
|||
private ValueTree::Listener
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
GroupInformationComponent (const Project::Item& group)
|
||||
: item (group)
|
||||
{
|
||||
|
|
@ -76,7 +75,6 @@ public:
|
|||
g.fillRect (0, 0, width, height - 1);
|
||||
}
|
||||
|
||||
|
||||
Component* refreshComponentForRow (int rowNumber, bool isRowSelected, Component* existingComponentToUpdate)
|
||||
{
|
||||
if (rowNumber < getNumRows())
|
||||
|
|
@ -99,16 +97,22 @@ public:
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
void valueTreePropertyChanged (ValueTree&, const Identifier&) { list.updateContent(); }
|
||||
void valueTreeChildAdded (ValueTree&, ValueTree&) { list.updateContent(); }
|
||||
void valueTreeChildRemoved (ValueTree&, ValueTree&) { list.updateContent(); }
|
||||
void valueTreeChildOrderChanged (ValueTree&) { list.updateContent(); }
|
||||
void valueTreeParentChanged (ValueTree&) { list.updateContent(); }
|
||||
void valueTreePropertyChanged (ValueTree&, const Identifier&) { itemChanged(); }
|
||||
void valueTreeChildAdded (ValueTree&, ValueTree&) { itemChanged(); }
|
||||
void valueTreeChildRemoved (ValueTree&, ValueTree&) { itemChanged(); }
|
||||
void valueTreeChildOrderChanged (ValueTree&) { itemChanged(); }
|
||||
void valueTreeParentChanged (ValueTree&) { itemChanged(); }
|
||||
|
||||
private:
|
||||
Project::Item item;
|
||||
ListBox list;
|
||||
|
||||
void itemChanged()
|
||||
{
|
||||
list.updateContent();
|
||||
repaint();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class FileOptionComponent : public Component
|
||||
{
|
||||
|
|
@ -133,7 +137,8 @@ private:
|
|||
int x = getHeight() + 6;
|
||||
|
||||
item.getIcon().withContrastingColourTo (Colours::grey)
|
||||
.draw (g, Rectangle<float> (2.0f, 2.0f, x - 4.0f, getHeight() - 4.0f));
|
||||
.draw (g, Rectangle<float> (3.0f, 2.0f, x - 6.0f, getHeight() - 4.0f),
|
||||
item.isIconCrossedOut());
|
||||
|
||||
g.setColour (Colours::black);
|
||||
g.setFont (getHeight() * 0.6f);
|
||||
|
|
|
|||
|
|
@ -271,9 +271,10 @@ bool ModuleList::Module::operator!= (const Module& other) const
|
|||
|
||||
LibraryModule* ModuleList::loadModule (const String& uid) const
|
||||
{
|
||||
const Module* const m = findModuleInfo (uid);
|
||||
if (const Module* const m = findModuleInfo (uid))
|
||||
return m->create();
|
||||
|
||||
return m != nullptr ? m->create() : nullptr;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const ModuleList::Module* ModuleList::findModuleInfo (const String& uid) const
|
||||
|
|
|
|||
|
|
@ -249,9 +249,7 @@ void NewFileWizard::addWizardsToMenu (PopupMenu& m) const
|
|||
|
||||
bool NewFileWizard::runWizardFromMenu (int chosenMenuItemID, const Project::Item& projectGroupToAddTo) const
|
||||
{
|
||||
Type* wiz = wizards [chosenMenuItemID - menuBaseID];
|
||||
|
||||
if (wiz != nullptr)
|
||||
if (Type* wiz = wizards [chosenMenuItemID - menuBaseID])
|
||||
{
|
||||
wiz->createNewFile (projectGroupToAddTo);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -331,16 +331,12 @@ String Project::getRelativePathForFile (const File& file) const
|
|||
//==============================================================================
|
||||
const ProjectType& Project::getProjectType() const
|
||||
{
|
||||
const ProjectType* type = ProjectType::findType (getProjectTypeString());
|
||||
jassert (type != nullptr);
|
||||
if (const ProjectType* type = ProjectType::findType (getProjectTypeString()))
|
||||
return *type;
|
||||
|
||||
if (type == nullptr)
|
||||
{
|
||||
type = ProjectType::findType (ProjectType::getGUIAppTypeName());
|
||||
jassert (type != nullptr);
|
||||
}
|
||||
|
||||
return *type;
|
||||
const ProjectType* guiType = ProjectType::findType (ProjectType::getGUIAppTypeName());
|
||||
jassert (guiType != nullptr);
|
||||
return *guiType;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -795,14 +791,21 @@ Icon Project::Item::getIcon() const
|
|||
|
||||
return Icon (icons.document, Colours::yellow);
|
||||
}
|
||||
else if (isMainGroup())
|
||||
{
|
||||
|
||||
if (isMainGroup())
|
||||
return Icon (icons.juceLogo, Colours::orange);
|
||||
}
|
||||
|
||||
return Icon (icons.folder, Colours::darkgrey);
|
||||
}
|
||||
|
||||
bool Project::Item::isIconCrossedOut() const
|
||||
{
|
||||
return isFile()
|
||||
&& ! (shouldBeCompiled()
|
||||
|| shouldBeAddedToBinaryResources()
|
||||
|| getFile().hasFileExtension (headerFileExtensions));
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
ValueTree Project::getConfigNode()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -187,6 +187,7 @@ public:
|
|||
UndoManager* getUndoManager() const { return project.getUndoManagerFor (state); }
|
||||
|
||||
Icon getIcon() const;
|
||||
bool isIconCrossedOut() const;
|
||||
|
||||
Project& project;
|
||||
ValueTree state;
|
||||
|
|
|
|||
|
|
@ -270,25 +270,25 @@ void ProjectContentComponent::deleteProjectTabs()
|
|||
|
||||
TreeView* ProjectContentComponent::getFilesTreeView() const
|
||||
{
|
||||
FileTreeTab* ft = dynamic_cast<FileTreeTab*> (treeViewTabs.getTabContentComponent (0));
|
||||
return ft != nullptr ? &(ft->tree) : nullptr;
|
||||
if (FileTreeTab* ft = dynamic_cast<FileTreeTab*> (treeViewTabs.getTabContentComponent (0)))
|
||||
return &(ft->tree);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ProjectTreeViewBase* ProjectContentComponent::getFilesTreeRoot() const
|
||||
{
|
||||
TreeView* tv = getFilesTreeView();
|
||||
return tv != nullptr ? dynamic_cast <ProjectTreeViewBase*> (tv->getRootItem()) : nullptr;
|
||||
if (TreeView* tv = getFilesTreeView())
|
||||
return dynamic_cast <ProjectTreeViewBase*> (tv->getRootItem());
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ProjectContentComponent::saveTreeViewState()
|
||||
{
|
||||
for (int i = treeViewTabs.getNumTabs(); --i >= 0;)
|
||||
{
|
||||
TreePanelBase* t = dynamic_cast<TreePanelBase*> (treeViewTabs.getTabContentComponent (i));
|
||||
|
||||
if (t != nullptr)
|
||||
if (TreePanelBase* t = dynamic_cast<TreePanelBase*> (treeViewTabs.getTabContentComponent (i)))
|
||||
t->saveOpenness();
|
||||
}
|
||||
}
|
||||
|
||||
void ProjectContentComponent::saveOpenDocumentList()
|
||||
|
|
@ -328,9 +328,7 @@ void ProjectContentComponent::changeListenerCallback (ChangeBroadcaster*)
|
|||
|
||||
void ProjectContentComponent::updateMissingFileStatuses()
|
||||
{
|
||||
ProjectTreeViewBase* p = getFilesTreeRoot();
|
||||
|
||||
if (p != nullptr)
|
||||
if (ProjectTreeViewBase* p = getFilesTreeRoot())
|
||||
p->checkFileStatus();
|
||||
}
|
||||
|
||||
|
|
@ -386,9 +384,7 @@ void ProjectContentComponent::hideDocument (OpenDocumentManager::Document* doc)
|
|||
{
|
||||
if (doc == currentDocument)
|
||||
{
|
||||
OpenDocumentManager::Document* replacement = recentDocumentList.getClosestPreviousDocOtherThan (doc);
|
||||
|
||||
if (replacement != nullptr)
|
||||
if (OpenDocumentManager::Document* replacement = recentDocumentList.getClosestPreviousDocOtherThan (doc))
|
||||
showDocument (replacement, true);
|
||||
else
|
||||
hideEditor();
|
||||
|
|
@ -474,9 +470,7 @@ bool ProjectContentComponent::saveProject()
|
|||
|
||||
void ProjectContentComponent::closeProject()
|
||||
{
|
||||
MainWindow* const mw = findParentComponentOfClass<MainWindow>();
|
||||
|
||||
if (mw != nullptr)
|
||||
if (MainWindow* const mw = findParentComponentOfClass<MainWindow>())
|
||||
mw->closeCurrentProject();
|
||||
}
|
||||
|
||||
|
|
@ -492,17 +486,13 @@ void ProjectContentComponent::openInIDE()
|
|||
|
||||
void ProjectContentComponent::deleteSelectedTreeItems()
|
||||
{
|
||||
TreePanelBase* const tree = dynamic_cast<TreePanelBase*> (treeViewTabs.getCurrentContentComponent());
|
||||
|
||||
if (tree != nullptr)
|
||||
if (TreePanelBase* const tree = dynamic_cast<TreePanelBase*> (treeViewTabs.getCurrentContentComponent()))
|
||||
tree->deleteSelectedItems();
|
||||
}
|
||||
|
||||
void ProjectContentComponent::updateMainWindowTitle()
|
||||
{
|
||||
MainWindow* mw = findParentComponentOfClass<MainWindow>();
|
||||
|
||||
if (mw != nullptr)
|
||||
if (MainWindow* mw = findParentComponentOfClass<MainWindow>())
|
||||
mw->updateTitle (currentDocument != nullptr ? currentDocument->getName() : String::empty);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,9 +77,7 @@ void ProjectTreeViewBase::browseToAddExistingFiles()
|
|||
|
||||
void ProjectTreeViewBase::addFiles (const StringArray& files, int insertIndex)
|
||||
{
|
||||
ProjectTreeViewBase* p = dynamic_cast <ProjectTreeViewBase*> (getParentItem());
|
||||
|
||||
if (p != nullptr)
|
||||
if (ProjectTreeViewBase* p = dynamic_cast <ProjectTreeViewBase*> (getParentItem()))
|
||||
p->addFiles (files, insertIndex);
|
||||
}
|
||||
|
||||
|
|
@ -99,9 +97,7 @@ ProjectTreeViewBase* ProjectTreeViewBase::findTreeViewItem (const Project::Item&
|
|||
|
||||
for (int i = getNumSubItems(); --i >= 0;)
|
||||
{
|
||||
ProjectTreeViewBase* pg = dynamic_cast <ProjectTreeViewBase*> (getSubItem(i));
|
||||
|
||||
if (pg != nullptr)
|
||||
if (ProjectTreeViewBase* pg = dynamic_cast <ProjectTreeViewBase*> (getSubItem(i)))
|
||||
{
|
||||
pg = pg->findTreeViewItem (itemToFind);
|
||||
|
||||
|
|
@ -120,16 +116,14 @@ void ProjectTreeViewBase::triggerAsyncRename (const Project::Item& itemToRename)
|
|||
class RenameMessage : public CallbackMessage
|
||||
{
|
||||
public:
|
||||
RenameMessage (TreeView* const tree_, const Project::Item& itemToRename_)
|
||||
: tree (tree_), itemToRename (itemToRename_) {}
|
||||
RenameMessage (TreeView* const t, const Project::Item& item)
|
||||
: tree (t), itemToRename (item) {}
|
||||
|
||||
void messageCallback()
|
||||
{
|
||||
if (tree != nullptr)
|
||||
{
|
||||
ProjectTreeViewBase* pg = dynamic_cast <ProjectTreeViewBase*> (tree->getRootItem());
|
||||
|
||||
if (pg != nullptr)
|
||||
if (ProjectTreeViewBase* pg = dynamic_cast <ProjectTreeViewBase*> (tree->getRootItem()))
|
||||
{
|
||||
pg = pg->findTreeViewItem (itemToRename);
|
||||
|
||||
|
|
@ -179,9 +173,7 @@ void ProjectTreeViewBase::deleteAllSelectedItems()
|
|||
|
||||
for (int i = 0; i < numSelected; ++i)
|
||||
{
|
||||
const ProjectTreeViewBase* const p = dynamic_cast <ProjectTreeViewBase*> (tree->getSelectedItem (i));
|
||||
|
||||
if (p != nullptr)
|
||||
if (const ProjectTreeViewBase* const p = dynamic_cast <ProjectTreeViewBase*> (tree->getSelectedItem (i)))
|
||||
{
|
||||
itemsToRemove.add (new Project::Item (p->item));
|
||||
|
||||
|
|
@ -215,10 +207,7 @@ void ProjectTreeViewBase::deleteAllSelectedItems()
|
|||
filesToTrash.clear();
|
||||
}
|
||||
|
||||
ProjectTreeViewBase* treeRootItem = dynamic_cast <ProjectTreeViewBase*> (tree->getRootItem());
|
||||
jassert (treeRootItem != nullptr);
|
||||
|
||||
if (treeRootItem != nullptr)
|
||||
if (ProjectTreeViewBase* treeRootItem = dynamic_cast <ProjectTreeViewBase*> (tree->getRootItem()))
|
||||
{
|
||||
OpenDocumentManager& om = IntrojucerApp::getApp().openDocumentManager;
|
||||
|
||||
|
|
@ -236,15 +225,17 @@ void ProjectTreeViewBase::deleteAllSelectedItems()
|
|||
|
||||
for (int i = itemsToRemove.size(); --i >= 0;)
|
||||
{
|
||||
ProjectTreeViewBase* itemToRemove = treeRootItem->findTreeViewItem (*itemsToRemove.getUnchecked(i));
|
||||
|
||||
if (itemToRemove != nullptr)
|
||||
if (ProjectTreeViewBase* itemToRemove = treeRootItem->findTreeViewItem (*itemsToRemove.getUnchecked(i)))
|
||||
{
|
||||
om.closeFile (itemToRemove->getFile(), false);
|
||||
itemToRemove->deleteItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jassertfalse;
|
||||
}
|
||||
}
|
||||
|
||||
static int indexOfNode (const ValueTree& parent, const ValueTree& child)
|
||||
|
|
@ -322,12 +313,8 @@ void ProjectTreeViewBase::getAllSelectedNodesInTree (Component* componentInTree,
|
|||
const int numSelected = tree->getNumSelectedItems();
|
||||
|
||||
for (int i = 0; i < numSelected; ++i)
|
||||
{
|
||||
const ProjectTreeViewBase* const p = dynamic_cast <ProjectTreeViewBase*> (tree->getSelectedItem (i));
|
||||
|
||||
if (p != nullptr)
|
||||
if (const ProjectTreeViewBase* const p = dynamic_cast <ProjectTreeViewBase*> (tree->getSelectedItem (i)))
|
||||
selectedNodes.add (new Project::Item (p->item));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -416,12 +403,8 @@ void ProjectTreeViewBase::itemOpennessChanged (bool isNowOpen)
|
|||
void ProjectTreeViewBase::addSubItems()
|
||||
{
|
||||
for (int i = 0; i < item.getNumChildren(); ++i)
|
||||
{
|
||||
ProjectTreeViewBase* p = createSubItem (item.getChild(i));
|
||||
|
||||
if (p != nullptr)
|
||||
if (ProjectTreeViewBase* p = createSubItem (item.getChild(i)))
|
||||
addSubItem (p);
|
||||
}
|
||||
}
|
||||
|
||||
static void treeViewMultiSelectItemChosen (int resultCode, ProjectTreeViewBase* item)
|
||||
|
|
|
|||
|
|
@ -103,7 +103,8 @@ protected:
|
|||
void treeChildrenChanged (const ValueTree& parentTree);
|
||||
virtual ProjectTreeViewBase* createSubItem (const Project::Item& node) = 0;
|
||||
|
||||
Icon getIcon() const { return item.getIcon().withContrastingColourTo (getBackgroundColour()); }
|
||||
Icon getIcon() const { return item.getIcon().withContrastingColourTo (getBackgroundColour()); }
|
||||
bool isIconCrossedOut() const { return item.isIconCrossedOut(); }
|
||||
|
||||
//==============================================================================
|
||||
void triggerAsyncRename (const Project::Item& itemToRename);
|
||||
|
|
|
|||
|
|
@ -226,11 +226,11 @@ ProjectTreeViewBase* SourceFileTreeViewItem::createSubItem (const Project::Item&
|
|||
|
||||
void SourceFileTreeViewItem::showDocument()
|
||||
{
|
||||
ProjectContentComponent* pcc = getProjectContentComponent();
|
||||
const File f (getFile());
|
||||
|
||||
if (pcc != nullptr && f.exists())
|
||||
pcc->showEditorForFile (f, false);
|
||||
if (f.exists())
|
||||
if (ProjectContentComponent* pcc = getProjectContentComponent())
|
||||
pcc->showEditorForFile (f, false);
|
||||
}
|
||||
|
||||
void SourceFileTreeViewItem::showPopupMenu()
|
||||
|
|
|
|||
|
|
@ -43,12 +43,8 @@ void TreePanelBase::setRoot (JucerTreeViewBase* root)
|
|||
tree.restoreOpennessState (*treeOpenness, true);
|
||||
|
||||
for (int i = tree.getNumSelectedItems(); --i >= 0;)
|
||||
{
|
||||
JucerTreeViewBase* item = dynamic_cast<JucerTreeViewBase*> (tree.getSelectedItem (i));
|
||||
|
||||
if (item != nullptr)
|
||||
if (JucerTreeViewBase* item = dynamic_cast<JucerTreeViewBase*> (tree.getSelectedItem (i)))
|
||||
item->cancelDelayedSelectionTimer();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -229,18 +225,10 @@ void JucerTreeViewBase::handlePopupMenuResult (int)
|
|||
|
||||
ProjectContentComponent* JucerTreeViewBase::getProjectContentComponent() const
|
||||
{
|
||||
Component* c = getOwnerView();
|
||||
|
||||
while (c != nullptr)
|
||||
{
|
||||
ProjectContentComponent* pcc = dynamic_cast <ProjectContentComponent*> (c);
|
||||
|
||||
if (pcc != nullptr)
|
||||
for (Component* c = getOwnerView(); c != nullptr; c = c->getParentComponent())
|
||||
if (ProjectContentComponent* pcc = dynamic_cast <ProjectContentComponent*> (c))
|
||||
return pcc;
|
||||
|
||||
c = c->getParentComponent();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ public:
|
|||
virtual bool isMissing() = 0;
|
||||
virtual Icon getIcon() const = 0;
|
||||
virtual float getIconSize() const;
|
||||
virtual bool isIconCrossedOut() const { return false; }
|
||||
virtual void paintContent (Graphics& g, const Rectangle<int>& area);
|
||||
virtual int getMillisecsAllowedForDragGesture() { return 120; };
|
||||
virtual File getDraggableFile() const { return File::nonexistent; }
|
||||
|
|
@ -84,8 +85,10 @@ public:
|
|||
private:
|
||||
static TreeViewItem& getTopLevelItem (TreeViewItem& item)
|
||||
{
|
||||
TreeViewItem* const p = item.getParentItem();
|
||||
return p != nullptr ? getTopLevelItem (*p) : item;
|
||||
if (TreeViewItem* const p = item.getParentItem())
|
||||
return getTopLevelItem (*p);
|
||||
|
||||
return item;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -199,7 +202,8 @@ public:
|
|||
|
||||
void paintIcon (Graphics& g)
|
||||
{
|
||||
item.getIcon().draw (g, Rectangle<float> (4.0f, 2.0f, item.getIconSize(), getHeight() - 4.0f));
|
||||
item.getIcon().draw (g, Rectangle<float> (4.0f, 2.0f, item.getIconSize(), getHeight() - 4.0f),
|
||||
item.isIconCrossedOut());
|
||||
}
|
||||
|
||||
void resized()
|
||||
|
|
|
|||
|
|
@ -271,8 +271,8 @@ FloatingLabelComponent::FloatingLabelComponent()
|
|||
|
||||
void FloatingLabelComponent::remove()
|
||||
{
|
||||
if (getParentComponent() != nullptr)
|
||||
getParentComponent()->removeChildComponent (this);
|
||||
if (Component* p = getParentComponent())
|
||||
p->removeChildComponent (this);
|
||||
}
|
||||
|
||||
void FloatingLabelComponent::update (Component* parent, const String& text, const Colour& textColour,
|
||||
|
|
@ -401,8 +401,8 @@ bool cancelAnyModalComponents()
|
|||
const int numModal = mm.getNumModalComponents();
|
||||
|
||||
for (int i = numModal; --i >= 0;)
|
||||
if (mm.getModalComponent(i) != nullptr)
|
||||
mm.getModalComponent(i)->exitModalState (0);
|
||||
if (Component* c = mm.getModalComponent(i))
|
||||
c->exitModalState (0);
|
||||
|
||||
return numModal > 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ struct Icon
|
|||
Icon (const Path& p, const Colour& c) : path (&p), colour (c) {}
|
||||
Icon (const Path* p, const Colour& c) : path (p), colour (c) {}
|
||||
|
||||
void draw (Graphics& g, const Rectangle<float>& area) const
|
||||
void draw (Graphics& g, const Rectangle<float>& area, bool isCrossedOut) const
|
||||
{
|
||||
if (path != nullptr)
|
||||
{
|
||||
|
|
@ -66,6 +66,13 @@ struct Icon
|
|||
|
||||
const RectanglePlacement placement (RectanglePlacement::centred | RectanglePlacement::onlyReduceInSize);
|
||||
g.fillPath (*path, placement.getTransformToFit (path->getBounds(), area));
|
||||
|
||||
if (isCrossedOut)
|
||||
{
|
||||
g.setColour (Colours::red.withAlpha (0.8f));
|
||||
g.drawLine ((float) area.getX(), area.getY() + area.getHeight() * 0.2f,
|
||||
(float) area.getRight(), area.getY() + area.getHeight() * 0.8f, 3.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue