Browse Source

Minor tweaks and comment corrections.

tags/2021-05-28
jules 11 years ago
parent
commit
af55d142d3
5 changed files with 28 additions and 23 deletions
  1. +8
    -0
      modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp
  2. +2
    -2
      modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp
  3. +2
    -2
      modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm
  4. +1
    -5
      modules/juce_gui_basics/widgets/juce_TreeView.h
  5. +15
    -14
      modules/juce_opengl/opengl/juce_OpenGLContext.cpp

+ 8
- 0
modules/juce_gui_basics/layout/juce_ConcertinaPanel.cpp View File

@@ -282,6 +282,14 @@ ConcertinaPanel::ConcertinaPanel()
ConcertinaPanel::~ConcertinaPanel() {}
Component* ConcertinaPanel::getPanel (int index) const noexcept
{
if (PanelHolder* h = holders[index])
return h->component;
return nullptr;
}
void ConcertinaPanel::addPanel (int insertIndex, Component* component, bool takeOwnership)
{
jassert (component != nullptr); // can't use a null pointer here!


+ 2
- 2
modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V3.cpp View File

@@ -86,10 +86,10 @@ void LookAndFeel_V3::drawConcertinaPanelHeader (Graphics& g, const Rectangle<int
const Colour bkg (Colours::grey);
g.setGradientFill (ColourGradient (Colours::white.withAlpha (isMouseOver ? 0.4f : 0.2f), 0, (float) area.getY(),
Colours::darkgrey.withAlpha (0.2f), 0, (float) area.getBottom(), false));
Colours::darkgrey.withAlpha (0.1f), 0, (float) area.getBottom(), false));
g.fillAll();
g.setColour (bkg.contrasting().withAlpha (0.04f));
g.setColour (bkg.contrasting().withAlpha (0.1f));
g.fillRect (area.withHeight (1));
g.fillRect (area.withTop (area.getBottom() - 1));


+ 2
- 2
modules/juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm View File

@@ -542,10 +542,10 @@ UIViewComponentPeer::~UIViewComponentPeer()
//==============================================================================
void UIViewComponentPeer::setVisible (bool shouldBeVisible)
{
view.hidden = ! shouldBeVisible;
if (! isSharedWindow)
window.hidden = ! shouldBeVisible;
view.hidden = ! shouldBeVisible;
}
void UIViewComponentPeer::setTitle (const String&)


+ 1
- 5
modules/juce_gui_basics/widgets/juce_TreeView.h View File

@@ -610,7 +610,7 @@ public:
you want the tree to contain a number of root items, you should still use a single
root item above these, but hide it using setRootItemVisible().
You can pass in 0 to this method to clear the tree and remove its current root item.
You can pass nullptr to this method to clear the tree and remove its current root item.
The object passed in will not be deleted by the treeview, it's up to the caller
to delete it when no longer needed. BUT make absolutely sure that you don't delete
@@ -711,17 +711,13 @@ public:
//==============================================================================
/** Returns the number of rows the tree is using.
This will depend on which items are open.
@see TreeViewItem::getRowNumberInTree()
*/
int getNumRowsInTree() const;
/** Returns the item on a particular row of the tree.
If the index is out of range, this will return 0.
@see getNumRowsInTree, TreeViewItem::getRowNumberInTree()
*/
TreeViewItem* getItemOnRow (int index) const;


+ 15
- 14
modules/juce_opengl/opengl/juce_OpenGLContext.cpp View File

@@ -714,22 +714,23 @@ void OpenGLContext::setAssociatedObject (const char* name, ReferenceCountedObjec
{
jassert (name != nullptr);
CachedImage* const c = getCachedImage();
// This method must only be called from an openGL rendering callback.
jassert (c != nullptr && nativeContext != nullptr);
jassert (getCurrentContext() != nullptr);
if (CachedImage* const c = getCachedImage())
{
// This method must only be called from an openGL rendering callback.
jassert (nativeContext != nullptr);
jassert (getCurrentContext() != nullptr);
const int index = c->associatedObjectNames.indexOf (name);
const int index = c->associatedObjectNames.indexOf (name);
if (index >= 0)
{
c->associatedObjects.set (index, newObject);
}
else
{
c->associatedObjectNames.add (name);
c->associatedObjects.add (newObject);
if (index >= 0)
{
c->associatedObjects.set (index, newObject);
}
else
{
c->associatedObjectNames.add (name);
c->associatedObjects.add (newObject);
}
}
}


Loading…
Cancel
Save