Browse Source

Projucer: Fixed an issue where the TextEditor overlay when renaming file groups was offset slightly

tags/2021-05-28
ed 7 years ago
parent
commit
4123188367
2 changed files with 6 additions and 5 deletions
  1. +1
    -1
      extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.cpp
  2. +5
    -4
      extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.h

+ 1
- 1
extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.cpp View File

@@ -96,7 +96,7 @@ void JucerTreeViewBase::paintIcon (Graphics &g, Rectangle<float> area)
{
g.setColour (getContentColour (true));
getIcon().draw (g, area, isIconCrossedOut());
textX = roundToInt (area.getRight());
textX = roundToInt (area.getRight()) + 7;
}
void JucerTreeViewBase::paintItem (Graphics& g, int width, int height)


+ 5
- 4
extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.h View File

@@ -208,12 +208,13 @@ public:
TreeItemComponent (JucerTreeViewBase& i) : item (i)
{
setInterceptsMouseClicks (false, true);
item.textX = iconWidth;
}
void paint (Graphics& g) override
{
auto bounds = getLocalBounds().toFloat();
auto iconBounds = bounds.removeFromLeft (25).reduced (7, 5);
auto iconBounds = bounds.removeFromLeft ((float) iconWidth).reduced (7, 5);
bounds.removeFromRight (buttons.size() * bounds.getHeight());
@@ -223,9 +224,7 @@ public:
void resized() override
{
item.textX = getHeight() + 4;
Rectangle<int> r (getLocalBounds());
auto r = getLocalBounds();
for (int i = buttons.size(); --i >= 0;)
buttons.getUnchecked(i)->setBounds (r.removeFromRight (r.getHeight()));
@@ -240,5 +239,7 @@ public:
JucerTreeViewBase& item;
OwnedArray<Component> buttons;
const int iconWidth = 25;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TreeItemComponent)
};

Loading…
Cancel
Save