Browse Source

Introjucer: Refactored TreeViewBase painting functions

tags/2021-05-28
Joshua Gerrard 9 years ago
parent
commit
bc9439c338
1 changed files with 8 additions and 9 deletions
  1. +8
    -9
      extras/Introjucer/Source/Utility/jucer_JucerTreeViewBase.h

+ 8
- 9
extras/Introjucer/Source/Utility/jucer_JucerTreeViewBase.h View File

@@ -195,19 +195,18 @@ public:
void paint (Graphics& g) override
{
g.setColour (Colours::black);
paintIcon (g);
int rightEdge = getWidth();
Rectangle<int> bounds (getLocalBounds());
if (Component* c = buttons.getFirst())
rightEdge = c->getX();
const int border = 5;
bounds.removeFromLeft (border);
item.paintContent (g, Rectangle<int> (item.textX, 0, rightEdge - item.textX, getHeight()));
}
item.paintIcon (g, bounds.removeFromLeft (15));
void paintIcon (Graphics& g)
{
item.paintIcon (g, Rectangle<int> (getHeight(), getHeight()));
bounds.removeFromLeft (border);
bounds.removeFromRight (border);
item.paintContent (g, bounds);
}
void resized() override


Loading…
Cancel
Save